editMode=(<%=Input[i][152]%>)?'edit':'readonly';
delimiter
_c0x2=_c0x2+(_c0x2?',':'')+_c0x1[i4];
s2=s2+(s2?'<BR><BR>':'')+_lookup('SALES_ORDER_PO_DESC.DESCRIPTION'+i2)
It is my Computer Notes. Using Guide : object-key or object-key-key e.g. Step 1 Blog Search : [mysql-run] and then Step 2 ctrl+F [mysql-run] {bookMark me : Ctrl+D}
2014年12月28日 星期日
2014年12月27日 星期六
2014年12月26日 星期五
img-center css-center
<img id="waiting" src="images/ajax_loader.gif" alt="" width="128" height="128"
style=" position: absolute;
top: 50%; left: 50%; margin-top: -50px; margin-left: -50px; width: 100px; height: 100px;"
>
style=" position: absolute;
top: 50%; left: 50%; margin-top: -50px; margin-left: -50px; width: 100px; height: 100px;"
>
2014年12月18日 星期四
generator-subform button-subform
{object}
0.5,query.OPEN,button,0,0,:OPEN,,
{labelInLineStyle}display:inline;{/labelInLineStyle}
{subform}
input.jsp?mode=SINPUT&input=payment.txt&config='+ListSubFormConfig+'&config0=paymentConfig.txt&key=recordid&keyValue='+Xdata[thisRowNo]+'&timer=datetimr()
{/subform}
{colspan}2{/colspan}
{/object}
0.5,query.OPEN,button,0,0,:OPEN,,
{labelInLineStyle}display:inline;{/labelInLineStyle}
{subform}
input.jsp?mode=SINPUT&input=payment.txt&config='+ListSubFormConfig+'&config0=paymentConfig.txt&key=recordid&keyValue='+Xdata[thisRowNo]+'&timer=datetimr()
{/subform}
{colspan}2{/colspan}
{/object}
2014年12月16日 星期二
generator-variable
{saveValidation}
if (documentAction=='A'){
var s=lookupTable('CAN_AUTO_APPROVE_BY_DATE','SALES_ORDER_REPORT2.RECORDID',_lookup('query.PARENT_RECORDID'));
var s2=lookupTable('MAX_COST','BOM_LIST.RECORDID',RECORDID);
var s3=_lookup('query.SOI_PO_COST')*1;
/*alert(' s2'+s2+' s3: '+s3); */
if (s==0 | s3>s2){alert(' Remark : This BOM Need Special Approve');}
}
{/saveValidation}
Standard
standard Template
sql Variable
where=where (status:`A` or status:`D` or status:`C` or status:`S` or status:`R` or status:`P`) and PO_DDATE<:ADDDATE(curdate(), INTERVAL '+7+' DAY)
countChecked i.e. count the checked. and save to the countEhecked Variable
countChecked[0]
{countChecked}0{/countChecked}
USER
var notSameUser=(USER!=lookupTable('PAYEE_INPUT_USERNAME','VENDOR.RECORDID',RECORDID));Checked[0]
COMPANY_NAME
_refreshv2('SALES_HEADER.PAYMENT_METHOD_REMARK','Please send a crossed cheque made payable to “'+COMPANY_NAME+'”.' );
DISK_DOC_STATUS
endofload=if(DISK_DOC_STATUS!:'D'){document.getElementById('SALES_ORDER_INV_DESC_gridButton1').style.display : 'none';}
thisRowNo
a
this.id
{refresh}DOCUMENT=($.trim(_lookup('this.id'))+'-'+$.trim(_lookup('PURCHASE_HEADER.VERSION'))).replace('-0',''); if (DOCUMENT==''){$("#printCaption0").css("disabled", "disabled" );}{/refresh}
2014年12月15日 星期一
generator-dependent
{object}
0.69,PURCHASE_HEADER.NURSERY_PERIOD,num.0,10%,200,Nursery Period,,
{toolTips}Nursery Period{/toolTips}
{alignRight}
{classGroup}PS{/classGroup}
{/object}
{object}
0.69,PURCHASE_HEADER.NURSERY_PERIOD_UOM,combo,5,3,,,
{combo}Day,Day,Week,Week,Month,Month{/combo}
{dependent}
{/object}
2014年12月11日 星期四
generator-sumtotal generator-total
generator-subtotal generator-sum
Sum 1 column Grand Total
{SumTotal}SumTotal('tableName()','this.id','this.id','query.DOMAIN_AMOUNT','query.DOMAIN_AMOUNT'){/SumTotal}
Sum Qty, price to amount and Grand Total
{SumTotal}SumTotal('tableName()','this..QTY','this..PRICE','this..AMOUNT','SUPPLIER_INVOICE_HEADER.AMOUNT',
1,'SUPPLIER_INVOICE_LINE',''){/SumTotal}
***********************************************
1.261,SALES_ORDER_INV_DESC.PRICE,text:GRID,10%,150,Price,,{numeric} {alignRight} {SumTotal}SumTotal('tableName()','this..QTY','this.id','this..AMOUNT'){/SumTotal}
Red Color Must
Sum 1 column Grand Total
{SumTotal}SumTotal('tableName()','this.id','this.id','query.DOMAIN_AMOUNT','query.DOMAIN_AMOUNT'){/SumTotal}
Sum Qty, price to amount and Grand Total
{SumTotal}SumTotal('tableName()','this..QTY','this..PRICE','this..AMOUNT','SUPPLIER_INVOICE_HEADER.AMOUNT',
1,'SUPPLIER_INVOICE_LINE',''){/SumTotal}
***********************************************
1.261,SALES_ORDER_INV_DESC.PRICE,text:GRID,10%,150,Price,,{numeric} {alignRight} {SumTotal}SumTotal('tableName()','this..QTY','this.id','this..AMOUNT'){/SumTotal}
Red Color Must
2014年12月10日 星期三
generator-domain-amount
{object}
0.38,query.AMOUNT,text,10,50,Amount,,
{spaceLine}
{readonly}
{currency}{alignRight}
{endOfLoad}$('.query_AMOUNT_label').html('Amount ('+COMPANY_CUR+')');{/endOfLoad}
{/object}
2014年12月8日 星期一
generator-invisible generator-visible
{object}
1.361,SUPPLIER_INVOICE_LINE.CODE_RECORDID,text:GRID,0,150,CODE,,
{invisible}
{/object}
{visibleWhen} PROCESSING_MODE=='D' {/visibleWhen}
{invisibleWhen} PROCESSING_MODE=='D' | PROCESSING_MODE=='R' {/invisibleWhen}
{invisibleWhen}
(PROCESSING_MODE=='D' | PROCESSING_MODE=='R' | PROCESSING_MODE=='A') & CONFIGFILE!='customerInvoiceToInvoiceConfig.txt'
{/invisibleWhen}
{tdInLineStyle}display:none;{/tdInLineStyle}
{thInLineStyle}display:none;{/thInLineStyle}
{layoutInvisibleWhenPROCESSING_MODE}P,a,R,S{/layoutInvisibleWhenPROCESSING_MODE} Payment DnoteList
{buttonVisibleAlways}
{deleteButtonInvisibleAlways}
deleteVisible=1
deleteAction=withHeader
InvisibleRetrivalNumber=1
{invisibleWhen}{visibleWhen}
{invisibleWhenSearch}
{invisibleWhenBOM}B
{invisibleWhenRevoke}=R
{invisibleWhenActive} =a
{invisibleWhenSearch}=S
{invisibleWhenDraft} = D
{invisibleWhenPartial} =P
{invisibleWhenApprove}=A
invisibleButtonWhenNoRow('SALES_ORDER_INV_DESC','1_011','submit1');invisibleButtonWhenNoRow('SALES_ORDER_INV_DESC','1_011','submit2');
1.361,SUPPLIER_INVOICE_LINE.CODE_RECORDID,text:GRID,0,150,CODE,,
{invisible}
{/object}
{visibleWhen} PROCESSING_MODE=='D' {/visibleWhen}
{invisibleWhen} PROCESSING_MODE=='D' | PROCESSING_MODE=='R' {/invisibleWhen}
{invisibleWhen}
(PROCESSING_MODE=='D' | PROCESSING_MODE=='R' | PROCESSING_MODE=='A') & CONFIGFILE!='customerInvoiceToInvoiceConfig.txt'
{/invisibleWhen}
{tdInLineStyle}display:none;{/tdInLineStyle}
{thInLineStyle}display:none;{/thInLineStyle}
{layoutInvisibleWhenPROCESSING_MODE}P,a,R,S{/layoutInvisibleWhenPROCESSING_MODE} Payment DnoteList
{buttonVisibleAlways}
{deleteButtonInvisibleAlways}
deleteVisible=1
deleteAction=withHeader
InvisibleRetrivalNumber=1
{invisibleWhen}{visibleWhen}
{invisibleWhenSearch}
{invisibleWhenBOM}B
{invisibleWhenRevoke}=R
{invisibleWhenActive} =a
{invisibleWhenSearch}=S
{invisibleWhenDraft} = D
{invisibleWhenPartial} =P
{invisibleWhenApprove}=A
invisibleButtonWhenNoRow('SALES_ORDER_INV_DESC','1_011','submit1');invisibleButtonWhenNoRow('SALES_ORDER_INV_DESC','1_011','submit2');
2014年12月4日 星期四
javascript-if
el=document.createElement('<'+tag+(type?' type='+type:'')+' name='+nme+' >');
var y = (x == 2 ? "yes" : "no");
2014年12月2日 星期二
2014年12月1日 星期一
generator-debug log
null Select distinct recordid,if(isnull(TIMESTAMP),"",CONCAT(TIMESTAMP," ",SAVE_ACTION)) ,if(isnull(CONTENT),"",CONCAT(USER," - ",CONTENT)),USER,SAVE_ACTION from MESSAGE_VIEW0 where parent_recordid = D order by TIMESTAMP DESC com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'D' in 'where clause' ]);
null Select distinct null from null where (status='A' or status='D' or status='F' or status='R' or status='P') and ( (false or ( DOC_NO like '%competition%') or ( NO_2 like '%competition%') or ( NAME like '%competition%') )) order by null limit 25 offset 0 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null where (status='A' or status='D' or status='F' or status='R' or status='' at line 1 ]);
jQuery19108735514129512012_1430359737833([ ['1419391286546',' HP ProDesk 600 G1 TWR<z><z>- Intel Core i7-4790 3.6G 8M HD 4600 CPU<z><z>- 4GB DDR3-1600 DIMM (1x4GB) RAM<z><z>- 1TB 7200 RPM 3.5 Hard Drive<z><z>- 1TB 7200 RPM 3.5 2nd Hard Drive<z><z>- AMD Radeon R9 255 2GB PCIe x16 GFX<z><z>- Slim SuperMulti Optical Disc Drive<z><z>- HP USB Keyboard - Win Taiwan<z><z>- HP USB Mouse<z><z>- Windows 7 Professional 32 bit OS DVD+ DRDVD<z><z>- Windows 7 Professional 64 bit OS DVD+ DRDVD<z><z>- Preload Microsoft Windows 7 Professional 32 bit (Traditional Chinese)' Select distinct RECORDID,DESCRIPTION from SALES_ORDER_INV_DESC where 1=1 order by DESCRIPTION java.sql.SQLException: Column Index out of range, 3 > 2. ]);
you are only selecting a single column, yet you are trying to access the third column in your result.
Change
getString(3)
to getString(1)
and you should be fine.user action
DATALOCK;
DATALOCK_HISTORY;
SELECT USER,TIMESTAMP FROM DB_LOG_BAK00 WHERE DATE(TIMESTAMP)=CURDATE() ;
view user login
select login_time, login_date , login_id from erp.USER ORDER BY LOGIN_DATE;
database
select LOG from DB_LOG WHERE DATE(TIMESTAMP)=CURDATE() AND LOG LIKE'%EXCEPT%';
select timestamp from DB_LOG WHERE DATE(TIMESTAMP)=CURDATE();
delete from GRN_LINE where = 1425438570590 ;
SELECT LOG FROM DB_LOG WHERE LOG LIKE '%SQLException%'
AND DATE(TIMESTAMP)=CURDATE()
;
MySQLSyntaxErrorException:view' doesn't exist
java.sql.SQLException: Lock wait timeout exceeded
java.sql.SQLException: Data truncated
java.sql.SQLException: Incorrect integer value:
javascript
var myWindowxx = window.open('', 'MsgWindow','_blank');
myWindowxx.document.write('abcd');
SELECT LOG FROM DB_LOG WHERE REC_NO=63;
/**************************/
DNOTE_NO='DNTP01503007'
RECORDID=1420525755409
SOHD_DNBODYOS.DESCRIPTION
<- SOHD_DNBODY <- SODNBODY < - DNBODY
SELECT DESCRIPTION FROM DNOTE_LINE WHERE DESCRIPTION LIKE '%GW%';
SELECT DN_DESC FROM DNBODY WHERE DN_DESC LIKE '%GW%';
SELECT DN_DESC FROM SODNBODY WHERE DN_DESC LIKE '%GW%';
SELECT DN_DESC FROM SOHD_DNBODY WHERE DN_DESC LIKE '%GW%';
SELECT DN_DESC FROM SOHD_DNBODYOS WHERE DN_DESC LIKE '%GW%';
SELECT DN_NO, DN_DESC,QD_NO FROM SOHD_DNBODY WHERE DN_DESC LIKE '%GW%'
SELECT DN_DESC,QD_NO,DNQTY,INVQTY FROM SOHD_DNBODY WHERE DN_DESC LIKE '%GW
SELECT QD_NO FROM SOHD_DNBODY WHERE QD_NO LIKE '%4125%'
SELECT QD_NO FROM SALES_ORDER_HEAD WHERE QD_NO LIKE '%4125%';
SELECT DNOTE_LINE.USER, DNOTE_LINE.TIMESTAMP,DNOTE_LINE.RECORDID,SO_RECORDID,SALES_ORDER_INV_DESC.RECORDID FROM DNOTE_LINE
LEFT JOIN SALES_ORDER_INV_DESC ON SALES_ORDER_INV_DESC.RECORDID=DNOTE_LINE.SO_RECORDID
WHERE DNOTE_LINE.PARENT_RECORDID=1420525755409;
SELECT RECORDID FROM SALES_ORDER_HEAD WHERE SALES_ORDER='SOTP01503001'; // 1420193987163
SELECT RECORDID FROM SALES_ORDER_INV_DESC WHERE PARENT_RECORDID=1420193987163; //1420774626655
SELECT * FROM DNOTE_LINE WHERE SO_RECORDID=1420774626655;
SELECT * FROM DNOTE_LINE WHERE SO_RECORDID=1420444533025;
SELECT RECORDID FROM SALES_ORDER_INV_DESC WHERE RECORDID=1420444533025;
UPDATE DNOTE_LINE SET SO_RECORDID=1420774626655 WHERE RECORDID=1420525762175;
2014年11月28日 星期五
How to place a div center of the window after scrolling
I suggest the following solution:
1) In JS when you want to show a window:
{
var width = $(window).width();
var heigth = $(window).height();
var myWindow = $('.my-window');
myWindow .show('fast');
myWindow .offset(
{
left: (width - myWindow .width()) / 2 + $(window).scrollLeft(),
top: (heigth - myWindow .height()) / 2 + $(window).scrollTop()
});
}
2) in CSS: .my-window
{
position: fixed;
2014年11月26日 星期三
jsp2html
http://stackoverflow.com/questions/138999/how-to-output-html-from-jsp-block
public final class foo_jsp
{
// This is where the request comes in
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
// JspWriter instance is gotten from a factory
// This is why you can use 'out' directly in scriptlets
JspWriter out = ...;
// Snip
out.write("<html>");
out.write("<head/>");
out.write("<body>");
out.write(someOutput()); // i.e. write the results of the method call
out.write("</body>");
out.write("</html>");
}
// Directive gets translated as separate method - note
// there is no 'out' variable declared in scope
private String someOutput()
{
return "Some output";
}
}
2014年11月25日 星期二
generator-getjson
{getJson}tableRead?table=SETTINGS&fields=code,description&where=where status:`D` AND DATA_GROUP:`uom`&format=S,S&callback=?{/getJson}
{combo}
{getJson}
tableRead?table=SETTINGS&fields=code,description&where=where status:`D` AND DATA_GROUP:`mtype`&format=S,S&callback=?
{/getJson}
{combo}N/A,N/A,on-site M1,on-site M1,on-site M2,on-site M2,on-site M3,on-site M3,on-site,on-site,carry-in,carry-in{/combo}
{getJson}tableRead?table=SETTINGS&fields=code,description&where=where status:`D` AND DATA_GROUP:`cat`&format=S,S&callback=?{/getJson}
{combo}
{getJson}
tableRead?table=SETTINGS&fields=code,description&where=where status:`D` AND DATA_GROUP:`mtype`&format=S,S&callback=?
{/getJson}
{combo}N/A,N/A,on-site M1,on-site M1,on-site M2,on-site M2,on-site M3,on-site M3,on-site,on-site,carry-in,carry-in{/combo}
{getJson}tableRead?table=SETTINGS&fields=code,description&where=where status:`D` AND DATA_GROUP:`cat`&format=S,S&callback=?{/getJson}
2014年11月24日 星期一
generator-validation -saveValidatioin -doSomethingWhenSave
{object}
3.222,SALES_ORDER_INV_DESC.MAINTAIN_RENEW_NOTICE,check:GRID,2%,150,MN,,
{toolTips}Renew Notice{/toolTips}
{countChecked}0{/countChecked}
{/object}
{object}
5.69,SALES_ORDER_HEAD.REMARK,textarea,100%,12,Remark,, {labelInLineStyle}width:auto;{/labelInLineStyle}
{saveValidation}
var s1216=_lookup('SALES_ORDER_HEAD.REMARK');
if (countChecked[0]>=1 & s1216==''){alert('Please Input SO Remark for Maintain Renew Notice.');result=false;}
{/saveValidation}
{/object}
{saveValidation}
var s1107=_lookup('SALES_ORDER_HEAD.QD_NO');
var aaaa=lookupTable('SALES_ORDER','SALES_ORDER_HEAD.QD_NO',s1107,'(NOT RECORDID='+RECORDID+')');
if(aaaa) alert('This Company QD '+s1107+ ' have used before in : \n\n'+aaaa+' ');
{/saveValidation}
2014年11月23日 星期日
generator-dictionary
A
alert
if(aaaa) alert('This Company QD '+s1107+ ' have used before in : \n\n'+aaaa+' ');
all_address_book
(Email,phone,name,recordid,parent_recordid,status)
appendData0ActionAfter
B
C
table.CreateUser
SELECT CREATEDATETIME,CREATEUSER,USER,CREATEUSERNAME FROM SALES_ORDER_HEAD WHERE CREATEUSERNAME='WINNIE';
LoginCheck.jsp
bean.setRecordid(rs.getString(3).trim());
input.jsp
-USER_RECORDID=bean.getRecordid();
-USER = bean.getAlias()+" "+bean.getLastName();
ShowParameter.java
-USER_RECORDID=_userRecordid (paramValue in ShowParameter.java)
mysql Trigger
table.CREATEUSER <= new.USER_RECORDID
CREATEUSRRNAME
A
D
DISABLED
check disabled
if(newAdd==0){document.getElementById('SALES_ORDER_HEAD.DIVISION').disabled = true;};
A
doc_no
It can remove.
1. text. 2 config file
D
J
JAVA-Variable
a
K
L
lookupTable
lookupTable('SQD_FILE','SOPOQTY.SALES_ORDER',s1103x,'SQD_FILE<>"" and supplier='+sKey);
Reject
SaveButton3Caption=Reject
SaveButton3ClickMethod=documentAction:'R';saveAction:'Reject';_refreshv2('DNOTE_HEADER.STATUS','R');
Table
table{border-spacing:2px;border-color}
vertical-align:top
alert
if(aaaa) alert('This Company QD '+s1107+ ' have used before in : \n\n'+aaaa+' ');
all_address_book
(Email,phone,name,recordid,parent_recordid,status)
appendData0ActionAfter
B
C
table.CreateUser
SELECT CREATEDATETIME,CREATEUSER,USER,CREATEUSERNAME FROM SALES_ORDER_HEAD WHERE CREATEUSERNAME='WINNIE';
LoginCheck.jsp
bean.setRecordid(rs.getString(3).trim());
input.jsp
-USER_RECORDID=bean.getRecordid();
-USER = bean.getAlias()+" "+bean.getLastName();
ShowParameter.java
-USER_RECORDID=_userRecordid (paramValue in ShowParameter.java)
mysql Trigger
table.CREATEUSER <= new.USER_RECORDID
CREATEUSRRNAME
A
D
DISABLED
check disabled
if(newAdd==0){document.getElementById('SALES_ORDER_HEAD.DIVISION').disabled = true;};
A
doc_no
It can remove.
1. text. 2 config file
D
J
JAVA-Variable
a
K
L
lookupTable
lookupTable('SQD_FILE','SOPOQTY.SALES_ORDER',s1103x,'SQD_FILE<>"" and supplier='+sKey);
Reject
SaveButton3Caption=Reject
SaveButton3ClickMethod=documentAction:'R';saveAction:'Reject';_refreshv2('DNOTE_HEADER.STATUS','R');
Table
table{border-spacing:2px;border-color}
vertical-align:top
2014年11月22日 星期六
generator-example-upload generator-rename-file rename file
{object}
0.55,SALES_HEADER.SIGNED_INV,upload,40%,10,Signed INV,,
{readonly} it is effect the display !!
{spaceLine}
{onclick}s=_lookup('this..INV_NO');
if(s){s=s+'-';}
if(s){s=s+_lookup('this..VERSION');}if(!s) {;mTargetName=datetimer();} else {s=s+'_SignedINV';mTargetName=s;}{/onclick}
{folder}iv{/folder}
{rename}SALES_HEADER~SIGNED_INV~INV_NO~_SignedINV{/rename}
{renameMessage}The file name will rename to Customer Invoice{/renameMessage}
{invisibleWhen}
PROCESSING_MODE=='D' | PROCESSING_MODE=='R' | PROCESSING_MODE=='A'
{/invisibleWhen}
{enableWhenApprove}
{errMess}Please upload signed Invoice{/errMess}
{enableWhenPartial}
{/object}
---------------------------------------------------------------------------------------
{visibleWhen} <= view the file name
PROCESSING_MODE=='P' | PROCESSING_MODE=='S' | PROCESSING_MODE=='A' | PROCESSING_MODE=='R' | PROCESSING_MODE=='a'{/visibleWhen}
--------------------------------------------------------------------------------
{invisibleWhen} <= the upload button not display
PROCESSING_MODE=='D' | PROCESSING_MODE=='R' | PROCESSING_MODE=='A'
{/invisibleWhen}
-------------------------------------------------------------
{object}
0.55,SALES_HEADER.SIGNED_INV,upload,40%,10,Signed INV,,
{onclick}s=_lookup('this..INV_NO');
if(s){s=s+'-';}
if(s){s=s+_lookup('this..VERSION');}if(!s) {;mTargetName=datetimer();} else {s=s+'_SignedINV';mTargetName=s;}{/onclick}
{folder}iv{/folder}
{rename}SALES_HEADER~SIGNED_INV~INV_NO~_SignedINV{/rename}
{renameMessage}The file name will rename to Customer Invoice{/renameMessage}
{/object}
generator-upload
{onclick}
s=_lookup('this..SALES_ORDER');if(!s)
{;mTargetName=datetimer();} else {s=s+'_CQD';mTargetName=s;}
{/onclick}
{folder}so{/folder}
{rename}SALES_ORDER_HEAD~SIGNED_QD~SALES_ORDER~_CQD{/rename}
{renameMessage}The file name will rename to Sales Order{/renameMessage}
--------------------------------------------------------------
0.55,SALES_ORDER_HEAD.SIGNED_CPO,upload,6,10,Signed CPO,, {readonly}{42}s=_lookup('SALES_ORDER_HEAD.SALES_ORDER');if(!s) {alert('No S.O. Number, Please Save it Before Continue');mTargetName='NoContinue';} else {s=s+'_CPO';mTargetName=s;}{/42}
0.55,SALES_HEADER.SIGNED_INV,upload,40%,10,Signed INV,,
{readonly} it is effect the display !!
{spaceLine}
{onclick}s=_lookup('this..INV_NO');
if(s){s=s+'-';}
if(s){s=s+_lookup('this..VERSION');}if(!s) {;mTargetName=datetimer();} else {s=s+'_SignedINV';mTargetName=s;}{/onclick}
{folder}iv{/folder}
{rename}SALES_HEADER~SIGNED_INV~INV_NO~_SignedINV{/rename}
{renameMessage}The file name will rename to Customer Invoice{/renameMessage}
{invisibleWhen}
PROCESSING_MODE=='D' | PROCESSING_MODE=='R' | PROCESSING_MODE=='A'
{/invisibleWhen}
{enableWhenApprove}
{errMess}Please upload signed Invoice{/errMess}
{enableWhenPartial}
{/object}
---------------------------------------------------------------------------------------
{visibleWhen} <= view the file name
PROCESSING_MODE=='P' | PROCESSING_MODE=='S' | PROCESSING_MODE=='A' | PROCESSING_MODE=='R' | PROCESSING_MODE=='a'{/visibleWhen}
--------------------------------------------------------------------------------
{invisibleWhen} <= the upload button not display
PROCESSING_MODE=='D' | PROCESSING_MODE=='R' | PROCESSING_MODE=='A'
{/invisibleWhen}
-------------------------------------------------------------
{object}
0.55,SALES_HEADER.SIGNED_INV,upload,40%,10,Signed INV,,
{onclick}s=_lookup('this..INV_NO');
if(s){s=s+'-';}
if(s){s=s+_lookup('this..VERSION');}if(!s) {;mTargetName=datetimer();} else {s=s+'_SignedINV';mTargetName=s;}{/onclick}
{folder}iv{/folder}
{rename}SALES_HEADER~SIGNED_INV~INV_NO~_SignedINV{/rename}
{renameMessage}The file name will rename to Customer Invoice{/renameMessage}
{/object}
generator-upload
{onclick}
s=_lookup('this..SALES_ORDER');if(!s)
{;mTargetName=datetimer();} else {s=s+'_CQD';mTargetName=s;}
{/onclick}
{folder}so{/folder}
{rename}SALES_ORDER_HEAD~SIGNED_QD~SALES_ORDER~_CQD{/rename}
{renameMessage}The file name will rename to Sales Order{/renameMessage}
--------------------------------------------------------------
0.55,SALES_ORDER_HEAD.SIGNED_CPO,upload,6,10,Signed CPO,, {readonly}{42}s=_lookup('SALES_ORDER_HEAD.SALES_ORDER');if(!s) {alert('No S.O. Number, Please Save it Before Continue');mTargetName='NoContinue';} else {s=s+'_CPO';mTargetName=s;}{/42}
generator-invisble -invisibleWhen
{invisibleWhen}
PROCESSING_MODE=='D' | PROCESSING_MODE=='R'
{/invisibleWhen}
2014年11月4日 星期二
programs log / dialy 20150117 notes
$('input[type="text"]:not(.approveAllow)').keypress(function(e){e.preventDefault();});
//$.ajax({url: "heartbeat"})
d
http://stackoverflow.com/questions/7495985/byte-limit-exceed-problem-when-reloading-a-jsp-page
SELECT COUNT(DISTINCT RECORDID) FROM GRN_HEADER_VIEW0;
{tdInLineStyle}vertical-align:top;magin-top:15px;{/tdInLineStyle}
The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit
el=document.createElement('<'+tag+(type?' type='+type:'')+' name='+nme+' >');
$('.PURCHASE_HEADER_SIGNED_PO_viewUpload').width($('.PURCHASE_HEADER_SIGNED_PO_viewUpload').parent().parent().width()-
$('.PURCHASE_HEADER_SIGNED_PO_UploadButton').width()-20);
dNotes.txt
{onchange}
var c=_lookup('DNOTE_LINE.MAINTAIN_MTHS'+thisRowNo);
var s0730=_lookup('DNOTE_LINE.ACTIVE_DATE'+thisRowNo);
if (s0730){
var d=parseDate(s0730);
var e=d.setMonth(d.getMonth() + c*1);
var f=new Date(e);
s0723=dtos(f,'yyyy-mm-dd');
_refreshv2('DNOTE_LINE.EXPIRE_DATE'+thisRowNo,s0723);
}
s0730=null;
c=null;
{/onchange}
date calculate
SELECT SO_REFERENCE.*,SALES_ORDER_HEAD.SALES_ORDER FROM SO_REFERENCE
LEFT JOIN SALES_ORDER_HEAD ON SALES_ORDER_HEAD.RECORDID=SO_REFERENCE.SOH_RECORDID
;
20141113
purchase.txt
{object}
0.12,PURCHASE_HEADER.PURCHASE_ORDER,text,10,10,Purchase Order,, {readonly}
{disabled}
{spaceLine}
{/object}
function SumTotal(gridTableName,value1,value2,targetValue,grandTotal,curRate,tableName)
var s1111b=lookupTable('SQD_FILE','SOPOQTY.SALES_ORDER',s1103x,'SQD_FILE<>"" and supplier='+s1111);
20141107
salesOrder.txt
{object}
0.67,SALES_ORDER_HEAD.MULTI_ADDRESS,check,0,0,Address:Multi ,,
{spaceLine}
{onchange}
$('.DeliveryTo').css('display',(this.checked?'none':'inline'));
{/onchange}
{endOfLoad}
$('.DeliveryTo').css('display',(document.getElementById('this.id').checked?'none':'inline'));
{/endOfLoad}
{/object}
short Cut if
20141110
input.jsp
r=r+"var s1111=data[0]["+cInputCount+"].replace(/,/g,''); "; //20141111
r=r+"s1111=s1111*1;s1111=s1111.formatMoney(2, '.', ',');"; //20141111
r=r+"_refreshv2('"+vVariable[a][28]+"',s1111); "; //20141111
20141105
Input.jsp
$('td input,td select').each(function()
{
var n78,s,v;
n78=$(this).attr('rowNum'); //grid.fieldname
s=$(this).attr('fieldName'); //grid.fieldname
v=$(this).val();
if (!v) v='';
<%=gridValids%> //grid.validation
}
table.scan
LoginCheck.jsp
String connectionURL = "jdbc:mysql://localhost/dataBaseName?useUnicode=true&characterEncoding=UTF8";
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection(connectionURL, "user", "password");
Statement st=con.createStatement();
String sql="";
sql="UPDATE USER SET LOGIN_DATE=CURDATE(),
LOGIN_TIME=CURTIME(),LOGIN_IP='"
+request.getRemoteAddr() +"'"
+" WHERE USER.login_id='"+ loginId +"'"
+"and USER.company_Name='"+companyName+"'";
st.executeUpdate(sql);
update login_ip
createDatabase.jsp
connectionURL = "jdbc:mysql://localhost/erp"+"?useUnicode=true&characterEncoding=UTF8";
Connection connection=DriverManager.getConnection(connectionURL, "userName", "userPassword");
Statement st = connection.createStatement();
String sql = "insert IGnore into " + table + " ( " + mfields+ ") value (" + mvalues + " ) ;";
out.println(sql);
st.executeUpdate(sql)
input.jsp
20141104
menu3.jsp
$('a[class="oe_menu_leaf"]').click(function(){
if(timeOut){clearTimeout(timeOut); timeOut=0;}
$(".oe_menu_leaf").css('color','');
$(".oe_menu_leaf").css('background-color','');
$(this).css('color','black');
$(this).css('background-color','#FDA352');
});
jquery this handling
tableRead.java
s3=s3.replaceAll("\r", "<z>").replaceAll("\n", "<z>"); // multi Line
if(output.equals("csv")) {s3=s3.replaceAll("\"", "\"\"");} // doubleQuote
if(output.equals("csv") & s3.indexOf("<z>")>=0) {s3="\""+s3.replaceAll("<z>", "\n")+"\"";} //multi Line
else if(output.equals("csv") & s3.indexOf(",")>=0) {s3="\""+s3+"\"";} // comma handling
java to csv handling
input.jsp
var t1='<%=reportDate%>';
t1 = t1.split(" ")[0];
tableWrite.java
String callback = request.getParameter("callback");
String _r = callback+"([['success','"+sqlString+"']])" ;
out.print(_r);
out.flush();
remark :
s='tableRead?table=USER&fields=RECORDID,LOGIN_ID&where=where db:`<%=bean.getDatabase()%>` and status:1 &format=S,S&callback=?&db=erp'
//$.ajax({url: "heartbeat"})
d
http://stackoverflow.com/questions/7495985/byte-limit-exceed-problem-when-reloading-a-jsp-page
SELECT COUNT(DISTINCT RECORDID) FROM GRN_HEADER_VIEW0;
{tdInLineStyle}vertical-align:top;magin-top:15px;{/tdInLineStyle}
The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit
el=document.createElement('<'+tag+(type?' type='+type:'')+' name='+nme+' >');
$('.PURCHASE_HEADER_SIGNED_PO_viewUpload').width($('.PURCHASE_HEADER_SIGNED_PO_viewUpload').parent().parent().width()-
$('.PURCHASE_HEADER_SIGNED_PO_UploadButton').width()-20);
dNotes.txt
{onchange}
var c=_lookup('DNOTE_LINE.MAINTAIN_MTHS'+thisRowNo);
var s0730=_lookup('DNOTE_LINE.ACTIVE_DATE'+thisRowNo);
if (s0730){
var d=parseDate(s0730);
var e=d.setMonth(d.getMonth() + c*1);
var f=new Date(e);
s0723=dtos(f,'yyyy-mm-dd');
_refreshv2('DNOTE_LINE.EXPIRE_DATE'+thisRowNo,s0723);
}
s0730=null;
c=null;
{/onchange}
date calculate
SELECT SO_REFERENCE.*,SALES_ORDER_HEAD.SALES_ORDER FROM SO_REFERENCE
LEFT JOIN SALES_ORDER_HEAD ON SALES_ORDER_HEAD.RECORDID=SO_REFERENCE.SOH_RECORDID
;
document.getElementById('deleteCaption0').title:s1113c;
20141113
purchase.txt
{object}
0.12,PURCHASE_HEADER.PURCHASE_ORDER,text,10,10,Purchase Order,, {readonly}
{disabled}
{spaceLine}
{/object}
Document Number is gen
function SumTotal(gridTableName,value1,value2,targetValue,grandTotal,curRate,tableName)
var s1111b=lookupTable('SQD_FILE','SOPOQTY.SALES_ORDER',s1103x,'SQD_FILE<>"" and supplier='+s1111);
20141107
salesOrder.txt
{object}
0.67,SALES_ORDER_HEAD.MULTI_ADDRESS,check,0,0,Address:Multi ,,
{spaceLine}
{onchange}
$('.DeliveryTo').css('display',(this.checked?'none':'inline'));
{/onchange}
{endOfLoad}
$('.DeliveryTo').css('display',(document.getElementById('this.id').checked?'none':'inline'));
{/endOfLoad}
{/object}
short Cut if
20141110
input.jsp
r=r+"var s1111=data[0]["+cInputCount+"].replace(/,/g,''); "; //20141111
r=r+"s1111=s1111*1;s1111=s1111.formatMoney(2, '.', ',');"; //20141111
r=r+"_refreshv2('"+vVariable[a][28]+"',s1111); "; //20141111
20141105
Input.jsp
$('td input,td select').each(function()
{
var n78,s,v;
n78=$(this).attr('rowNum'); //grid.fieldname
s=$(this).attr('fieldName'); //grid.fieldname
v=$(this).val();
if (!v) v='';
<%=gridValids%> //grid.validation
}
table.scan
LoginCheck.jsp
String connectionURL = "jdbc:mysql://localhost/dataBaseName?useUnicode=true&characterEncoding=UTF8";
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection(connectionURL, "user", "password");
Statement st=con.createStatement();
String sql="";
sql="UPDATE USER SET LOGIN_DATE=CURDATE(),
LOGIN_TIME=CURTIME(),LOGIN_IP='"
+request.getRemoteAddr() +"'"
+" WHERE USER.login_id='"+ loginId +"'"
+"and USER.company_Name='"+companyName+"'";
st.executeUpdate(sql);
createDatabase.jsp
connectionURL = "jdbc:mysql://localhost/erp"+"?useUnicode=true&characterEncoding=UTF8";
Connection connection=DriverManager.getConnection(connectionURL, "userName", "userPassword");
Statement st = connection.createStatement();
String sql = "insert IGnore into " + table + " ( " + mfields+ ") value (" + mvalues + " ) ;";
out.println(sql);
st.executeUpdate(sql)
input.jsp
<input id='testName' type='checkbox' value='Yes' name='testName'>
<input id='testNameHidden' type='hidden' value='No' name='testName'>
Before submitting the form , disabled the hidden field based on the checked condition
if(document.getElementById("testName").checked){
document.getElementById('testNameHidden').disabled = true;
}
Submit check box
20141104
menu3.jsp
$('a[class="oe_menu_leaf"]').click(function(){
if(timeOut){clearTimeout(timeOut); timeOut=0;}
$(".oe_menu_leaf").css('color','');
$(".oe_menu_leaf").css('background-color','');
$(this).css('color','black');
$(this).css('background-color','#FDA352');
});
jquery this handling
tableRead.java
s3=s3.replaceAll("\r", "<z>").replaceAll("\n", "<z>"); // multi Line
if(output.equals("csv")) {s3=s3.replaceAll("\"", "\"\"");} // doubleQuote
if(output.equals("csv") & s3.indexOf("<z>")>=0) {s3="\""+s3.replaceAll("<z>", "\n")+"\"";} //multi Line
else if(output.equals("csv") & s3.indexOf(",")>=0) {s3="\""+s3+"\"";} // comma handling
java to csv handling
input.jsp
var t1='<%=reportDate%>';
t1 = t1.split(" ")[0];
find the first part of the String
tableWrite.java
String callback = request.getParameter("callback");
String _r = callback+"([['success','"+sqlString+"']])" ;
out.print(_r);
out.flush();
call back write at the font of the string.
userRoleScreen.html
<input type="button" id="submitResetPw" name="submitResetPw" style="width:21%;"
onclick="
var s=$('#userRoleUserID option:selected').text(); // return display value
var s01=_lookup('confirmResetPw');
var s02=_lookup('newResetPw');
s= 'tableWrite?db=erp&table=USER&fields=password&values=%22'+s01+'%22
&key=LOGIN_ID&value=%22'+s+'%22&callback=?';
$.getJSON(s,function(){alert('Password success change.');});
$( '#resetPasswordDiv' ).dialog( 'close' );
"
value="Submit" />
use %22 as "
remark :
s='tableRead?table=USER&fields=RECORDID,LOGIN_ID&where=where db:`<%=bean.getDatabase()%>` and status:1 &format=S,S&callback=?&db=erp'
linux-script parameter
parameter
root@cloud-adm:/backup# cat backupDay
#!/bin/bash
# Incremental Backup
#d=`date +%y%m%d%H%M%S`
d=`date +%a`
s=$1
lftp -c "open -u userID,password 1.1.1.999/userID; rm -r /userID/$s/$d"
mysqldump -ususer -pez=DatabaseName $2 > /backup/$2.sql
mysqldump -ususer -pez=DatabaseName erp > /backup/erp.sql
tar -jvcf /backup/$2.tar /backup/$2.sql
ncftpput -m -u userID -p password 1.1.1.999 /userID/$s/$d/db_dump /backup/*.*
ncftpput -R -m -u userID -p password 1.1.1.999 /userID/$s/$d/attachment /erp/$2
#ncftpput -R -m -u userID -p password 1.1.1.999 /userID/$s/$d/attachment /erp/$2
ncftpput -m -u userID -p password 1.1.1.999 /userID/$s/$d/code/layout /erp/*.*
ncftpput -m -u userID -p password 1.1.1.999 /userID/$s/$d/code/css /erp/css/*.*
ncftpput -m -u userID -p password 1.1.1.999 /userID/$s/$d/code/js /erp/js/*.*
ncftpput -m -u userID -p password 1.1.1.999 /userID/$s/$d/code/images /erp/images/*.*
ncftpput -m -u userID -p password 1.1.1.999 /userID/$s/$d/code/fonts /erp/fonts/*.*
ncftpput -R -m -u userID -p password 1.1.1.999 /userID/$s/$d/code/java /erp/WEB-INF
rm $2.sql
root@cloud-adm:/backup# cat backupDay
#!/bin/bash
# Incremental Backup
#d=`date +%y%m%d%H%M%S`
d=`date +%a`
s=$1
lftp -c "open -u userID,password 1.1.1.999/userID; rm -r /userID/$s/$d"
mysqldump -ususer -pez=DatabaseName $2 > /backup/$2.sql
mysqldump -ususer -pez=DatabaseName erp > /backup/erp.sql
tar -jvcf /backup/$2.tar /backup/$2.sql
ncftpput -m -u userID -p password 1.1.1.999 /userID/$s/$d/db_dump /backup/*.*
ncftpput -R -m -u userID -p password 1.1.1.999 /userID/$s/$d/attachment /erp/$2
#ncftpput -R -m -u userID -p password 1.1.1.999 /userID/$s/$d/attachment /erp/$2
ncftpput -m -u userID -p password 1.1.1.999 /userID/$s/$d/code/layout /erp/*.*
ncftpput -m -u userID -p password 1.1.1.999 /userID/$s/$d/code/css /erp/css/*.*
ncftpput -m -u userID -p password 1.1.1.999 /userID/$s/$d/code/js /erp/js/*.*
ncftpput -m -u userID -p password 1.1.1.999 /userID/$s/$d/code/images /erp/images/*.*
ncftpput -m -u userID -p password 1.1.1.999 /userID/$s/$d/code/fonts /erp/fonts/*.*
ncftpput -R -m -u userID -p password 1.1.1.999 /userID/$s/$d/code/java /erp/WEB-INF
rm $2.sql
backupDay CompanyName DatabaseID
2014年11月2日 星期日
generator-endofload
s
*********************************************************************
{endOfLoad} var parent_key=RECORDID; var s4= 'END_USER_ADDRESS1 ,END_USER_ADDRESS2 ,END_USER_ADDRESS3 ,END_USER_ADDRESS4 ,END_USER_CONTACT ,END_USER_TEL ,END_USER_EMAIL ,END_USER_CONFIRM ,END_USER_NO,END_USER_,CUSTOMER_REQUIREMENT,END_USER_DEPT_BRANCH'; var s3=lookupTable(s4,'SALES_ORDER_REPORT.RECORDID',parent_key); var s4a=s4.split(','); var s3a=s3.split(','); if (s3a[8]){ _refreshv2('SALES_ORDER_HEAD.END_USER_ADDRESS1',s3a[0]); _refreshv2('SALES_ORDER_HEAD.END_USER_ADDRESS2',s3a[1]); _refreshv2('SALES_ORDER_HEAD.END_USER_ADDRESS3',s3a[2]); _refreshv2('SALES_ORDER_HEAD.END_USER_ADDRESS4',s3a[3]); _refreshv2('SALES_ORDER_HEAD.END_USER_CONTACT',s3a[4]); _refreshv2('SALES_ORDER_HEAD.END_USER_TEL',s3a[5]); _refreshv2('SALES_ORDER_HEAD.END_USER_EMAIL',s3a[6]); _refreshv2('SALES_ORDER_HEAD.END_USER_CONFIRM',s3a[7]); _refreshv2('SALES_ORDER_HEAD.END_USER_NO',s3a[8]); _refreshv2('SALES_ORDER_HEAD.END_USER',s3a[9]); _refreshv2('SALES_ORDER_HEAD.CUSTOMER_REQUIREMENT',s3a[10]); _refreshv2('SALES_ORDER_HEAD.END_USER_DEPT_BRANCH',s3a[11]) } {/endOfLoad}
layout.txt
{endOfLoad}
s1103=_lookup('PURCHASE_HEADER.SALES_ORDER');
var s='tableRead?table=SALES_ORDER_HEAD&fields=SIGNED_QD&
where=where SALES_ORDER: %60'+s1103 +'%60&format=S&callback=?&db='+DATABASE;
$.getJSON(s,
function(data) {
if (data[0]){
_refreshv2('view.uploadDocument',data[0][0]);
}
}
)
{/endOfLoad}
Config
endofload=if(DISK_DOC_STATUS!:'D'){document.getElementById('SALES_ORDER_INV_DESC_gridButton1').style.display : 'none';}
*********************************************************************
{endOfLoad} var parent_key=RECORDID; var s4= 'END_USER_ADDRESS1 ,END_USER_ADDRESS2 ,END_USER_ADDRESS3 ,END_USER_ADDRESS4 ,END_USER_CONTACT ,END_USER_TEL ,END_USER_EMAIL ,END_USER_CONFIRM ,END_USER_NO,END_USER_,CUSTOMER_REQUIREMENT,END_USER_DEPT_BRANCH'; var s3=lookupTable(s4,'SALES_ORDER_REPORT.RECORDID',parent_key); var s4a=s4.split(','); var s3a=s3.split(','); if (s3a[8]){ _refreshv2('SALES_ORDER_HEAD.END_USER_ADDRESS1',s3a[0]); _refreshv2('SALES_ORDER_HEAD.END_USER_ADDRESS2',s3a[1]); _refreshv2('SALES_ORDER_HEAD.END_USER_ADDRESS3',s3a[2]); _refreshv2('SALES_ORDER_HEAD.END_USER_ADDRESS4',s3a[3]); _refreshv2('SALES_ORDER_HEAD.END_USER_CONTACT',s3a[4]); _refreshv2('SALES_ORDER_HEAD.END_USER_TEL',s3a[5]); _refreshv2('SALES_ORDER_HEAD.END_USER_EMAIL',s3a[6]); _refreshv2('SALES_ORDER_HEAD.END_USER_CONFIRM',s3a[7]); _refreshv2('SALES_ORDER_HEAD.END_USER_NO',s3a[8]); _refreshv2('SALES_ORDER_HEAD.END_USER',s3a[9]); _refreshv2('SALES_ORDER_HEAD.CUSTOMER_REQUIREMENT',s3a[10]); _refreshv2('SALES_ORDER_HEAD.END_USER_DEPT_BRANCH',s3a[11]) } {/endOfLoad}
layout.txt
{endOfLoad}
s1103=_lookup('PURCHASE_HEADER.SALES_ORDER');
var s='tableRead?table=SALES_ORDER_HEAD&fields=SIGNED_QD&
where=where SALES_ORDER: %60'+s1103 +'%60&format=S&callback=?&db='+DATABASE;
$.getJSON(s,
function(data) {
if (data[0]){
_refreshv2('view.uploadDocument',data[0][0]);
}
}
)
{/endOfLoad}
Config
endofload=if(DISK_DOC_STATUS!:'D'){document.getElementById('SALES_ORDER_INV_DESC_gridButton1').style.display : 'none';}
2014年11月1日 星期六
java-csv
http://stackoverflow.com/questions/21378773/create-and-download-csv-file-javaservlet
create and download
public void doGet(HttpServletRequest request, HttpServletResponse response)
{
response.setContentType("text/csv");
response.setHeader("Content-Disposition", "attachment; filename=\"userDirectory.csv\"");
try
{
OutputStream outputStream = response.getOutputStream();
String outputResult = "xxxx, yyyy, zzzz, aaaa, bbbb, ccccc, dddd, eeee, ffff, gggg\n";
outputStream.write(outputResult.getBytes());
outputStream.flush();
outputStream.close();
}
catch(Exception e)
{
model.closeConnection();
System.out.println(e.toString());
}
}
訂閱:
文章 (Atom)