|
|
@@ -102,17 +102,17 @@ public class sendplandetail extends Controller {
|
|
|
}
|
|
|
|
|
|
if(row.getLong("itemid")==olditemid){
|
|
|
- insertSQL.setValue("canuseqty", oldcanuseqty.subtract(oldsendqty));
|
|
|
+ insertSQL.setValue("canuseqty", (oldcanuseqty.compareTo(BigDecimal.ZERO)==0?canuseqty:oldcanuseqty).subtract(oldsendqty));
|
|
|
+ oldcanuseqty= (oldcanuseqty.compareTo(BigDecimal.ZERO)==0?canuseqty:oldcanuseqty).subtract(oldsendqty);
|
|
|
}else{
|
|
|
insertSQL.setValue("canuseqty", canuseqty);
|
|
|
}
|
|
|
- olditemid=row.getLong("itemid");
|
|
|
- oldcanuseqty=oldcanuseqty.subtract(oldsendqty);
|
|
|
- oldsendqty=sendqty;
|
|
|
if(row.getLong("itemid")!=olditemid){
|
|
|
oldcanuseqty=BigDecimal.ZERO;
|
|
|
- oldsendqty=BigDecimal.ZERO;
|
|
|
}
|
|
|
+ olditemid=row.getLong("itemid");
|
|
|
+ oldsendqty=sendqty;
|
|
|
+
|
|
|
list.add(insertSQL.getSQL());
|
|
|
}
|
|
|
dbConnect.runSqlUpdate(list);
|