diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/EarlyContract.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/EarlyContract.java index ce71056ea..3ec356de3 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/EarlyContract.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/EarlyContract.java @@ -349,6 +349,25 @@ public class EarlyContract { return ""+YesNo+""; } + // 判断合同是否为部分结清 + public String Countnum(JBOTransaction tx) { + String Countnum = ""; + Transaction Sqlca = null; + try { + Sqlca = Transaction.createTransaction(tx); + Countnum = Sqlca.getString("select count(*) from (select lrp.CONTRACT_ID,lrp.PLAN_LIST,lrp.RENT - ifnull(lri.RENT,0) as RENT,lrp.CORPUS - ifnull(lri.CORPUS,0) as CORPUS,lrp.INTEREST - ifnull(lri.INTEREST,0) as INTEREST from lc_rent_plan lrp left join (select CONTRACT_ID,PLAN_LIST,sum(RENT) as RENT,sum(CORPUS) as CORPUS,sum(INTEREST) as INTEREST from lc_rent_income group by CONTRACT_ID,PLAN_LIST ) lri on lrp.CONTRACT_ID = lri.CONTRACT_ID and lrp.PLAN_LIST = lri.PLAN_LIST where lri.CORPUS <> 0) t where t.CORPUS >0 and t.CONTRACT_ID = '"+contractId+"'"); + }catch(Exception e) { + try { + Sqlca.rollback(); + } catch (JBOException e1) { + e1.printStackTrace(); + } + e.printStackTrace(); + } + + return ""+Countnum+""; + } + //全部结清更新租赁物临时表 @@ -558,7 +577,6 @@ public class EarlyContract { String last_plan_date = ""; for(int i=0; i