FnaInvoiceDetailInfoAjax.jsp
2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<%@page import="java.text.DecimalFormat"%>
<%@page import="weaver.general.BaseBean"%>
<%@ page import="weaver.general.Util" %>
<%@ page language="java" contentType="text/html; charset=utf-8" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="rs2" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="WFNodeMainManager" class="weaver.workflow.workflow.WFNodeMainManager" scope="page" />
<jsp:useBean id="BudgetfeeTypeComInfo" class="weaver.fna.maintenance.BudgetfeeTypeComInfo" scope="page"/>
<%@ page import="weaver.hrm.*" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="java.util.*" %>
<%@ page import="org.json.JSONArray" %>
<%@ page import="org.json.JSONObject" %>
<%
User user = HrmUserVarify.getUser (request , response) ;
String id = Util.null2String(request.getParameter("id"));
JSONArray jsonArray=new JSONArray();
JSONArray ajaxData=new JSONArray();
JSONObject jsonObject=new JSONObject();
DecimalFormat df = new DecimalFormat("#####################0.00");
if(!"".equals(id) && !"0".equals(id)) {
String sql1 = "select * From FnaInvoiceLedgerDetail Where mainid="+id+" order by id";
rs.execute(sql1);
while(rs.next()){
String invoiceServiceYype = Util.null2String(rs.getString("invoiceServiceYype"));
double priceWithoutTax = Util.getDoubleValue(rs.getString("priceWithoutTax"),0.00);
double taxRate = Util.getDoubleValue(rs.getString("taxRate"),0.00);
double tax = Util.getDoubleValue(rs.getString("tax"),0.00);
jsonArray=new JSONArray();
jsonArray=new JSONArray();
jsonObject=new JSONObject();
jsonObject.put("name", "invoiceServiceYype");
jsonObject.put("iseditable", "true");
jsonObject.put("value", invoiceServiceYype);
jsonObject.put("label", invoiceServiceYype);
jsonObject.put("type", "input");
jsonArray.put(jsonObject);
jsonObject=new JSONObject();
jsonObject.put("name", "priceWithoutTax");
jsonObject.put("iseditable", "true");
jsonObject.put("value", df.format(priceWithoutTax));
jsonObject.put("label", df.format(priceWithoutTax));
jsonObject.put("type", "input");
jsonArray.put(jsonObject);
jsonObject=new JSONObject();
jsonObject.put("name", "taxRate");
jsonObject.put("iseditable", "true");
jsonObject.put("value", df.format(taxRate));
jsonObject.put("label", df.format(taxRate));
jsonObject.put("type", "input");
jsonArray.put(jsonObject);
jsonObject=new JSONObject();
jsonObject.put("name", "tax");
jsonObject.put("iseditable", "true");
jsonObject.put("value", df.format(tax));
jsonObject.put("label", df.format(tax));
jsonObject.put("type", "input");
jsonArray.put(jsonObject);
ajaxData.put(jsonArray);
}
}
out.println(ajaxData.toString());
%>