<!--javascript 文件-->
var guihuan_element_num=0;
var display_num=0;
var undefined_num=0;
$("document").ready(function(){
insertSpan();
var header_line=get_header_Multiline();
display_num=41-header_line;
var page_num= getPageNum();
insert_headers(page_num);
insert_guihuans(page_num);
remark_in_previous_page();
});
function getGuiHuanText()
{
var guanhuan_text= $("#guihuan_text1").html();
return guanhuan_text;
}
function insertSpan()
{
var guihuan_text=getGuiHuanText();
var guihuan_text_new="";
var guihuan_array=new Array();
guihuan_array=guihuan_text.split("<BR>");
guihuan_element_num=guihuan_array.length;
return guihuan_array;
}
function clearGuihuan_text1()
{
$("#guihuan_text1").empty();
}
function getPageNum()
{
var page_num=Math.ceil(guihuan_element_num/display_num);//每個只顯示display_num
return page_num;
}
/**
插入頭文件
**/
function insert_headers(page_num)
{
for(var i=2;i<=page_num;i++)
{
$("#insert_header"+i).append($("#header").html());
}
$("#insert_header11").append($("#header").html());
//把剩余的頭隱藏
for(var i=eval(page_num+1);i<11;i++)
{
$("#table_header"+i).remove();
}
}
/**
插入規范文字
**/
function insert_guihuans(page_num)
{
var guihuan_text=insertSpan();
//把未經處理的規范處理掉
clearGuihuan_text1();
for(var i=1;i<=page_num;i++)
{
undefined_num=0;
var page_guihuan_text=new Array();
for(var j=0;j<display_num;j++)
{
page_guihuan_text.push(guihuan_text[j]);
}
guihuan_text=guihuan_text.slice(display_num,guihuan_text.length);
var page_str="";
for(var m=0;m<page_guihuan_text.length;m++)
{
if(page_guihuan_text[m]==undefined)
{
undefined_num+=1;
page_guihuan_text[m]="";
}
if(page_guihuan_text[m]!=undefined)
{
page_str+=page_guihuan_text[m];
page_str+="<BR>";
}
}
// alert(page_str);
//當前頁不是最后一頁
if(i!=page_num)
{
$("#guihuan_text"+i).append(page_str);
}
else
{
//是最后一頁時,remark連上來的情況
if(undefined_num>15)
{
var page_array=page_str.split("<BR>");
page_str="";
//把最后的15行(空行)拿給remark用,故減15
for(var n=0;n<(page_array.length-15);n++)
{
page_str+=page_array[n];
page_str+="<BR>";
}
}
$("#guihuan_text"+i).append(page_str);
}
}
//隱藏規范區域
hide_guihuan_area(page_num);
}
function hide_guihuan_area(page_num)
{
for(var i=eval(page_num+1);i<11;i++)
{
$("#table_guihuan"+i).remove();
}
}
function get_header_Multiline()
{
var va=$("#multiline").attr("value");
return va;
}
function remark_in_previous_page()
{
if(undefined_num>15)
{
$("#insert_header11").remove();
}
}
<!--jsp文件(不變部分)-->
<%@ page import="com.dalux.bean.job.*" %>
<%@ page import="com.dalux.util.*" %>
<%@ page import="com.cps.util.*" %>
<%@ page import="com.cps.mjob.*" %>
<%@ page import="com.cps.df2.*" %>
<%@ page import="java.util.*" %>
<%@ include file="/MyUtility/login_data.jsp" %>
<%
Priviledge priviledge = (Priviledge) session.getAttribute("priviledge");
if (priviledge == null)
{
session.setAttribute("time-out", "true");
request.getRequestDispatcher("/MyUtility/valid_pwd.jsp?dispatch_to=/MyJob/index.jsp").forward(request, response);
}
%>
<jsp:useBean id="plugin_df2" scope="session" class="com.cps.df2.Df2" />
<jsp:useBean id="df2_data" scope="page" class="com.plugin.df2.Df2Data" /> <!-- 底層資料庫資料操作 -->
<jsp:useBean id="df2f080" scope="page" class="com.plugin.df2.Df2F080" />
<jsp:useBean id="session_address_book" scope="session" class="com.dalux.bean.bdm.AddressBook" />
<jsp:useBean id="session_employee" scope="session" class="com.dalux.bean.bdm.AddressBook" />
<jsp:useBean id="session_job" scope="session" class="com.dalux.bean.job.Job" />
<jsp:useBean id="session_job_field" scope="session" class="com.dalux.bean.job.JobField" />
<jsp:useBean id="session_job_et_field" scope="session" class="com.dalux.bean.job.JobEtField" />
<jsp:useBean id="session_modular_plugin" scope="session" class="com.cps.modular.plugin.ModularPlugIn" />
<jsp:useBean id="session_customer" scope="session" class="com.cps.mf.customer.Customer" />
<jsp:useBean id="session_mjob_param" scope="session" class="com.cps.mjob.MJobParam" />
<jsp:useBean id="session_supplier" scope="session" class="com.cps.mf.supplier.Supplier" />
<jsp:useBean id="session_modular_basic" scope="session" class="com.cps.modular.ModularBasic" />
<jsp:useBean id="session_modular_img_attach" scope="session" class="com.cps.modular.ModularImgAttach" />
<jsp:useBean id="session_modular_img_attach_tmp" scope="session" class="com.cps.modular.ModularImgAttach" />
<jsp:useBean id="session_modular_customer_print" scope="session" class="com.cps.modular.ModularCustomerPrint" />
<jsp:useBean id="session_job_cpml_category" scope="session" class="com.dalux.bean.mana_platform.JobCpmlCategory" />
<jsp:useBean id="session_job_cpml" scope="session" class="com.dalux.bean.mana_platform.JobCpml" />
<jsp:useBean id="session_job_type" scope="session" class = "com.dalux.bean.bdm.JobType" />
<jsp:useBean id="session_code_generator" scope="session" class="com.dalux.bean.mana_platform.code_generator.CodeGenerator" />
<jsp:useBean id="multi_language_file" scope="application" class="com.dalux.util.MultiLanguage" />
<% multi_language_file.language = language;
multi_language_file.region = MultiLanguage.FORM; %>
<%@ include file="/BDM/ScreenText/utility_screen_str.jsp" %>
<% System.out.println("--------- PlugIn/modular/job_print/" + session_modular_plugin.jsp + "--------------"); %>
<% String uploadDir = getServletContext().getInitParameter("attachedRoot"); %>
<%
String job_no = Dalux.nullEmpty(request.getParameter("job_no"));
String first_enter = Dalux.nullEmpty(request.getParameter("first_enter"));
String tbl_customer = "T019F080"; //客戶基本資料檔
System.out.println(" job_no : [" + job_no + "]");
System.out.println(" first_enter : [" + first_enter + "]");
%>
<%
if ("1".equals(first_enter))
{
session_job_field.getDataFromJobNo(job_no);
session_job_et_field.getDataFromJobNo(job_no);
}
%>
<title>Deliver Goods</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<style type="text/css">
<!--
.style4 {font-size: 16px}
.style5 {font-size: 16px}
.style9 {font-size: 16px}
.style11 {font-size: 20px}
.style10 {
font-size: medium;
font-weight: bold;
}
-->
</style>
<script>
function convertCurrency(currencyDigits) {
// Constants:
var MAXIMUM_NUMBER = 99999999999.99;
// Predefine the radix characters and currency symbols for output:
var CN_ZERO = "零";
var CN_ONE = "壹";
var CN_TWO = "貳";
var CN_THREE = "3";
var CN_FOUR = "肆";
var CN_FIVE = "伍";
var CN_SIX = "陸";
var CN_SEVEN = "柒";
var CN_EIGHT = "捌";
var CN_NINE = "玖";
var CN_TEN = "拾";
var CN_HUNDRED = "佰";
var CN_THOUSAND = "仟";
var CN_TEN_THOUSAND = "万";
var CN_HUNDRED_MILLION = "億";
var CN_SYMBOL = "¥";
var CN_DOLLAR = "元";
var CN_TEN_CENT = "角";
var CN_CENT = "分";
var CN_INTEGER = "整";
var CN_INTEGER0 = "零角零分";
var CN_INTEGER1 = "零分";
var CN_ZEROTEN="零拾";
// Variables:
var integral; // Represent integral part of digit number.
var decimal; // Represent decimal part of digit number.
var outputCharacters; // The output result.
var parts;
var digits, radices, bigRadices, decimals;
var zeroCount;
var i, p, d;
var quotient, modulus;
// Validate input string:
currencyDigits = currencyDigits.toString();
if (currencyDigits == "") {
alert("Empty input!");
return "";
}
if (currencyDigits.match(/[^,./d]/) != null) {
alert("Invalid characters in the input string!");
return "";
}
if ((currencyDigits).match(/^((/d{1,3}(,/d{3})*(.((/d{3},)*/d{1,3}))?)|(/d+(./d+)?))$/) == null) {
alert("Illegal format of digit number!");
return "";
}
// Normalize the format of input digits:
currencyDigits = currencyDigits.replace(/,/g, ""); // Remove comma delimiters.
currencyDigits = currencyDigits.replace(/^0+/, ""); // Trim zeros at the beginning.
// Assert the number is not greater than the maximum number.
if (Number(currencyDigits) > MAXIMUM_NUMBER) {
alert("Too large a number to convert!");
return "";
}
// Process the coversion from currency digits to characters:
// Separate integral and decimal parts before processing coversion:
parts = currencyDigits.split(".");
if (parts.length > 1) {
integral = parts[0];
decimal = parts[1];
// Cut down redundant decimal digits that are after the second.
decimal = decimal.substr(0, 2);
}
else {
integral = parts[0];
decimal = "";
}
// Prepare the characters corresponding to the digits:
digits = new Array(CN_ZERO, CN_ONE, CN_TWO, CN_THREE, CN_FOUR, CN_FIVE, CN_SIX, CN_SEVEN, CN_EIGHT, CN_NINE);
radices = new Array("", CN_TEN, CN_HUNDRED, CN_THOUSAND);
bigRadices = new Array("", CN_TEN_THOUSAND, CN_HUNDRED_MILLION);
decimals = new Array(CN_TEN_CENT, CN_CENT);
// Start processing:
outputCharacters = "";
// Process integral part if it is larger than 0:
if (Number(integral) > 0) {
zeroCount = 0;
for (i = 0; i < integral.length; i++) {
p = integral.length - i - 1;
d = integral.substr(i, 1);
quotient = p / 4;
modulus = p % 4;
if (d == "0") {
zeroCount++;
}
else {
if (zeroCount > 0)
{
outputCharacters += digits[0];
}
zeroCount = 0;
outputCharacters += digits[Number(d)] + radices[modulus];
}
if (modulus == 0 && zeroCount < 4) {
outputCharacters += bigRadices[quotient];
}
}
outputCharacters += CN_DOLLAR;
if(integral.substring(integral.length-2)=="00"){
outputCharacters+=CN_ZEROTEN;
}
}
// Process decimal part if there is:
if (decimal != ""&&decimal!="00") {
for (i = 0; i < decimal.length; i++) {
d = decimal.substr(i, 1);
if (d != "000") {
outputCharacters += digits[Number(d)] + decimals[i];
}
}
if(decimal.length<2){
outputCharacters +=CN_INTEGER1;
}
}
// Confirm and return the final output string:
if (outputCharacters == "") {
outputCharacters = CN_ZERO + CN_DOLLAR;
}
outputCharacters = outputCharacters;
return outputCharacters+CN_INTEGER;
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<%@ include file="/MyUtility/utility.js" %>
<br>
<div id="header">
<%
session_modular_basic.getDataFromJobCpmlId(session_job.job_cpml_id);
session_modular_img_attach_tmp.getDataFromId(session_modular_basic.img_attach_id);
//抓取客戶基本資料
df2f080.clearData();
df2f080.tbl_name= tbl_customer;
df2f080.where_sql = " where field31 = '" + session_job_field.field1.trim() + "'";
df2f080.getOneRecordData();
//out.print("TTT"+session_job_field.field34+"TT");
session_modular_img_attach_tmp.clearData();
if(session_job_field.field34.trim().equals("11")){
session_modular_img_attach_tmp.getDataFromId("16");
}
else if(session_job_field.field34.trim().equals("12")){
session_modular_img_attach_tmp.getDataFromId("14");
}
else if(session_job_field.field34.trim().equals("13")){
session_modular_img_attach_tmp.getDataFromId("13");
}
else{
session_modular_img_attach_tmp.getDataFromId("15");
}
if (session_modular_img_attach_tmp.getSize() > 0)
{
%>
<table width="96%" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td width="71%" align="center"><SPAN>
<%=session_modular_img_attach_tmp.getImgHtml(uploadDir + "ManaPlatform/")%> </SPAN></td>
</tr>
</table>
<% } %>
<script language="javascript">
window.document.title="test my title operate";
</script>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" sytle="border-bottom:hidden" RULES=GROUPS>
<TBODY>
<tr>
<td width= "60%" align="left"><span class="style5">客戶名稱:<%=df2f080.field34%></span></td>
<td align="right"><span class="style5">報價單號:</span></td>
<td align="left"><span class="style5"><%=session_job_field.field5%></span></td>
</tr>
<tr>
<td align="left"><span class="style5">聯 絡 人:<%=df2f080.field40%></span></td>
<td align="right"><span class="style5">報價日期:</span></td>
<td align="left"><span class="style5"><%=session_job_field.field6%></span></td>
</tr>
<tr>
<td align="left"><span class="style5">電   話 :<%=df2f080.field39%></span></td>
<td align="right"><span class="style5">傳 真 :<%=df2f080.field46%></span></td>
</tr>
</TBODY>
</table>
<table width="95%" align="center" cellspacing="0" cellpadding="0" border-top-width="thick" border="1" >
<TBODY>
<tr bgcolor="#ECE8D8">
<td width="3%" align="center"><SPAN class="style4">Item</SPAN></td>
<td width="47%" align="center"><span class="style4">Description</span></td>
<td width="10%" align="center"><span class="style4">Quantity</span></td>
<td width="10%" align="center"><span class="style4">Unit</span></td>
<td width="10%" align="center"><span class="style4">Currency</span></td>
<td width="10%" align="center"><span class="style4">Price</span></td>
<td width="10%" align="center"><span class="style4">Amount</span></td>
</tr>
<tr bgcolor="#ECE8D8">
<td width="3%" align="center"><SPAN class="style4">No.</SPAN></td>
<td width="47%" align="center"><span class="style4">品名規格</span></td>
<td width="10%" align="center"><span class="style4">數量</span></td>
<td width="10%" align="center"><span class="style4">單位</span></td>
<td width="10%" align="center"><span class="style4">幣別</span></td>
<td width="10%" align="center"><span class="style4">單價</span></td>
<td width="10%" align="center"><span class="style4">總價</span></td>
</tr>
</TBODY>
<TBODY>
<%
int i =0;
for ( i = 0; i < session_job_et_field.getSize(); i++) { %>
<tr valign="top">
<td align="center"><span class="style4"><%=i+1%></span></td>
<td align="left"><span class="style4"><%=session_job_et_field.getFieldValue(i, "field3")%> </span></td>
<td align="center"><span class="style4"><%=session_job_et_field.getFieldValue(i, "field5")%> </span></td>
<td align="center"><span class="style4"><%=session_job_et_field.getFieldValue(i, "field6")%> </span></td>
<%
df2_data.tbl_name = "T048F010"; // 幣別類別檔
df2_data.where_sql = " WHERE field6 = '" + session_job_et_field.getFieldValue(i, "field8") + "'";
%>
<td align="center"><span class="style4"><%=df2_data.getOneFieldData("field7")%> </SPAN></td>
<td align="center"><span class="style4"><%=session_job_et_field.getFieldValue(i, "field7")%> </span></td>
<td align="center"><span class="style4"><%=session_job_et_field.getFieldValue(i, "field10")%> </span></td>
</tr>
<% }
%>
</TBODY>
</table>
<input type="hidden" id="multiline" value="<%=i%>"/>
</div>
<!--jsp 文件-->
<html>
<head>
</head>
<script type="text/javascript" src="../../util/jquery-1[1].2.6.js"></script>
<script type="text/javascript" src="CL_job_print_device_quote.js"></script>
<body>
<%@ include file="CL_job_print_device_quote_header.jsp" %>
<table width="95%" id="table_guihuan1" border="1" align="center" cellpadding="2" cellspacing="1">
<TBODY >
<tr valign="top">
<td colspan="7" height=100 align="left"><SPAN class="style4" id="guihuan_text1" > 規範: <br><%=CorePress.replace(session_job_field.field80, "/n", "<br>")%></SPAN></td>
</tr>
</TBODY>
</table>
<table width="100%" id="table_header2" style="page-break-before:always;" align="center" cellpadding="2" cellspacing="1" >
<tr valign="top">
<td colspan="7" id="insert_header2" height=100 align="left"><SPAN class="style4" ></SPAN></td>
</tr>
</table>
<table width="95%" id="table_guihuan2" border="1" align="center" cellpadding="2" cellspacing="1">
<TBODY >
<tr valign="top">
<td colspan="7" height=100 align="left"><SPAN class="style4" id="guihuan_text2" ><br></SPAN></td>
</tr>
</tbody>
</table>
<table width="100%" id="table_header3" style="page-break-before:always;" align="center" cellpadding="2" cellspacing="1" >
<tr valign="top">
<td colspan="7" id="insert_header3" height=100 align="left"><SPAN class="style4" ></SPAN></td>
</tr>
</table>
<table width="95%" id="table_guihuan3" border="1" align="center" cellpadding="2" cellspacing="1">
<TBODY >
<tr valign="top">
<td colspan="7" height=100 align="left"><SPAN class="style4" id="guihuan_text3" ><br></SPAN></td>
</tr>
</tbody>
</table>
<table width="100%" id="table_header4" style="page-break-before:always;" align="center" cellpadding="2" cellspacing="1" >
<tr valign="top">
<td colspan="7" id="insert_header4" height=100 align="left"><SPAN class="style4" ></SPAN></td>
</tr>
</table>
<table width="95%" border="1" id="table_guihuan4" align="center" cellpadding="2" cellspacing="1">
<TBODY>
<tr valign="top">
<td colspan="7" height=100 align="left"><SPAN class="style4" id="guihuan_text4" ><br></SPAN></td>
</tr>
</tbody>
</table>
<table width="100%" id="table_header5" style="page-break-before:always;" align="center" cellpadding="2" cellspacing="1" >
<tr valign="top">
<td colspan="7" id="insert_header5" height=100 align="left"><SPAN class="style4" ></SPAN></td>
</tr>
</table>
<table width="95%" id="table_guihuan5" border="1" align="center" cellpadding="2" cellspacing="1">
<TBODY >
<tr valign="top">
<td colspan="7" height=100 align="left"><SPAN class="style4" id="guihuan_text5" ><br></SPAN></td>
</tr>
</tbody>
</table>
<table width="100%" id="table_header6" style="page-break-before:always;" align="center" cellpadding="2" cellspacing="1" >
<tr valign="top">
<td colspan="7" id="insert_header6" height=100 align="left"><SPAN class="style4" ></SPAN></td>
</tr>
</table>
<table width="95%" id="table_guihuan6" border="1" align="center" cellpadding="2" cellspacing="1">
<TBODY >
<tr valign="top">
<td colspan="7" height=100 align="left"><SPAN class="style4" id="guihuan_text6" ><br></SPAN></td>
</tr>
</tbody>
</table>
<table width="100%" id="table_header7" style="page-break-before:always;" align="center" cellpadding="2" cellspacing="1" >
<tr valign="top">
<td colspan="7" id="insert_header7" height=100 align="left"><SPAN class="style4" ></SPAN></td>
</tr>
</table>
<table width="95%" id="table_guihuan7" border="1" align="center" cellpadding="2" cellspacing="1">
<TBODY >
<tr valign="top">
<td colspan="7" height=100 align="left"><SPAN class="style4" id="guihuan_text7" ><br></SPAN></td>
</tr>
</tbody>
</table>
<table width="100%" id="table_header8" style="page-break-before:always;" align="center" cellpadding="2" cellspacing="1" >
<tr valign="top">
<td colspan="7" id="insert_header8" height=100 align="left"><SPAN class="style4" ></SPAN></td>
</tr>
</table>
<table width="95%" id="table_guihuan8" border="1" align="center" cellpadding="2" cellspacing="1">
<TBODY >
<tr valign="top">
<td colspan="7" height=100 align="left"><SPAN class="style4" id="guihuan_text8" ><br></SPAN></td>
</tr>
</tbody>
</table>
<table width="100%" id="table_header9" style="page-break-before:always;" align="center" cellpadding="2" cellspacing="1" >
<tr valign="top">
<td colspan="7" id="insert_header9" height=100 align="left"><SPAN class="style4" ></SPAN></td>
</tr>
</table>
<table width="95%" border="1" id="table_guihuan9" align="center" style="page-break-before:always;" cellpadding="2" cellspacing="1">
<TBODY >
<tr valign="top">
<td colspan="7" height=100 align="left"><SPAN class="style4" id="guihuan_text9" ><br></SPAN></td>
</tr>
</tbody>
</table>
<table width="100%" id="table_header10" style="page-break-before:always;" align="center" cellpadding="2" cellspacing="1" >
<tr valign="top">
<td colspan="7" id="insert_header10" height=100 align="left"><SPAN class="style4" ></SPAN></td>
</tr>
</table>
<table width="95%" border="1" id="table_guihuan10" align="center" cellpadding="2" cellspacing="1">
<TBODY >
<tr valign="top">
<td colspan="7" height=100 align="left"><SPAN class="style4" id="guihuan_text10" ><br></SPAN></td>
</tr>
</TBODY>
</table>
<table width="100%" id="table_header11" align="center" cellpadding="2" cellspacing="1" >
<tr valign="top">
<td colspan="7" id="insert_header11" height=100 align="left"><SPAN class="style4" ></SPAN></td>
</tr>
</table>
<table width="95%" border="1" align="center" cellpadding="2" cellspacing="1">
<tbody>
<tr id="tongji_area">
<% df2_data.clearData();
df2_data.tbl_name = "T048F010"; // 幣別類別檔
df2_data.where_sql = " WHERE field6 = '" + session_job_field.field36 + "'";
%>
<td colspan="3" id="tongji"><span align="left" class="style4"><b>統計:<%=df2_data.getOneFieldData("field7")%> <span id="money"><%=session_job_et_field.getFieldValue(--i, "field11")%></span></b></span></td>
<td colspan="4" ><span align="right" class="style4"><b>TOTAL: <%=session_job_field.field36%> </span><span id="number"></span></b></td>
</tr>
</tbody>
</table>
<table width="95%" border="0" align="center" cellpadding="2" cellspacing="1" >
<TBODY>
<tr valign="top">
<td colspan="7" align="left"><span class="style4" id="remark_text"><%=CorePress.replace(session_job_field.field35, "/n", "<br>")%></span></td>
</tr>
<tr valign="top">
<td width="22%" align="left" id="corpation_left"><span class="style11"><b><%=df2f080.field34%></b></span></td>
<td width="22%" align="center" id="corpation_right"><span class="style11"><b><%=session_job_field.field40%></b></span></td>
</tr>
<tr valign="top">
<td width="22%" align="left"><span class="style11">______________________</span></td>
<td width="22%" align="center"><span class="style11">______________________</span></td>
</tr>
<tr valign="top">
<td colspan="2" id="lastspan" align="left"><span class="style4" > 訂購時如未另訂合約,本報價經買賣雙方簽章確認后即視同訂購合約,買賣雙方必須共同履行. </span></td>
</tr>
</TBODY>
</body>
</html>
<script>
function window.onload()
{
var str=document.getElementById("money").innerHTML;
var str1=convertCurrency(str);
document.getElementById("money").innerHTML=str1;
document.getElementById("number").innerHTML=str;
}
</script>