FnaInvoiceDetailInfoAjax.jsp 2.67 KB
<%@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());
%>