凭证信息, 删除新增贴息反冲凭证

This commit is contained in:
xiezhiwen 2019-03-04 11:39:19 +08:00
parent 8f542d670a
commit bfedbd7844
4 changed files with 116 additions and 4 deletions

View File

@ -61,6 +61,7 @@
if(!frames["downloadTemplate"]) $("<iframe name='downloadTemplate' style='display:none;'></iframe>").appendTo("body");
window.open(sWebRootPath+"/servlet/view/docDownloadServlet?CompClientID=<%=sCompClientID%>&sqlString=save@"+id, "downloadTemplate");
}
function newRecord(){
var sUrl = "";
AsControl.OpenView(sUrl,'','_self','');
@ -75,7 +76,12 @@
AsControl.OpenView(sUrl,'SerialNo=' +sPara ,'_self','');
}
function do_delete(){
var sPara = getItemValue(0,getRow(0),'ID');
if(confirm("ÊÇ·ñɾ³ý£¿")){
// 删除生成反冲贴息凭证
if(typeof(sPara)!="undefined" || sPara.length>0 ){
var res = RunJavaMethodTrans("com.tenwa.voucher.CreateVoucherProcess.CreateVoucherForInterestSubsidyImport", "createInterSubsidyRecoilVoucher", "id="+sPara);
}
as_delete(0);
}
}

View File

@ -1,5 +1,4 @@
#凭证信息
#账套
voucher_account=bq1217
#单据类型
@ -111,4 +110,19 @@ contract_replace=Y
#所属集团
contract_pk_group=06
#所属组织
contract_pk_org=06
contract_pk_org=06
#用友连接配置-示例:http://172.16.0.88:9990/service/XChangeServlet?account=BQ1217&groupcode=06
#IP地址及端口
NC_URL=http://172.16.0.88:9990
account=BQ1217
groupcode=06
#传输xml文件存放路径
LOCALHOST_URL=//data//files//apzl_leasing//tmp//XZW//
#回执信息存放路径
RECEIVE_URL=//data//files//apzl_leasing//tmp//WEN//

View File

@ -14,6 +14,19 @@ import com.tenwa.comm.util.jboutil.DataOperatorUtil;
import com.tenwa.voucher.serviceImp.CreateVoucherServiceImpl;
public class CreateVoucherForInterestSubsidyImport {
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
/**
* 导入贴息生成凭证
* @param tx
* @throws Exception
*/
public void createInterSubsidyVoucher(JBOTransaction tx) throws Exception {
Transaction Sqlca = null;
Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource());
@ -37,7 +50,7 @@ public class CreateVoucherForInterestSubsidyImport {
String voucherNo = "PZ2018072100000028";
Map<String, String> param = new HashMap<String, String>();
// 获取新导入的贴息数据
String sql = "SELECT IFNULL(LD.DISCOUNT_MONEY, 0) AS MONEY,IFNULL(ROUND(LD.DISCOUNT_MONEY/getTax(LCI.LEAS_FORM,'×âÏ¢',LCCT.START_DATE),2),0) AS MONEYNOTAX,IFNULL((LD.DISCOUNT_MONEY- ROUND(LD.DISCOUNT_MONEY/getTax(LCI.LEAS_FORM,'×âÏ¢',LCCT.START_DATE),2)),0) AS MONEYTAX,DATE_FORMAT(SYSDATE(), '%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(), '%Y/%m/%d') AS FACT_DATE,LCCT.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,CIF.CUSTOMER_NUM AS CUSTOMERID,CIF.CUSTOMERNAME,LD.BANK_SUBJECT AS SUBJECTCODE,LD.ACC_NUMBER FROM LB_DISCOUNT LD LEFT JOIN LB_EQUIPMENT_CAR LEC ON LEC.FRAME_NUMBER=LD.FRAME_NUMBER LEFT JOIN LC_CALC_CONDITION LCCT ON LCCT.CONTRACT_ID=LEC.CONTRACT_ID LEFT JOIN LB_CONTRACT_INFO LCI ON LCI.ID=LCCT.CONTRACT_ID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO = LCI.DISTRIBUTOR_ID LEFT JOIN lb_union_lessee lul ON lul.contract_id = lci.id LEFT JOIN customer_info cif ON cif.customerid = lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE IS_VOUCHER IS NULL ";
String sql = "SELECT IFNULL(LD.DISCOUNT_MONEY, 0) AS MONEY,IFNULL(ROUND(LD.DISCOUNT_MONEY/getTax(LCI.LEAS_FORM,'租息',LCCT.START_DATE),2),0) AS MONEYNOTAX,IFNULL((LD.DISCOUNT_MONEY- ROUND(LD.DISCOUNT_MONEY/getTax(LCI.LEAS_FORM,'租息',LCCT.START_DATE),2)),0) AS MONEYTAX,DATE_FORMAT(SYSDATE(), '%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(LD.RECEIVED_DATE, '%Y/%m/%d') AS FACT_DATE,LCCT.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,CIF.CUSTOMER_NUM AS CUSTOMERID,CIF.CUSTOMERNAME,LD.BANK_SUBJECT AS SUBJECTCODE,LD.ACC_NUMBER FROM LB_DISCOUNT LD LEFT JOIN LB_EQUIPMENT_CAR LEC ON LEC.FRAME_NUMBER=LD.FRAME_NUMBER LEFT JOIN LC_CALC_CONDITION LCCT ON LCCT.CONTRACT_ID=LEC.CONTRACT_ID LEFT JOIN LB_CONTRACT_INFO LCI ON LCI.ID=LCCT.CONTRACT_ID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO = LCI.DISTRIBUTOR_ID LEFT JOIN lb_union_lessee lul ON lul.contract_id = lci.id LEFT JOIN customer_info cif ON cif.customerid = lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE IS_VOUCHER IS NULL ";
// 查询sql, 将结果集封装到list集合中
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(Sqlca, sql, null);
CreateVoucherServiceImpl vs = new CreateVoucherServiceImpl();
@ -89,4 +102,83 @@ public class CreateVoucherForInterestSubsidyImport {
}
Sqlca.commit();
}
public void createInterSubsidyRecoilVoucher(JBOTransaction tx) throws Exception {
Transaction Sqlca = null;
Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource());
// 定义全局变量
String MONEY=null;
String MONEYNOTAX=null;
String MONEYTAX=null;
String ACCOUNT_DATE=null;
String FACT_DATE=null;
String CONTRACT_ID=null;
String CONTRACT_NUMBER=null;
String PROJECT_NAME=null;
String leas_form=null;
String DISTRIBUTOR_ID=null;
String DISTRIBUTOR_NAME=null;
String CUSTID=null;
String CUSTNAME=null;
String SUBJECTCODE=null;
String ACC_NUMBER=null;
String voucherNo = "PZ2018072100000041";
Map<String, String> param = new HashMap<String, String>();
// 获取新导入的贴息数据
String sql = "SELECT -IFNULL(LD.DISCOUNT_MONEY, 0) AS MONEY,-IFNULL(ROUND(LD.DISCOUNT_MONEY / getTax (LCI.LEAS_FORM,'租息',LCCT.START_DATE),2),0) AS MONEYNOTAX,-IFNULL((LD.DISCOUNT_MONEY - ROUND(LD.DISCOUNT_MONEY / getTax(LCI.LEAS_FORM,'租息',LCCT.START_DATE),2)),0) AS MONEYTAX,DATE_FORMAT(SYSDATE(), '%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(), '%Y/%m/%d') AS FACT_DATE,LCCT.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,CIF.CUSTOMER_NUM AS CUSTOMERID,CIF.CUSTOMERNAME,LD.BANK_SUBJECT AS SUBJECTCODE,LD.ACC_NUMBER FROM LB_DISCOUNT LD LEFT JOIN LB_EQUIPMENT_CAR LEC ON LEC.FRAME_NUMBER = LD.FRAME_NUMBER LEFT JOIN LC_CALC_CONDITION LCCT ON LCCT.CONTRACT_ID = LEC.CONTRACT_ID LEFT JOIN LB_CONTRACT_INFO LCI ON LCI.ID = LCCT.CONTRACT_ID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO = LCI.DISTRIBUTOR_ID LEFT JOIN lb_union_lessee lul ON lul.contract_id = lci.id LEFT JOIN customer_info cif ON cif.customerid = lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LD.ID=:ID";
// 查询sql, 将结果集封装到list集合中
Map<String,String>map1 = new HashMap<String,String>();
map1.put("ID",id);
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(Sqlca, sql, map1);
CreateVoucherServiceImpl vs = new CreateVoucherServiceImpl();
String VOUCHER_TYPE = "1";// 凭证分类 金蝶
String userid = "admin";
for (int i=0;i<dataList.size();i++){
MONEY=dataList.get(i).get("MONEY").toString();
MONEYNOTAX=dataList.get(i).get("MONEYNOTAX").toString();
MONEYTAX=dataList.get(i).get("MONEYTAX").toString();
ACCOUNT_DATE=dataList.get(i).get("ACCOUNT_DATE").toString();
FACT_DATE =dataList.get(i).get("FACT_DATE").toString();
CONTRACT_ID=dataList.get(i).get("CONTRACT_ID").toString();
CONTRACT_NUMBER=dataList.get(i).get("CONTRACT_NUMBER").toString();
PROJECT_NAME=dataList.get(i).get("PROJECT_NAME").toString();
leas_form=dataList.get(i).get("LEAS_FORM").toString();
DISTRIBUTOR_ID=dataList.get(i).get("DISTRIBUTOR_ID");
DISTRIBUTOR_NAME=dataList.get(i).get("DISTRIBUTOR_NAME");
CUSTID=dataList.get(i).get("CUSTOMERID");
CUSTNAME=dataList.get(i).get("CUSTOMERNAME");
SUBJECTCODE=dataList.get(i).get("SUBJECTCODE");
ACC_NUMBER=dataList.get(i).get("ACC_NUMBER");
param.put("FACT_MONEY",MONEY);
param.put("INTERESTNOTAX",MONEYNOTAX);
param.put("TAX",MONEYTAX);
param.put("ACCOUNT_DATE",ACCOUNT_DATE);
param.put("FACT_DATE",FACT_DATE);
param.put("CONTRACT_ID",CONTRACT_ID);
param.put("CONTRACT_NUMBER",CONTRACT_NUMBER);
param.put("PROJECT_NAME",PROJECT_NAME);
param.put("LEAS_FORM",leas_form);
param.put("DISTRIBUTOR_ID",DISTRIBUTOR_ID);
param.put("DISTRIBUTOR_NAME",DISTRIBUTOR_NAME);
param.put("CUSTID",CUSTID);
param.put("CUSTNAME",CUSTNAME);
param.put("SUBJECTCODE",SUBJECTCODE);
param.put("ACC_NUMBER",ACC_NUMBER);
param.put("VOUCHERNO",voucherNo);
Map<String, String> map = new HashMap<String, String>();
map.put("PROJ_TYPE", "02");
map.put("VOUCHER_NO", voucherNo);
BizObject vouch = DataOperatorUtil.getSingleJBO(LV_VOUCHER_CONFIG.CLASS_NAME, map, Sqlca);
if (vouch != null) {
vs.createVoucher(vouch.getAttribute("id").getString(),vouch.getAttribute("MODULAR_NUMBER").getString(),vouch.getAttribute("OWNED_COMPANY").getString(), "02", VOUCHER_TYPE, userid, param, Sqlca);
}
}
if(Sqlca !=null) {
Sqlca.commit();
}
}
}

View File

@ -253,7 +253,7 @@ public class CreateVoucherServiceImpl {
/**
* 贴息根据导入的科目编码获取科目信息, 其他的正常
*/
if("PZ2018072100000028".equals(VOUCHERNO)) {
if("PZ2018072100000028".equals(VOUCHERNO) || "PZ2018072100000041".equals(VOUCHERNO)) {
if("1".equals(SORT_NUMBER)) {
String SUBJECTCODE = param.get("SUBJECTCODE");
sub=JBOFactory.createBizObjectQuery(LV_STACTS_CONFIG.CLASS_NAME,"SUBJECTS_CODE=:SUBJECTS_CODE").setParameter("SUBJECTS_CODE", SUBJECTCODE).getSingleResult(false);