📄 excel.jsp
字号:
String country ="";
String hscode ="";
String cfoil ="";
String oalloy ="";
String account ="";
String STATUS ="";
String prepaid ="";
String collect ="";
String otherfees ="";
String reason1 ="";
String reason2 ="";
double totherfees=0;
String sundry ="";
double tsundry=0;
String freight ="";
String subtot ="";
String invamt ="";
boolean print_invamt=false;
String fsurcharge ="";
String fsurrate ="";
String gross ="";
String shname ="";
String cwh ="";
String shadd1 ="";
String shadd2 ="";
String shadd3 ="";
String shadd4 ="";
String plant ="";
double amount=0;
double frins=0;
double insurance=0;
double duty=0;
double frsubtot=0;
String verifyby ="";
ASResultSet rsI=Sqlca.getASResultSet("select * from global ");
rsI.next();
cnconame=rsI.getString("cnconame");
cCity=rsI.getString("cncity");
cProvst=rsI.getString("cnprovst");
cTraffic=rsI.getString("traffic");
gstrate=rsI.getDouble("gstrate") ;
ASResultSet rsIs=Sqlca.getASResultSet("select * from shipment where blno= "+ BLNO);
if(rsIs.next() )
{
wght =rsIs.getString("islbs")=="0"?"LBS":"KGS";
alloy=rsIs.getString("alloy");
ordertype=rsIs.getString("ordertype");
wblno=rsIs.getString("wblno");
islbs=rsIs.getString("islbs");
if(ordertype=="REG")
{
to_whouse=false;
from_whouse=false;
} else
if(ordertype!="REG" && wblno==null)
{
to_whouse=true;
from_whouse=false;
} else
{
to_whouse=false;
from_whouse=true;
ttblno=wblno ;
}
prevcustpo = rsIs.getString("custpo");
prevnet = rsIs.getDouble("net") ;
coils = rsIs.getString("coils");
invunit = rsIs.getString("invunit");
canlbspr = rsIs.getString("canlbspr");
invextend= rsIs.getDouble("invextend");
DESC = rsIs.getString("DESC");
custprod = rsIs.getString("custprod");
hscode= rsIs.getString("hscode");
}
ASResultSet rs=Sqlca.getASResultSet("select * from invoice where blno=" + BLNO);
if(rs.next() )
{
invgst=rs.getString("invgst");
prepaid =rs.getString("prepaid");
collect =rs.getString("collect");
otherfees=rs.getString("otherfees");
reason1=rs.getString("reason1");
reason2=rs.getString("reason2");
sundry=rs.getString("sundry");
freight=rs.getString("freight");
subtot =rs.getString("subtot");
invamt =rs.getString("invamt");
fsurcharge =rs.getString("fsurcharge");
gross =rs.getString("gross");
fsurrate =rs.getString("fsurrate");
shadd1= rs.getString("shadd1");
shadd2= rs.getString("shadd2");
shadd3= rs.getString("shadd3");
shadd4= rs.getString("shadd4");
plant= rs.getString("plant");
duty= rs.getDouble("duty");
frins= rs.getDouble("frins") ;
insurance= rs.getDouble("insurance");
verifyby= rs.getString("verifyby");
}
ASResultSet rsc=Sqlca.getASResultSet("select * from customer where account='" + rsIs.getString("account") + "' and subacct='" +rsIs.getString("subacct") + "'");
if(rsc.next() )
{
posort=rsc.getString("posort");
custpo =rsIs.getString("custpo");
isimperial =rsc.getString("isimperial");
country =rsc.getString("country");
shname=rsc.getString("shname");
}
ASResultSet rso=Sqlca.getASResultSet("select * from ord_item where worksno =" +rsIs.getString("worksno") ) ;
if(rso.next() )
{
contract=rso.getString("contract");
mt_width=rso.getString("mt_width");
mt_gauge=rso.getString("mt_gauge");
alloy=rso.getString("alloy");
account=rso.getString("alloy");
STATUS= rso.getString("STATUS");
}
for(int i=0;i< Integer.parseInt(Invoice==""?"0":Invoice);i++)
{
if(posort=="0")
{
if(prevcustpo == custpo)
{
if( custpo.trim().length() <=16)
{
HSSFRow r1=sheet.createRow(i + 0);
HSSFCell r1c1=r1.createCell((short)0);
r1c1.setCellValue( custpo.trim());
HSSFRow r2=sheet.createRow(i + 1);
HSSFCell r1c2=r2.createCell((short)0);
r1c2.setCellValue( coils);
}else
{
HSSFRow r3=sheet.createRow(i + 2);
HSSFCell r1c3=r3.createCell((short)0);
r1c3.setCellValue( custpo);
HSSFRow r4=sheet.createRow(i + 3);
HSSFCell r1c4=r4.createCell((short)0);
r1c4.setCellValue( coils);
}
}else
{
if(nPOnet!= prevnet)
{
HSSFRow r5=sheet.createRow(i +4);
HSSFCell r1c5=r5.createCell((short)0);
r1c5.setCellValue( "CUSTOMER ORDER TOTAL" + nPOnet +" " + nPOinv);
if(invgst!=null)
{
HSSFRow r6=sheet.createRow(i + 5);
HSSFCell r1c6=r6.createCell((short)0);
r1c6.setCellValue( "GST/HST ");
nGST=nPOinv *gstrate /100;
HSSFRow r7=sheet.createRow(i + 6);
HSSFCell r1c7=r7.createCell((short)0);
r1c7.setCellValue( "nGST ");
HSSFRow r8=sheet.createRow(i + 7);
HSSFCell r1c8=r8.createCell((short)0);
r1c8.setCellValue(nGST +" "+ nPOinv);
}
if( custpo.trim().length() <=16)
{
HSSFRow r9=sheet.createRow(i +8);
HSSFCell r1c9=r9.createCell((short)0);
r1c9.setCellValue(custpo.trim());
HSSFRow r10=sheet.createRow(i +9);
HSSFCell r1c10=r10.createCell((short)0);
r1c10.setCellValue( coils);
}else
{
HSSFRow r11=sheet.createRow(i +10);
HSSFCell r1c11=r11.createCell((short)0);
r1c11.setCellValue( custpo);
HSSFRow r12=sheet.createRow(i +11);
HSSFCell r1c12=r12.createCell((short)0);
r1c12.setCellValue( coils);
}
}
}
}else
{
if( custpo.trim().length() <=16)
{ HSSFRow r13=sheet.createRow(i +12);
HSSFCell r1c13=r13.createCell((short)0);
r1c13.setCellValue( custpo.trim() );
HSSFRow r14=sheet.createRow(i +13);
HSSFCell r1c14=r14.createCell((short)0);
r1c14.setCellValue( coils);
}else
{
HSSFRow r15=sheet.createRow(i +14);
HSSFCell r1c15=r15.createCell((short)0);
r1c15.setCellValue( custpo);
}
}
if(StringUtils.copper(alloy))
{
HSSFRow r16=sheet.createRow(i +15);
HSSFCell r1c16=r16.createCell((short)0);
r1c16.setCellValue( " COPPER");
}
if(StringUtils.nickel(alloy))
{
HSSFRow r17=sheet.createRow(i +16);
HSSFCell r1c17=r17.createCell((short)0);
r1c17.setCellValue( " NICKEL SILVER");
}
if(StringUtils.brass(alloy))
{
HSSFRow r18=sheet.createRow(i +17);
HSSFCell r1c18=r18.createCell((short)0);
r1c18.setCellValue( " BRASS");
}
if(StringUtils.phos(alloy))
{
HSSFRow r19=sheet.createRow(i +18);
HSSFCell r1c19=r19.createCell((short)0);
r1c19.setCellValue( " PHOS BRONZE ");
}
if(contract=="FERGUS-T")
{
HSSFRow r20=sheet.createRow(i +19);
HSSFCell r1c20=r20.createCell((short)0);
r1c20.setCellValue( "TOLL");
}
HSSFRow r21=sheet.createRow(i +20);
HSSFCell r1c21=r21.createCell((short)0);
r1c21.setCellValue( prevnet);
if(islbs=="0")
{
HSSFRow r22=sheet.createRow(i +21);
HSSFCell r1c22=r22.createCell((short)0);
r1c22.setCellValue( invunit+" "+ invextend);
}else
{
HSSFRow r23=sheet.createRow(i +22);
HSSFCell r1c23=r23.createCell((short)0);
r1c23.setCellValue( canlbspr+" "+ invextend);
}
nPOinv =nPOinv + invextend;
if(isimperial=="0")
{
HSSFRow r24=sheet.createRow(i +23);
HSSFCell r1c24=r24.createCell((short)0);
r1c24.setCellValue( DESC);
}
else
{
HSSFRow r25=sheet.createRow(i +24);
HSSFCell r1c25=r25.createCell((short)0);
r1c25.setCellValue( DESC.substring(0,9) + " " + mt_width.substring(7,10) + "mm " + mt_gauge.substring(7,10)+"mm ");
}
if(custprod!="0")
{ HSSFRow r26=sheet.createRow(i +25);
HSSFCell r1c26=r26.createCell((short)0);
r1c26.setCellValue( "Part No: " +custprod);
}
if("UO".indexOf(country )> 0 )
{
if( !from_whouse)
{
if(StringUtils.copper(oalloy))
{
if(hscode=="7410.11.0000")
cfoil="COPPER FOIL";
if(hscode=="7409.11.5010")
cfoil="COPPER STRIP";
if(hscode=="7409.11.5050")
cfoil="COPPER STRIP";
if(hscode=="7409.11.1000")
cfoil="COPPER STRIP";
else
cfoil="COPPER STRIP";
}
if(StringUtils.brass(oalloy))
{
if(hscode=="7410.12.0030")
cfoil="BRASS FOIL";
if(hscode=="7409.21.0050")
cfoil="BRASS STRIP";
if(hscode=="7409.21.0075")
cfoil="BRASS STRIP";
if(hscode=="7409.21.0010")
cfoil="BRASS STRIP";
else
cfoil="BRASS STRIP";
}
else
{
cfoil="STRIP";
}
HSSFRow r27=sheet.createRow(i +26);
HSSFCell r1c27=r27.createCell((short)0);
r1c27.setCellValue( "H.S. CODE: "+ hscode+ " (" + cfoil);
}
}
if(account=="VALCAN")
{
if(STATUS =="CM")
{
HSSFRow r28=sheet.createRow(i +27);
HSSFCell r1c28=r28.createCell((short)0);
r1c28.setCellValue( "COMPLETE" );
}
else
{ HSSFRow r29=sheet.createRow(i +28);
HSSFCell r1c29=r29.createCell((short)0);
r1c29.setCellValue( "PARTIAL" );
}
}
if( from_whouse){}
if(posort=="0")
{
if(prevcustpo == custpo)
{
if( custpo.trim().length() <=16)
{ HSSFRow r30=sheet.createRow(i +29);
HSSFCell r1c30=r30.createCell((short)0);
r1c30.setCellValue( custpo.trim() );
HSSFRow r31=sheet.createRow(i +30);
HSSFCell r1c31=r31.createCell((short)0);
r1c31.setCellValue( coils );
}else
{ HSSFRow r32=sheet.createRow(i +31);
HSSFCell r1c32=r32.createCell((short)0);
r1c32.setCellValue( custpo );
HSSFRow r33=sheet.createRow(i +32);
HSSFCell r1c33=r33.createCell((short)0);
r1c33.setCellValue( coils );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -