|
@@ -311,11 +311,11 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
if(null!=orderinvos && orderinvos.size()>0) {
|
|
|
for(OrderInVO invo:orderinvos) {
|
|
|
UFDouble num = invo.getNum() == null ? new UFDouble(0) : invo.getNum();
|
|
|
- UFDouble execnum = invo.getExecnum() == null ? new UFDouble(0) : invo.getExecnum();
|
|
|
- if(num.sub(execnum).compareTo(UFDouble.ZERO_DBL)==0) {
|
|
|
+ UFDouble bdef8 = invo.getBdef8()== null ? UFDouble.ZERO_DBL :new UFDouble(invo.getBdef8());
|
|
|
+ if(num.sub(bdef8).compareTo(UFDouble.ZERO_DBL)==0) {
|
|
|
continue;
|
|
|
}
|
|
|
- invo.setBdef5(num.sub(execnum).toString());
|
|
|
+ invo.setBdef5(num.sub(bdef8).toString());
|
|
|
invos.add(invo);
|
|
|
}
|
|
|
|
|
@@ -327,14 +327,14 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
|
|
|
OrderInVO invo = (OrderInVO) vo;
|
|
|
UFDouble num = invo.getNum() == null ? new UFDouble(0) : invo.getNum();
|
|
|
- UFDouble execnum = invo.getExecnum() == null ? new UFDouble(0) : invo.getExecnum();
|
|
|
+ UFDouble bdef8 = invo.getBdef8() == null ?UFDouble.ZERO_DBL : new UFDouble(invo.getBdef8());
|
|
|
|
|
|
|
|
|
|
|
|
- if(num.sub(execnum).compareTo(UFDouble.ZERO_DBL)==0) {
|
|
|
+ if(num.sub(bdef8).compareTo(UFDouble.ZERO_DBL)==0) {
|
|
|
continue;
|
|
|
}
|
|
|
- invo.setBdef5(num.sub(execnum).toString());
|
|
|
+ invo.setBdef5(num.sub(bdef8).toString());
|
|
|
invos.add(invo);
|
|
|
}
|
|
|
}
|
|
@@ -397,7 +397,7 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
execsize = execsize + 1;
|
|
|
UFDouble execnum = new UFDouble(vector.get(1).toString());
|
|
|
UFDouble nnum = new UFDouble(vector.get(22).toString());
|
|
|
- UFDouble usednum = vector.get(30) == null?new UFDouble(0):new UFDouble(vector.get(30).toString());
|
|
|
+ UFDouble usednum = vector.get(51) == null?new UFDouble(0):new UFDouble(vector.get(51).toString());
|
|
|
if(execnum.compareTo(nnum.sub(usednum)) > 0) {
|
|
|
errmsg.append("第"+(i+1)+"行本次执行数量超过订单剩余数量!");
|
|
|
}
|
|
@@ -417,7 +417,7 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
String billtype=headvo.getBusitype();
|
|
|
String pk_corp = headvo.getPk_corp();
|
|
|
String pk_order = headvo.getPk_order();
|
|
|
- String prjcode = headvo.getProjectid();
|
|
|
+ String prjcode = headvo.getProjectid();
|
|
|
GeneralBillVO[] aggvos = new GeneralBillVO[1];
|
|
|
GeneralBillVO aggvo = new GeneralBillVO();
|
|
|
GeneralBillHeaderVO icheadvo = new GeneralBillHeaderVO();
|
|
@@ -438,13 +438,14 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
icheadvo.setVnote("来源生产总订单");
|
|
|
icheadvo.setCbilltypecode("4C");
|
|
|
icheadvo.setBassetcard(UFBoolean.FALSE);
|
|
|
-
|
|
|
+ icheadvo.setCbiztypeid("1001F810000000000015");
|
|
|
|
|
|
- String def1 = GetBaseDAOUtil.getJobbasfilDef1(prjcode);
|
|
|
- icheadvo.setCcustomerid(def1);
|
|
|
+ String def1 = GetBaseDAOUtil.getJobbasmngDef1(prjcode);
|
|
|
+ icheadvo.setCcustomerid(getpkcumdoc(def1));
|
|
|
+ icheadvo.setPk_cubasdocC(def1);
|
|
|
icheadvo.setCdptid(headvo.getPlandeptid());
|
|
|
icheadvo.setFreplenishflag(UFBoolean.FALSE);
|
|
|
- icheadvo.setPk_cubasdocC(def1);
|
|
|
+
|
|
|
icheadvo.setFbillflag(2);
|
|
|
icheadvo.setCoperatoridnow(PubEnv.getPk_user());
|
|
|
|
|
@@ -498,7 +499,7 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
|
|
|
itemvo.setCinventorycode(cmaterialcode);
|
|
|
itemvo.setCprojectid(cprojectid);
|
|
|
- itemvo.setCreceieveid(def1);
|
|
|
+ itemvo.setCreceieveid(def1);
|
|
|
itemvo.setCrowno(Integer.toString((k+1)*10));
|
|
|
itemvo.setCsourcebillhid(pk_order);
|
|
|
itemvo.setCsourcebillbid(vector.get(34).toString());
|
|
@@ -518,8 +519,9 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
|
|
|
itemvo.setHsl(Hsl);
|
|
|
|
|
|
+ UFDouble ninassistnum =UFDouble.ZERO_DBL;
|
|
|
if(Hsl != null) {
|
|
|
- UFDouble ninassistnum = new UFDouble(ninnum.div(Hsl).toString(),2);
|
|
|
+ ninassistnum = new UFDouble(ninnum.div(Hsl).toString(),2);
|
|
|
itemvo.setNoutassistnum(new UFDouble(ninassistnum));
|
|
|
itemvo.setNshouldoutassistnum(ninassistnum);
|
|
|
}
|
|
@@ -554,9 +556,10 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
itemvo.setAttributeValue("pk_defdoc12",vector.get(20)==null?null:vector.get(20).toString());
|
|
|
itemvo.setAttributeValue("pk_defdoc13",vector.get(47)==null?null:vector.get(47).toString());
|
|
|
itemvo.setAttributeValue("pk_defdoc14",vector.get(48)==null?null:vector.get(48).toString());
|
|
|
- itemvo.setAttributeValue("pk_defdoc20",vector.get(2)==null?null:vector.get(2).toString());
|
|
|
+ itemvo.setAttributeValue("pk_defdoc20",vector.get(36)==null?null:vector.get(36).toString());
|
|
|
|
|
|
- UFDouble updatenum = new UFDouble(vector.get(30)==null?"0":vector.get(30).toString()).add(new UFDouble(vector.get(1)==null?"0":vector.get(1).toString()));
|
|
|
+ UFDouble updatenum = new UFDouble(vector.get(51)==null?"0":vector.get(51).toString())
|
|
|
+ .add(new UFDouble(vector.get(1)==null?"0":vector.get(1).toString()));
|
|
|
updatemap.put(vector.get(34).toString(), updatenum);
|
|
|
itemvos[k]=itemvo;
|
|
|
k = k + 1;
|
|
@@ -568,8 +571,8 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
GeneralBillVO[] res = isaleout.insertSaleOuts(aggvos);
|
|
|
GeneralBillVO resvo = res[0];
|
|
|
Boolean updateres = iorder.UpdateInExecNum(updatemap);
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ MessageDialog.showHintDlg(mainpanel, "成功", "销售出库单新增成功!");
|
|
|
this.closeCancel();
|
|
|
} catch (Exception e1) {
|
|
|
MessageDialog.showErrorDlg(mainpanel, "错误", e1.getMessage());
|
|
@@ -649,17 +652,33 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ private String getpkcumdoc(String pk_cubasdoc ) throws BusinessException {
|
|
|
+ String sql="select pk_cumandoc from bd_cumandoc where pk_cubasdoc='"+pk_cubasdoc+"' ";
|
|
|
+ IUAPQueryBS iuap=(IUAPQueryBS) NCLocator.getInstance().lookup(IUAPQueryBS.class.getName());
|
|
|
+
|
|
|
+ Object pk_cumandocobj = iuap.executeQuery(sql, new ColumnProcessor());
|
|
|
+ if (pk_cumandocobj == null) {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ return pk_cumandocobj.toString();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
private String getpkrdcl(String rdcode ) throws BusinessException {
|
|
|
String sql="select pk_rdcl from bd_rdcl where rdcode='"+rdcode+"' ";
|
|
|
IUAPQueryBS iuap=(IUAPQueryBS) NCLocator.getInstance().lookup(IUAPQueryBS.class.getName());
|
|
|
|
|
|
- String pk_rdcl = (String) iuap.executeQuery(sql, new ColumnProcessor());
|
|
|
- if (pk_rdcl == null) {
|
|
|
+ Object pk_rdclobj = iuap.executeQuery(sql, new ColumnProcessor());
|
|
|
+ if (pk_rdclobj == null) {
|
|
|
return "";
|
|
|
}
|
|
|
- return pk_rdcl;
|
|
|
+ return pk_rdclobj.toString();
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|