diff --git a/src_tenwa/com/tenwa/apzl/commission/commissionSet.java b/src_tenwa/com/tenwa/apzl/commission/commissionSet.java index e3e0c4a8f..f9b33dd73 100644 --- a/src_tenwa/com/tenwa/apzl/commission/commissionSet.java +++ b/src_tenwa/com/tenwa/apzl/commission/commissionSet.java @@ -93,29 +93,37 @@ public class commissionSet { Transaction Sqlca=null; tx= JBOFactory.createJBOTransaction(); Sqlca=Transaction.createTransaction(tx); + String endDate = this.getEndDate(); + endDate = endDate.replaceAll("/", ""); + int end = Integer.parseInt(endDate); int start = 0; String sql="SELECT MIN(effect_start) AS effect_start FROM LB_PRODUCT_SALVAGE WHERE product_id=:product_id AND effect_start>:effect_start"; SqlObject asql = new SqlObject(sql).setParameter("product_id", leasForm).setParameter("effect_start", startDate); try { ASResultSet rs = Sqlca.getResultSet(asql); - if(rs.next()){ - String effectStart = rs.getString(1); - effectStart = effectStart.replaceAll("/", ""); - start = Integer.parseInt(effectStart); - } + + + if(rs.next()){ + String effectStart = rs.getString(1); + if(effectStart==null || "".equals(effectStart)){ + return "success"; + }else{ + + effectStart = effectStart.replaceAll("/", ""); + start = Integer.parseInt(effectStart); + } + } + } catch (Exception e) { e.printStackTrace(); } - - String endDate = this.getEndDate(); - endDate = endDate.replaceAll("/", ""); - int end = Integer.parseInt(endDate); - if(end>=start){ return "fail"; }else{ return "success"; } + + } }