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_n