税控初步优化
This commit is contained in:
parent
ec92a80167
commit
fb6e017bb2
@ -51,17 +51,14 @@
|
||||
json["cert_id"] =getItemValue(0, ros[i], "cert_id");
|
||||
json["tax_ratio"] =getItemValue(0, ros[i], "tax_ratio");
|
||||
json["customer_type"] =getItemValue(0, ros[i], "customer_type");
|
||||
//发票种类
|
||||
json["fpzl"] ="00";
|
||||
//发票正负
|
||||
json["fpzf"] ="00";
|
||||
|
||||
json["plan_list"] =getItemValue(0, ros[i], "plan_list");
|
||||
jsonArr.push(json);
|
||||
json={};
|
||||
}
|
||||
var param = JSON.stringify(jsonArr);
|
||||
param = "InvoiceParam="+param.replace(/,/g,'@');
|
||||
param = "InvoiceParam="+param.replace(/,/g,'@')+",fpzl=00,fpzf=00";
|
||||
// alert(param);
|
||||
return;
|
||||
var res = AsControl.RunJavaMethod("com.tenwa.invoice.IAutokpDo", "invoice", param);
|
||||
}
|
||||
|
||||
|
||||
@ -15,12 +15,16 @@
|
||||
//{"true","","Button","删除","删除","if(confirm('确实要删除吗?'))as_delete(0,'alert(getRowCount(0))')","","","","btn_icon_delete",""},
|
||||
{"true","","Button","发票作废","发票作废","deleteInvoice()","","","","",""},
|
||||
{"true","","Button","发票红冲","发票红冲","redInkInvoice()","","","","",""},
|
||||
{"true","","Button","·¢Æ±´òÓ¡","·¢Æ±´òÓ¡","printInvoice()","","","","",""},
|
||||
|
||||
};
|
||||
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
|
||||
<script type="text/javascript">
|
||||
function deleteIncoice(){
|
||||
|
||||
var fpdm= getItemValue(0, ros[i], "fpdm");
|
||||
var fphm= getItemValue(0, ros[i], "fphm");
|
||||
var param = "fpzl=00,fpdm="+fpdm+",fphm="+fphm;
|
||||
var res = AsControl.RunJavaMethod("com.tenwa.invoice.IAutokpDo", "invoice_fpzf", param);
|
||||
}
|
||||
function redInkInvoice(){
|
||||
debugger;
|
||||
@ -39,20 +43,15 @@
|
||||
json["cert_id"] =getItemValue(0, ros[i], "cert_id");
|
||||
json["tax_ratio"] =getItemValue(0, ros[i], "tax_ratio");
|
||||
json["customer_type"] =getItemValue(0, ros[i], "customer_type");
|
||||
//发票种类
|
||||
json["fpzl"] ="00";
|
||||
//发票正负(00为正,01为负)
|
||||
json["fpzf"] ="01";
|
||||
//Todo-----------------------记得在视图中添加对应字段。
|
||||
json["HCFPDM"] =getItemValue(0, ros[i], "FPDM");
|
||||
json["HCFPHM"] =getItemValue(0, ros[i], "FPHM");
|
||||
//红票通知单号,专票并且为红票时必填
|
||||
json["HCTZDH"] =getItemValue(0, ros[i], "HCTZDH");
|
||||
json["plan_list"] =getItemValue(0, ros[i], "plan_list");
|
||||
json["HCFPDM"] =getItemValue(0, ros[i], "fpdm");
|
||||
json["HCFPHM"] =getItemValue(0, ros[i], "fphm");
|
||||
json["HCTZDH"] =getItemValue(0, ros[i], "hctzdh");
|
||||
jsonArr.push(json);
|
||||
json={};
|
||||
}
|
||||
var param = JSON.stringify(jsonArr);
|
||||
param = "InvoiceParam="+param.replace(/,/g,'@');
|
||||
param = "InvoiceParam="+param.replace(/,/g,'@')+",fpzl=00,fpzf=01";
|
||||
// alert(param);
|
||||
var res = AsControl.RunJavaMethod("com.tenwa.invoice.IAutokpDo", "invoice", param);
|
||||
}
|
||||
|
||||
Binary file not shown.
@ -1,6 +1,9 @@
|
||||
package com.tenwa.invoice;
|
||||
|
||||
import java.rmi.RemoteException;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -9,40 +12,50 @@ import java.util.Map.Entry;
|
||||
|
||||
import javax.xml.rpc.ServiceException;
|
||||
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.Element;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.amarsoft.are.ARE;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.are.util.StringFunction;
|
||||
import com.amarsoft.awe.util.SqlObject;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.amarsoft.dict.als.cache.CacheLoaderFactory;
|
||||
|
||||
public class IAutokpDo {
|
||||
String invoiceParam;
|
||||
public String getInvoiceParam() {
|
||||
return invoiceParam;
|
||||
}
|
||||
public void setInvoiceParam(String invoiceParam) {
|
||||
this.invoiceParam = invoiceParam;
|
||||
}
|
||||
public String invoice(){
|
||||
Transaction Sqlca = null;
|
||||
Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource());
|
||||
//参数
|
||||
private String invoiceParam;
|
||||
//00=专票;02=普票
|
||||
private String fpzl;
|
||||
//00为正票;01为负票
|
||||
private String fpzf;
|
||||
private String sid;
|
||||
private String fpdm;
|
||||
private String fphm;
|
||||
|
||||
public String invoice() {
|
||||
|
||||
String invoiceParam = this.invoiceParam.replaceAll("@", ",");
|
||||
String requestParam = "";
|
||||
Document doc;
|
||||
IAutokpXML ivoiceXML = new IAutokpXML();
|
||||
//根据合同号进行分组
|
||||
Map<String,List<Map<String,String>>> map = ivoiceXML.getParam(invoiceParam);
|
||||
Map<String,List<Map<String,String>>> map = ivoiceXML.getParam(invoiceParam,fpzf);
|
||||
for(Map.Entry<String, List<Map<String, String>>> lsm: map.entrySet()){
|
||||
String contract_no=lsm.getKey();
|
||||
String responseParam="";
|
||||
doc = ivoiceXML.createInvoiceXML(lsm,fpzl,fpzf);
|
||||
requestParam = doc.asXML();
|
||||
try {
|
||||
requestParam = ivoiceXML.createInvoiceXML(lsm);
|
||||
if(!requestParam.startsWith("error")&&requestParam!=null&&!"".equals(requestParam)){
|
||||
IAutokpUtils.saveFile(requestParam, contract_no);
|
||||
IAutokpserviceLocator kpl = new IAutokpserviceLocator();
|
||||
IAutokp autoKP = kpl.getIAutokpPort();
|
||||
responseParam = autoKP.invoice(requestParam);
|
||||
System.out.println("返回结果:"+responseParam);
|
||||
}
|
||||
|
||||
} catch (RemoteException e) {
|
||||
@ -55,20 +68,19 @@ public class IAutokpDo {
|
||||
|
||||
//开票成功
|
||||
if(!"".endsWith(responseParam)){
|
||||
IAutokpUtils.saveFile(responseParam, contract_no);
|
||||
IAutokpUtils.saveFile(responseParam, contract_no+"_rnt");
|
||||
Map<String,String> responseResult = IAutokpUtils.getResponseResult(responseParam);
|
||||
if("4011".equals(responseResult.get("fl"))){
|
||||
|
||||
}else{
|
||||
|
||||
insertInvoiceTable(lsm,contract_no,doc,responseResult);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
System.out.println();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发票打印
|
||||
* @return
|
||||
@ -77,6 +89,7 @@ public class IAutokpDo {
|
||||
String requestParam="";
|
||||
String responseParam="";
|
||||
String SID = "Invoice_getfph";
|
||||
IAutokpXML ivoiceXML = new IAutokpXML();
|
||||
try {
|
||||
IAutokpserviceLocator kpl = new IAutokpserviceLocator();
|
||||
IAutokp autoKP = kpl.getIAutokpPort();
|
||||
@ -98,7 +111,9 @@ public class IAutokpDo {
|
||||
public String invoice_fpzf(){
|
||||
String requestParam="";
|
||||
String responseParam="";
|
||||
String SID = "Invoice_getfph";
|
||||
String sid = "Invoice_getfph";
|
||||
IAutokpXML ivoiceXML = new IAutokpXML();
|
||||
requestParam = ivoiceXML.createInvoiceOthersXML(sid,fpzl,fpdm,fphm);
|
||||
try {
|
||||
IAutokpserviceLocator kpl = new IAutokpserviceLocator();
|
||||
IAutokp autoKP = kpl.getIAutokpPort();
|
||||
@ -110,7 +125,13 @@ public class IAutokpDo {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if(!"".endsWith(responseParam)){
|
||||
IAutokpUtils.saveFile(responseParam, fpdm+"-"+fphm+"_rnt");
|
||||
Map<String,String> responseResult = IAutokpUtils.getResponseResult(responseParam);
|
||||
if("6011".equals(responseResult.get("fl"))){
|
||||
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
@ -157,4 +178,129 @@ public class IAutokpDo {
|
||||
|
||||
return null;
|
||||
}
|
||||
public String getFpzl() {
|
||||
return fpzl;
|
||||
}
|
||||
public void setFpzl(String fpzl) {
|
||||
this.fpzl = fpzl;
|
||||
}
|
||||
public String getFpzf() {
|
||||
return fpzf;
|
||||
}
|
||||
public void setFpzf(String fpzf) {
|
||||
this.fpzf = fpzf;
|
||||
}
|
||||
public String getInvoiceParam() {
|
||||
return invoiceParam;
|
||||
}
|
||||
public void setInvoiceParam(String invoiceParam) {
|
||||
this.invoiceParam = invoiceParam;
|
||||
}
|
||||
public String getFpdm() {
|
||||
return fpdm;
|
||||
}
|
||||
public void setFpdm(String fpdm) {
|
||||
this.fpdm = fpdm;
|
||||
}
|
||||
public String getFphm() {
|
||||
return fphm;
|
||||
}
|
||||
public void setFphm(String fphm) {
|
||||
this.fphm = fphm;
|
||||
}
|
||||
public String getSid() {
|
||||
return sid;
|
||||
}
|
||||
|
||||
public void setSid(String sid) {
|
||||
this.sid = sid;
|
||||
}
|
||||
public void insertInvoiceTable(Map.Entry<String, List<Map<String, String>>> lsm,String contractNo,Document doc,Map<String,String> responseResult){
|
||||
String insertSql = "insert into li_invoice_tj_info(id,contract_no,plan_list,fpzl,fpzf,invoice_money,tax_type,tax_ratio,tax_money,sw_spbm,fpdm,fphm,hztzdh,status,inputuserid,inputtime)values"
|
||||
+"(REPLACE(UUID(),'-',''),?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
PreparedStatement ps = null;
|
||||
Transaction Sqlca = null;
|
||||
Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource());
|
||||
Connection con;
|
||||
try {
|
||||
con = Sqlca.getConnection();
|
||||
boolean autoCom = con.getAutoCommit();
|
||||
if(autoCom){
|
||||
con.setAutoCommit(false);
|
||||
}
|
||||
ps = con.prepareStatement(insertSql);
|
||||
Element ele_order = doc.getRootElement().element("DataArea").element("Data").element("Order");
|
||||
Element ele_head = ele_order.element("Head");
|
||||
Element ele_items = ele_order.element("Items");
|
||||
String hztzdh = "N";
|
||||
String status = "Y";
|
||||
String fpdm = responseResult.get("fpdm");
|
||||
String fphm = responseResult.get("fphm");
|
||||
if("01".equals(fpzf)){
|
||||
status = "R";
|
||||
fpdm = ele_head.element("HCFPDM").getText();
|
||||
fphm = ele_head.element("HCFPHM").getText();
|
||||
hztzdh = ele_head.element("HZTZDH").getText();
|
||||
}
|
||||
List<Element> listItems = ele_items.elements();
|
||||
for(Element item : listItems){
|
||||
String mxxh = item.element("MXXH").getText();
|
||||
String planList = "";
|
||||
for(Map<String,String> map :lsm.getValue()){
|
||||
if(mxxh.equals(map.get("MXXH"))){
|
||||
planList = map.get("planList");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
String invoice_money = item.element("JE").getText();
|
||||
String taxType = item.element("GGXH").getText();
|
||||
String taxRatio = item.element("SLV").getText();
|
||||
String taxMoney = item.element("shuier").getText();
|
||||
String sw_spbm = item.element("sw_spbm").getText();
|
||||
String inputuserid = "system";
|
||||
String inputtime = StringFunction.getNow();
|
||||
|
||||
ps.setString(1,contractNo);
|
||||
ps.setString(2,planList);
|
||||
ps.setString(3,fpzl);
|
||||
ps.setString(4,fpzf);
|
||||
ps.setString(5,invoice_money);
|
||||
ps.setString(6,taxType);
|
||||
ps.setString(7,taxRatio);
|
||||
ps.setString(8,taxMoney);
|
||||
ps.setString(9,sw_spbm);
|
||||
ps.setString(10,fpdm);
|
||||
ps.setString(11,fphm);
|
||||
ps.setString(12,hztzdh);
|
||||
ps.setString(13,status);
|
||||
ps.setString(14,inputuserid);
|
||||
ps.setString(15,inputtime);
|
||||
ps.addBatch();
|
||||
}
|
||||
ps.executeBatch();
|
||||
con.commit();
|
||||
con.setAutoCommit(autoCom);
|
||||
ps.close();
|
||||
ps = null;
|
||||
System.out.println("==========开票完毕==========");
|
||||
} catch (SQLException e) {
|
||||
ARE.getLog().debug("插入天津发票信息表:"+contractNo+"出错,出错消息"+e.getMessage(),e);
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(ps != null){
|
||||
try {
|
||||
ps.close();
|
||||
ps = null;
|
||||
} catch (SQLException e) {
|
||||
ARE.getLog().debug("数据库关闭异常:" + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.tenwa.invoice;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
@ -19,7 +21,7 @@ import com.tenwa.comm.util.jboutil.DataOperatorUtil;
|
||||
|
||||
public class IAutokpXML {
|
||||
|
||||
public Map<String,List<Map<String,String>>> getParam (String param){
|
||||
public Map<String,List<Map<String,String>>> getParam (String param,String fpzf){
|
||||
JSONArray array =JSON.parseArray(param);
|
||||
|
||||
Map<String,List<Map<String,String>>> map = new HashMap<String,List<Map<String,String>>>();
|
||||
@ -38,8 +40,13 @@ public class IAutokpXML {
|
||||
mapi.put("telephone",obj.getString("telephone"));
|
||||
mapi.put("cert_id",obj.getString("cert_id"));
|
||||
mapi.put("customer_type",obj.getString("customer_type"));
|
||||
mapi.put("fpzl",obj.getString("fpzl"));
|
||||
mapi.put("fpzf",obj.getString("fpzf"));
|
||||
mapi.put("plan_list",obj.getString("plan_list"));
|
||||
if("01".equals(fpzf)){
|
||||
mapi.put("HCFPDM",obj.getString("HCFPDM"));
|
||||
mapi.put("HCFPHM",obj.getString("HCFPHM"));
|
||||
mapi.put("HZTZDH",obj.getString("HZTZDH"));
|
||||
mapi.put("invoice_money","-"+obj.getString("invoice_money"));
|
||||
}
|
||||
if(map.containsKey(contract_no)){
|
||||
map.get(contract_no).add(mapi);
|
||||
}else{
|
||||
@ -50,32 +57,55 @@ public class IAutokpXML {
|
||||
|
||||
return map;
|
||||
}
|
||||
public String createInvoiceXML(Map.Entry<String, List<Map<String, String>>> params){
|
||||
public Document createInvoiceXML(Map.Entry<String, List<Map<String, String>>> params,String fpzl,String fpzf){
|
||||
|
||||
Document doc = DocumentHelper.createDocument();
|
||||
doc.setXMLEncoding("GBK");
|
||||
Element rootEle = doc.addElement("DataArea");
|
||||
//接口SID 目前默认填写SID_ZP
|
||||
Element Ele_SID = rootEle.addElement("SID");
|
||||
Ele_SID.setText("SID_ZP");
|
||||
IAutokpUtils.addUserInfo(rootEle);
|
||||
Element Ele_Data = rootEle.addElement("Data");
|
||||
Element Ele_Order = Ele_Data.addElement("Order");
|
||||
Element Ele_Head = Ele_Order.addElement("Head");
|
||||
//单据编号
|
||||
Element Ele_XSDJBH = Ele_Head.addElement("XSDJBH");
|
||||
Ele_XSDJBH.setText(params.getKey());
|
||||
//发票种类(00=专票、02=普票)
|
||||
Element Ele_FPZL = Ele_Head.addElement("FPZL");
|
||||
Ele_FPZL.setText(fpzl);
|
||||
//购方类型(01=企业、03=个人)
|
||||
Element Ele_GFLX = Ele_Head.addElement("GFLX");
|
||||
Element Ele_FPZF = Ele_Head.addElement("FPZF");
|
||||
Ele_GFLX.setText("03");
|
||||
//发票正负(00=正票、01=负票)
|
||||
Element Ele_FPZF = Ele_Head.addElement("fpzf");
|
||||
Ele_FPZF.setText(fpzf);
|
||||
//购方名称(客户名称)
|
||||
Element Ele_GFMC = Ele_Head.addElement("GFMC");
|
||||
//购方税号
|
||||
Element Ele_GFSH = Ele_Head.addElement("GFSH");
|
||||
//购方地址电话
|
||||
Element Ele_GFDZDH = Ele_Head.addElement("GFDZDH");
|
||||
//购方银行账号
|
||||
Element Ele_GFYHZH = Ele_Head.addElement("GFYHZH");
|
||||
//购方手机
|
||||
Element Ele_GFSJ = Ele_Head.addElement("GFSJ");
|
||||
//购方邮箱
|
||||
Element Ele_GFYX = Ele_Head.addElement("GFYX");
|
||||
//销方税号
|
||||
Element Ele_XFSH = Ele_Head.addElement("XFSH");
|
||||
Ele_XFSH.setText("91120118MA05M9911M");
|
||||
//销方名称
|
||||
Element Ele_XFMC = Ele_Head.addElement("XFMC");
|
||||
Ele_XFMC.setText("安鹏融资租赁(天津)有限公司");
|
||||
//销方地址电话
|
||||
Element Ele_XFDZDH = Ele_Head.addElement("XFDZDH");
|
||||
Ele_XFDZDH.setText("天津自贸试验区(东疆报税岗区)贺兰道450号恒盛广场4号楼-15-5 010-66292807");
|
||||
//销方银行账号
|
||||
Element Ele_XFYHZH = Ele_Head.addElement("XFYHZH");
|
||||
Ele_XFYHZH.setText("中国银行天津自由贸易试验区分行营业部273979802218");
|
||||
|
||||
Element Ele_HCFPDM = Ele_Head.addElement("HCFPDM");
|
||||
Element Ele_HCFPHM = Ele_Head.addElement("HCFPHM");
|
||||
Element Ele_HZTZDH = Ele_Head.addElement("HZTZDH");
|
||||
@ -93,7 +123,7 @@ public class IAutokpXML {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
System.out.println("开票人员信息获取错误。");
|
||||
return "error_taxOperator";
|
||||
return null;
|
||||
}
|
||||
String KJR = dataList.get(0).get("tax_creator");
|
||||
String FHR = dataList.get(0).get("tax_checker");
|
||||
@ -113,11 +143,11 @@ public class IAutokpXML {
|
||||
Element Ele_CFBZ = Ele_Head.addElement("CFBZ");
|
||||
Element Ele_QDBZ = Ele_Head.addElement("QDBZ");
|
||||
Ele_QDBZ.setText("0");
|
||||
Element Ele_ITEMS = Ele_Order.addElement("ITEMS");
|
||||
Element Ele_ITEMS = Ele_Order.addElement("Items");
|
||||
//添加每个商品信息
|
||||
for(int i=0;i<params.getValue().size();i++){
|
||||
String JE = params.getValue().get(i).get("invoice_money");
|
||||
String SLV = params.getValue().get(i).get("tax_ratio");
|
||||
String SLV ="0." + params.getValue().get(i).get("tax_ratio");
|
||||
String SPMC = params.getValue().get(i).get("tax_type");
|
||||
if(i==0){
|
||||
String GFMC = params.getValue().get(i).get("customer_name");
|
||||
@ -128,14 +158,14 @@ public class IAutokpXML {
|
||||
Ele_GFDZDH.setText(GFDZDH);
|
||||
String GFSH = params.getValue().get(i).get("cert_id");
|
||||
Ele_GFSH.setText(GFSH);
|
||||
String FPZL = params.getValue().get(i).get("fpzl");
|
||||
Ele_FPZL.setText(FPZL);
|
||||
String FPZF = params.getValue().get(i).get("fpzf");
|
||||
Ele_FPZF.setText(FPZF);
|
||||
|
||||
if("01".equals(fpzf)){
|
||||
Ele_HCFPDM.setText(params.getValue().get(i).get("HCFPDM"));
|
||||
Ele_HCFPHM.setText(params.getValue().get(i).get("HCFPHM"));
|
||||
Ele_HZTZDH.setText(params.getValue().get(i).get("HZTZDH"));
|
||||
}
|
||||
}
|
||||
|
||||
Element Ele_ITEM = Ele_ITEMS.addElement("ITEM");
|
||||
Element Ele_ITEM = Ele_ITEMS.addElement("Item");
|
||||
Element Ele_MXXH = Ele_ITEM.addElement("MXXH");
|
||||
Ele_MXXH.setText(i+1+"");
|
||||
Element Ele_JE = Ele_ITEM.addElement("JE");
|
||||
@ -151,31 +181,31 @@ public class IAutokpXML {
|
||||
Ele_SL.setText(SL);
|
||||
Element Ele_DJ = Ele_ITEM.addElement("DJ");
|
||||
Ele_DJ.setText(JE);
|
||||
Element Ele_SHUIER = Ele_ITEM.addElement("SHUIER");
|
||||
Element Ele_SHUIER = Ele_ITEM.addElement("shuier");
|
||||
//为了避免出现误差,税额不能直接用(含税金额*税率)。安鹏给的计算方法----不含税金额=含税金额/(1+税率);税金=含税金额-不含税金额
|
||||
String SHUIER = new BigDecimal(JE).subtract(new BigDecimal(JE).divide(new BigDecimal(SLV).add(new BigDecimal("1")))).setScale(2,BigDecimal.ROUND_HALF_UP).toString();
|
||||
String SHUIER = new BigDecimal(JE).subtract(new BigDecimal(JE).divide(new BigDecimal(SLV).add(new BigDecimal("1")),2,BigDecimal.ROUND_HALF_UP)).setScale(2,BigDecimal.ROUND_HALF_UP).toString();
|
||||
Ele_SHUIER.setText(SHUIER);
|
||||
Element Ele_HSBZ = Ele_ITEM.addElement("HSBZ");
|
||||
Ele_HSBZ.setText("1");
|
||||
Element Ele_GOODSNOVER = Ele_ITEM.addElement("GOODSNOVER");
|
||||
Ele_GOODSNOVER.setText("34");
|
||||
Element Ele_SPBM = Ele_ITEM.addElement("SW_SPBM");
|
||||
Element Ele_GOODSNOVER = Ele_ITEM.addElement("goodsnover");
|
||||
Ele_GOODSNOVER.setText("13.0");
|
||||
Element Ele_SPBM = Ele_ITEM.addElement("sw_spbm");
|
||||
//待客户确认
|
||||
Ele_SPBM.setText("0000000000000000000000");
|
||||
Ele_SPBM.setText("3040203");
|
||||
Element Ele_YHZCBS = Ele_ITEM.addElement("YHZCBS");
|
||||
Ele_YHZCBS.setText("0");
|
||||
Element Ele_TAXPRECON = Ele_ITEM.addElement("TAXPRECON");
|
||||
Element Ele_LSLBS = Ele_ITEM.addElement("LSLBS");
|
||||
Element ELE_ZKHBS = Ele_ITEM.addElement("ZKHBS");
|
||||
Element ELE_ZKHBS = Ele_ITEM.addElement("zkhbs");
|
||||
ELE_ZKHBS.setText("0");
|
||||
}
|
||||
|
||||
System.out.println("开票请求:"+doc.asXML());
|
||||
|
||||
return doc.asXML();
|
||||
return doc;
|
||||
}
|
||||
|
||||
public String createInvoiceOthersXML(String sid){
|
||||
public String createInvoiceOthersXML(String sid,String fpzl,String fpdm,String fphm){
|
||||
Document doc = DocumentHelper.createDocument();
|
||||
doc.setXMLEncoding("GBK");
|
||||
Element rootEle = doc.addElement("DataArea");
|
||||
@ -185,11 +215,14 @@ public class IAutokpXML {
|
||||
Element Ele_Data = rootEle.addElement("Data");
|
||||
Element Ele_Order = Ele_Data.addElement("Order");
|
||||
Element Ele_Head = Ele_Order.addElement("Head");
|
||||
Element Ele_FPZL = Ele_Order.addElement("FPZL");
|
||||
Element Ele_FPZL = Ele_Order.addElement("fpzl");
|
||||
Element Ele_FPDM = Ele_Order.addElement("FPDM");
|
||||
Element Ele_FPHM = Ele_Order.addElement("FPHM");
|
||||
|
||||
Ele_FPZL.setText(fpzl);
|
||||
Ele_FPDM.setText(fpdm);
|
||||
Ele_FPHM.setText(fphm);
|
||||
System.out.println("请求---"+sid+"---:"+doc.asXML());
|
||||
return doc.asXML();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -108,59 +108,17 @@ public class InvoiceBean {
|
||||
//打印标志---必填,0
|
||||
private String QDBZ="0";
|
||||
|
||||
//明细行数---必填,单张发票明细第N行明细
|
||||
private String MXXH;
|
||||
//开票信息明细
|
||||
private List<InvoiceItemBean> Items;
|
||||
|
||||
//金额---必填,精确到小数点号后两位,开红票与折扣时为负数
|
||||
private String JE;
|
||||
|
||||
//税率---必填(例:0.17)
|
||||
private String SLV;
|
||||
|
||||
//商品名称
|
||||
private String SPMC;
|
||||
|
||||
//规格型号
|
||||
private String GGXH;
|
||||
|
||||
//计量单位
|
||||
private String JLDW;
|
||||
|
||||
//数量---必填,开红票时为负数
|
||||
private String SL;
|
||||
|
||||
//单价---必填,精确到小数点号后四位
|
||||
private String DJ;
|
||||
|
||||
//税额---需要校验:小数点后 2 位,以元为单位精确到分;不需要校验:不传值。
|
||||
private String SHUIER;
|
||||
|
||||
//含税标志---必填,1=含税
|
||||
private String HSBZ="1";
|
||||
|
||||
//税收分类编码版本---必填,文档中要求填写13,但接口方要求填写34
|
||||
private String GOODSNOVER="34";
|
||||
|
||||
//税收分类编码----必填 ,19位,位数不够后面补0
|
||||
private String SW_SPBM;
|
||||
|
||||
//优惠政策标识---必填,是否享受,1=享受,0=不享受。
|
||||
private String YHZCBS="0";
|
||||
|
||||
//优惠政策名称---YHZCBS=1时必填,表示商品销售的具体优惠政策,如:即征即退、免税、简易征收等。(由于没有优惠,所以为空)
|
||||
private String TAXPRECON;
|
||||
|
||||
//零税率标识---空:非零税率,0:出口零税,1:免税,2:不征税,3普通零税率(没有零税率,为空)
|
||||
private String LSLBS;
|
||||
|
||||
//折扣行标识---必填,0=商品行,1=折扣行
|
||||
private String ZKHBS="0";
|
||||
public void getItems(String param){
|
||||
JSONArray array =JSON.parseArray(param);
|
||||
//List< Map<String,String>> listw = new ArrayList<Map<String,String>>();
|
||||
|
||||
|
||||
public List<InvoiceItemBean> getItems() {
|
||||
return Items;
|
||||
}
|
||||
|
||||
public void setItems(List<InvoiceItemBean> items) {
|
||||
Items = items;
|
||||
}
|
||||
|
||||
public String getSID() {
|
||||
return SID;
|
||||
}
|
||||
@ -424,138 +382,5 @@ public class InvoiceBean {
|
||||
public void setQDBZ(String qDBZ) {
|
||||
QDBZ = qDBZ;
|
||||
}
|
||||
|
||||
public String getMXXH() {
|
||||
return MXXH;
|
||||
}
|
||||
|
||||
public void setMXXH(String mXXH) {
|
||||
MXXH = mXXH;
|
||||
}
|
||||
|
||||
public String getJE() {
|
||||
return JE;
|
||||
}
|
||||
|
||||
public void setJE(String jE) {
|
||||
JE = jE;
|
||||
}
|
||||
|
||||
public String getSLV() {
|
||||
return SLV;
|
||||
}
|
||||
|
||||
public void setSLV(String sLV) {
|
||||
SLV = sLV;
|
||||
}
|
||||
|
||||
public String getSPMC() {
|
||||
return SPMC;
|
||||
}
|
||||
|
||||
public void setSPMC(String sPMC) {
|
||||
SPMC = sPMC;
|
||||
}
|
||||
|
||||
public String getGGXH() {
|
||||
return GGXH;
|
||||
}
|
||||
|
||||
public void setGGXH(String gGXH) {
|
||||
GGXH = gGXH;
|
||||
}
|
||||
|
||||
public String getJLDW() {
|
||||
return JLDW;
|
||||
}
|
||||
|
||||
public void setJLDW(String jLDW) {
|
||||
JLDW = jLDW;
|
||||
}
|
||||
|
||||
public String getSL() {
|
||||
return SL;
|
||||
}
|
||||
|
||||
public void setSL(String sL) {
|
||||
SL = sL;
|
||||
}
|
||||
|
||||
public String getDJ() {
|
||||
return DJ;
|
||||
}
|
||||
|
||||
public void setDJ(String dJ) {
|
||||
DJ = dJ;
|
||||
}
|
||||
|
||||
public String getSHUIER() {
|
||||
return SHUIER;
|
||||
}
|
||||
|
||||
public void setSHUIER(String sHUIER) {
|
||||
SHUIER = sHUIER;
|
||||
}
|
||||
|
||||
public String getHSBZ() {
|
||||
return HSBZ;
|
||||
}
|
||||
|
||||
public void setHSBZ(String hSBZ) {
|
||||
HSBZ = hSBZ;
|
||||
}
|
||||
|
||||
public String getGOODSNOVER() {
|
||||
return GOODSNOVER;
|
||||
}
|
||||
|
||||
public void setGOODSNOVER(String gOODSNOVER) {
|
||||
GOODSNOVER = gOODSNOVER;
|
||||
}
|
||||
|
||||
public String getSW_SPBM() {
|
||||
return SW_SPBM;
|
||||
}
|
||||
|
||||
public void setSW_SPBM(String sW_SPBM) {
|
||||
SW_SPBM = sW_SPBM;
|
||||
}
|
||||
|
||||
public String getYHZCBS() {
|
||||
return YHZCBS;
|
||||
}
|
||||
|
||||
public void setYHZCBS(String yHZCBS) {
|
||||
YHZCBS = yHZCBS;
|
||||
}
|
||||
|
||||
public String getTAXPRECON() {
|
||||
return TAXPRECON;
|
||||
}
|
||||
|
||||
public void setTAXPRECON(String tAXPRECON) {
|
||||
TAXPRECON = tAXPRECON;
|
||||
}
|
||||
|
||||
public String getLSLBS() {
|
||||
return LSLBS;
|
||||
}
|
||||
|
||||
public void setLSLBS(String lSLBS) {
|
||||
LSLBS = lSLBS;
|
||||
}
|
||||
|
||||
public String getZKHBS() {
|
||||
return ZKHBS;
|
||||
}
|
||||
|
||||
public void setZKHBS(String zKHBS) {
|
||||
ZKHBS = zKHBS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user