|
@@ -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.equals(execnum) && num.equals(new UFDouble(0))) {
|
|
|
// continue;
|
|
|
// }
|
|
|
- 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("1001V51000000000002V");//业务流程
|
|
|
+ icheadvo.setCbiztypeid("1001F810000000000015");//业务流程
|
|
|
// String def1 = GetBaseDAOUtil.getJobbasfilDef1("prjcode");
|
|
|
- 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.setPk_cubasdocC(def1);//客户基本档案
|
|
|
icheadvo.setFbillflag(2);
|
|
|
icheadvo.setCoperatoridnow(PubEnv.getPk_user());//设置当前操作人
|
|
|
// icheadvo.setAttributeValue("pk_defdoc1", vectors.get(0).get(2)==null?"":vectors.get(0).get(2).toString());//开票类型
|
|
@@ -498,7 +499,7 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
// icheadvo.setCinventoryid(pk_invmandoc);
|
|
|
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, "成功", "销售出库单"+resvo.getVBillCode()+"新增成功");
|
|
|
+ // MessageDialog.showHintDlg(mainpanel, "成功", "销售出库单"+resvo.getVBillCode()+"新增成功");
|
|
|
+ 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();
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|