|
@@ -1,8 +1,11 @@
|
|
|
package u8c.ui.mmpac.action;
|
|
|
|
|
|
+import java.awt.BorderLayout;
|
|
|
+import java.awt.Color;
|
|
|
import java.awt.Component;
|
|
|
import java.awt.Container;
|
|
|
import java.awt.Dimension;
|
|
|
+import java.awt.FlowLayout;
|
|
|
import java.awt.Toolkit;
|
|
|
import java.awt.event.ActionEvent;
|
|
|
import java.awt.event.ActionListener;
|
|
@@ -12,12 +15,16 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Vector;
|
|
|
|
|
|
+import javax.swing.BorderFactory;
|
|
|
import javax.swing.JSplitPane;
|
|
|
+import javax.swing.border.BevelBorder;
|
|
|
|
|
|
import nc.bs.framework.common.NCLocator;
|
|
|
import nc.hr.utils.PubEnv;
|
|
|
+import nc.itf.uap.IUAPQueryBS;
|
|
|
import nc.itf.uap.pf.IPFBusiAction;
|
|
|
import nc.itf.uap.pf.IplatFormEntry;
|
|
|
+import nc.jdbc.framework.processor.BeanListProcessor;
|
|
|
import nc.ui.pub.ClientEnvironment;
|
|
|
import nc.ui.pub.beans.MessageDialog;
|
|
|
import nc.ui.pub.beans.UIButton;
|
|
@@ -27,12 +34,14 @@ import nc.ui.pub.beans.UISplitPane;
|
|
|
import nc.ui.pub.bill.BillCardPanel;
|
|
|
import nc.ui.pub.bill.BillEditEvent;
|
|
|
import nc.ui.pub.bill.BillEditListener;
|
|
|
+import nc.ui.querytemplate.QueryConditionDLG;
|
|
|
import nc.vo.bd.invdoc.InvbasdocVO;
|
|
|
import nc.vo.bd.invdoc.InvmandocVO;
|
|
|
import nc.vo.hr.tools.pub.HRAggVO;
|
|
|
import nc.vo.ic.pub.bill.GeneralBillHeaderVO;
|
|
|
import nc.vo.ic.pub.bill.GeneralBillItemVO;
|
|
|
import nc.vo.ic.pub.bill.GeneralBillVO;
|
|
|
+import nc.vo.pub.BusinessException;
|
|
|
import nc.vo.pub.CircularlyAccessibleValueObject;
|
|
|
import nc.vo.pub.VOStatus;
|
|
|
import nc.vo.pub.lang.UFBoolean;
|
|
@@ -40,6 +49,8 @@ import nc.vo.pub.lang.UFDate;
|
|
|
import nc.vo.pub.lang.UFDouble;
|
|
|
import nc.vo.pub.pf.PfUtilWorkFlowVO;
|
|
|
import nc.vo.pub.workflownote.WorkflownoteVO;
|
|
|
+import nc.vo.pubapp.pattern.pub.SqlBuilder;
|
|
|
+import nc.vo.querytemplate.TemplateInfo;
|
|
|
import u8c.bs.servlet.service.GetBaseDAOUtil;
|
|
|
import u8c.itf.mmpac.mmpac.IOrderTotalInfo;
|
|
|
import u8c.pubitf.ic.out.ISaleOutMaintainAPI;
|
|
@@ -51,13 +62,20 @@ import u8c.vo.OrderMainVO;
|
|
|
public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEditListener{
|
|
|
|
|
|
private static final long serialVersionUID = -2605551888165671266L;
|
|
|
- private UISplitPane mainpanel = null;//主面板
|
|
|
+ private int focus=1;
|
|
|
+ private UIPanel ivjUIPanel0 = null;
|
|
|
+ private UIPanel ivjUIPanel2 = null;
|
|
|
+ private UISplitPane mainpanel = null;
|
|
|
private BillCardPanel jlcardPanel = null;//卡面面板
|
|
|
private UIPanel jlbtnpanel = null;//存放按钮的panel
|
|
|
private UIButton saveCardBtn = null ; //保存
|
|
|
private UIButton cancelBtn = null ; //取消
|
|
|
+ private UIButton selectallBtn= null ; //全选按钮
|
|
|
+ private UIButton cancelallBtn= null ; //全消按钮
|
|
|
+ private UIButton queryBtn= null ;//查询按钮
|
|
|
private ClientEnvironment ce = ClientEnvironment.getInstance();
|
|
|
private HRAggVO aggvo;
|
|
|
+ private OrderInVO[] inArrays = null;
|
|
|
ISaleOutMaintainAPI isaleout = NCLocator.getInstance().lookup(ISaleOutMaintainAPI.class);
|
|
|
IOrderTotalInfo iorder = NCLocator.getInstance().lookup(IOrderTotalInfo.class);
|
|
|
IplatFormEntry iIplatFormEntry = NCLocator.getInstance().lookup(IplatFormEntry.class);
|
|
@@ -68,28 +86,89 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
initialize(aggvo);
|
|
|
}
|
|
|
|
|
|
+// private void initialize(HRAggVO aggvo) {
|
|
|
+// Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
|
|
|
+// setName("saleoutdlg");
|
|
|
+// setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
|
|
+// setTitle("生产总订单入库-销售出库");
|
|
|
+// setSize(1000,360);
|
|
|
+// this.setResizable(true);
|
|
|
+// setLocation((dimension.width-550)/2, (dimension.height-300)/2);
|
|
|
+// setContentPane(getMainPanel());
|
|
|
+// addListenerEvent();
|
|
|
+// this.aggvo = aggvo;
|
|
|
+// //展示数据
|
|
|
+// OrderInVO[] inArrays = getInVOs(aggvo);
|
|
|
+// getJlcardPanel().getBillModel().setBodyDataVO(inArrays);
|
|
|
+// }
|
|
|
+
|
|
|
private void initialize(HRAggVO aggvo) {
|
|
|
Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
|
|
|
setName("saleoutdlg");
|
|
|
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
|
|
setTitle("生产总订单入库-销售出库");
|
|
|
- setSize(1000,360);
|
|
|
+// setSize(1000,360);
|
|
|
+ setSize(dimension.width-100,dimension.height-200);
|
|
|
this.setResizable(true);
|
|
|
- setLocation((dimension.width-550)/2, (dimension.height-300)/2);
|
|
|
- setContentPane(getMainPanel());
|
|
|
+ add(getUIPanel0(), BorderLayout.NORTH);
|
|
|
+ add(getUIPanel2(), BorderLayout.CENTER);
|
|
|
+// setLocation((dimension.width-550)/2, (dimension.height-300)/2);
|
|
|
+ setLocation(100/2, 200/2);
|
|
|
+// setContentPane(getMainPanel());
|
|
|
addListenerEvent();
|
|
|
this.aggvo = aggvo;
|
|
|
//展示数据
|
|
|
OrderInVO[] inArrays = getInVOs(aggvo);
|
|
|
getJlcardPanel().getBillModel().setBodyDataVO(inArrays);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
//按钮监听
|
|
|
private void addListenerEvent() {
|
|
|
getSaveCardBtn().addActionListener(this);
|
|
|
getCancelBtn().addActionListener(this);
|
|
|
+ getQueryBtn().addActionListener(this);
|
|
|
+ getSelectallBtn().addActionListener(this);
|
|
|
+ getCancelallBtn().addActionListener(this);
|
|
|
getJlcardPanel().addEditListener(this);
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+ private UIPanel getUIPanel2() {
|
|
|
+ if (ivjUIPanel2 == null) {
|
|
|
+ ivjUIPanel2 = new UIPanel();
|
|
|
+ ivjUIPanel2.setLayout(new BorderLayout());
|
|
|
+ ivjUIPanel2.setPreferredSize(new Dimension(0, 500));
|
|
|
+ // ivjUIPanel2.add(getTablePanel(), BorderLayout.CENTER);
|
|
|
+ ivjUIPanel2.add(getMainPanel(), BorderLayout.CENTER);// ZTH
|
|
|
+ }
|
|
|
+ return this.ivjUIPanel2;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private UIPanel getUIPanel0() {
|
|
|
+ if (ivjUIPanel0 == null) {
|
|
|
+ try {
|
|
|
+ ivjUIPanel0 = new UIPanel();
|
|
|
+ ivjUIPanel0.setLayout(new FlowLayout(FlowLayout.LEFT));
|
|
|
+ ivjUIPanel0.add(getQueryBtn());
|
|
|
+ ivjUIPanel0.add(getSelectallBtn());
|
|
|
+ ivjUIPanel0.add(getCancelallBtn());
|
|
|
+ } catch (Throwable ivjExc) {
|
|
|
+ handleException(ivjExc);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return this.ivjUIPanel0;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private void handleException(Throwable e) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
private UISplitPane getMainPanel() {
|
|
|
if(mainpanel==null){
|
|
@@ -97,7 +176,7 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
mainpanel.setOrientation(JSplitPane.VERTICAL_SPLIT);
|
|
|
mainpanel.setTopComponent(getJlcardPanel());
|
|
|
mainpanel.setBottomComponent(getJlbtnpanel());
|
|
|
- mainpanel.setDividerLocation(280);//分割位置
|
|
|
+ mainpanel.setDividerLocation(750);//分割位置
|
|
|
mainpanel.setOneTouchExpandable(true);
|
|
|
mainpanel.setDividerSize(8);
|
|
|
}
|
|
@@ -134,13 +213,55 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
}
|
|
|
return saveCardBtn;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ private UIButton getQueryBtn() {
|
|
|
+ if (queryBtn == null) {
|
|
|
+ queryBtn = new UIButton();
|
|
|
+ queryBtn.setName("queryBtn");
|
|
|
+ queryBtn.setText(" 筛选 ");
|
|
|
+ Color clrBack = new Color(0XC4C4C4);
|
|
|
+ queryBtn.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED,
|
|
|
+ Color.white,clrBack, new Color(0X5F5F5F), clrBack));
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ return this.queryBtn;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private UIButton getSelectallBtn() {
|
|
|
+ if (selectallBtn == null) {
|
|
|
+ selectallBtn = new UIButton();
|
|
|
+ selectallBtn.setName("selectallBtn");
|
|
|
+ selectallBtn.setText(" 全选 ");
|
|
|
+ Color clrBack = new Color(0XC4C4C4);
|
|
|
+ selectallBtn.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED,
|
|
|
+ Color.white,clrBack, new Color(0X5F5F5F), clrBack));
|
|
|
+ }
|
|
|
+ return this.selectallBtn;
|
|
|
+ }
|
|
|
+
|
|
|
+ private UIButton getCancelallBtn() {
|
|
|
+ if (cancelallBtn == null) {
|
|
|
+ cancelallBtn = new UIButton();
|
|
|
+ cancelallBtn.setName("cancelallBtn");
|
|
|
+ cancelallBtn.setText(" 全消 ");
|
|
|
+ Color clrBack = new Color(0XC4C4C4);
|
|
|
+ cancelallBtn.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED,
|
|
|
+ Color.white,clrBack, new Color(0X5F5F5F), clrBack));
|
|
|
+ }
|
|
|
+ return this.cancelallBtn;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
private BillCardPanel getJlcardPanel() {
|
|
|
if(jlcardPanel==null){
|
|
|
jlcardPanel=new BillCardPanel();
|
|
|
jlcardPanel.setName("jlcardPanel");
|
|
|
//根据单据模板编码加载模板
|
|
|
- jlcardPanel.loadTemplet("A224C",null,ce.getUser().getPrimaryKey(),ce.getCorporation().getPrimaryKey());
|
|
|
+// jlcardPanel.loadTemplet("A224C",null,ce.getUser().getPrimaryKey(),ce.getCorporation().getPrimaryKey());
|
|
|
+ jlcardPanel.loadTemplet("QS412",null,ce.getUser().getPrimaryKey(),ce.getCorporation().getPrimaryKey());
|
|
|
}
|
|
|
|
|
|
return jlcardPanel;
|
|
@@ -149,26 +270,80 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
//根据传入的aggvo获取invo数组
|
|
|
private OrderInVO[] getInVOs(HRAggVO aggvo) {
|
|
|
CircularlyAccessibleValueObject[] vos = aggvo.getAllChildrenVO();
|
|
|
- List<OrderInVO> invos = new ArrayList();
|
|
|
- for(CircularlyAccessibleValueObject vo : vos) {
|
|
|
+ //查询最新的数据
|
|
|
+ OrderMainVO headvo=(OrderMainVO) aggvo.getParentVO();
|
|
|
+ String pk_order=headvo.getPk_order();//主表主键
|
|
|
+ IUAPQueryBS iuap=NCLocator.getInstance().lookup(IUAPQueryBS.class);
|
|
|
+ String sql="select * from mmpac_order_in where pk_order='"+pk_order+"' and isnull(dr,0)=0 ";
|
|
|
+ List<OrderInVO> orderinvos=null;
|
|
|
+ try {
|
|
|
+ orderinvos=(List<OrderInVO>) iuap.executeQuery(sql, new BeanListProcessor(OrderInVO.class));
|
|
|
+ } catch (BusinessException e) {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ List<OrderInVO> invos = new ArrayList<OrderInVO>();
|
|
|
+// for(CircularlyAccessibleValueObject vo : vos) {
|
|
|
+// if(vo instanceof OrderInVO) {
|
|
|
+// //本次执行数量不填就默认
|
|
|
+// //执行完的表体在生单界面不展示
|
|
|
+// OrderInVO invo = (OrderInVO) vo;
|
|
|
+// UFDouble num = invo.getNum() == null ? new UFDouble(0) : invo.getNum();
|
|
|
+// UFDouble execnum = invo.getExecnum() == null ? new UFDouble(0) : invo.getExecnum();
|
|
|
+//// if(num.equals(execnum) && num.equals(new UFDouble(0))) {
|
|
|
+//// continue;
|
|
|
+//// }
|
|
|
+// if(num.sub(execnum).compareTo(UFDouble.ZERO_DBL)==0) {
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+// invo.setBdef5(num.sub(execnum).toString());
|
|
|
+// invos.add(invo);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// OrderInVO[] inArrays = new OrderInVO[invos.size()];
|
|
|
+// for(int i = 0;i < invos.size();i++) {
|
|
|
+// inArrays[i] = invos.get(i);
|
|
|
+// }
|
|
|
+
|
|
|
+ List<OrderInVO> issuevos = new ArrayList<OrderInVO>();
|
|
|
+ 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) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ invo.setBdef5(num.sub(execnum).toString());
|
|
|
+ invos.add(invo);
|
|
|
+ }
|
|
|
+
|
|
|
+ }else {
|
|
|
+
|
|
|
+ for(CircularlyAccessibleValueObject vo : vos) {
|
|
|
if(vo instanceof OrderInVO) {
|
|
|
//本次执行数量不填就默认
|
|
|
//执行完的表体在生单界面不展示
|
|
|
OrderInVO invo = (OrderInVO) vo;
|
|
|
UFDouble num = invo.getNum() == null ? new UFDouble(0) : invo.getNum();
|
|
|
UFDouble execnum = invo.getExecnum() == null ? new UFDouble(0) : invo.getExecnum();
|
|
|
- if(num.equals(execnum) && num.equals(new UFDouble(0))) {
|
|
|
+// if(num.equals(execnum) && num.equals(new UFDouble(0))) {
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+ if(num.sub(execnum).compareTo(UFDouble.ZERO_DBL)==0) {
|
|
|
continue;
|
|
|
}
|
|
|
- invo.setBdef2(num.sub(execnum).toString());
|
|
|
+ invo.setBdef5(num.sub(execnum).toString());
|
|
|
invos.add(invo);
|
|
|
}
|
|
|
}
|
|
|
- OrderInVO[] inArrays = new OrderInVO[invos.size()];
|
|
|
- for(int i = 0;i < invos.size();i++) {
|
|
|
- inArrays[i] = invos.get(i);
|
|
|
- }
|
|
|
- return inArrays;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ OrderInVO [] issueArrays =invos.toArray(new OrderInVO[0]);
|
|
|
+
|
|
|
+
|
|
|
+ return issueArrays;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -182,6 +357,25 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 全选与反选,flag为true时,全选操作,flag为false时,进行反选操作
|
|
|
+ */
|
|
|
+ private void onselectall(boolean flag) {
|
|
|
+ switch (focus) {
|
|
|
+ case 1:
|
|
|
+ int jfRowCount = getJlcardPanel().getRowCount();
|
|
|
+ if (jfRowCount > 0) {
|
|
|
+ for (int row = 0; row < jfRowCount; row++) {
|
|
|
+ getJlcardPanel().getBillModel().setValueAt(flag, row, "bdef4");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
@@ -219,8 +413,11 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
return;
|
|
|
}
|
|
|
OrderMainVO headvo = (OrderMainVO) this.aggvo.getParentVO();
|
|
|
+ //业务类型
|
|
|
+ String billtype=headvo.getBusitype();
|
|
|
String pk_corp = headvo.getPk_corp();
|
|
|
String pk_order = headvo.getPk_order();
|
|
|
+ String prjcode = headvo.getProjectid();//项目主键
|
|
|
GeneralBillVO[] aggvos = new GeneralBillVO[1];
|
|
|
GeneralBillVO aggvo = new GeneralBillVO();
|
|
|
GeneralBillHeaderVO icheadvo = new GeneralBillHeaderVO();
|
|
@@ -228,7 +425,12 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
icheadvo.setPk_calbody(GetBaseDAOUtil.getcalpk(pk_corp));
|
|
|
icheadvo.setDbilldate(PubEnv.getServerDate());
|
|
|
icheadvo.setCoperatorid(PubEnv.getPk_user());
|
|
|
- icheadvo.setCwarehouseid("1001V5100000000003A1");//仓库必填
|
|
|
+ //仓库ID
|
|
|
+ if("工装".equals(billtype)) {
|
|
|
+ icheadvo.setCwarehouseid("1001V51000000000039Z");//仓库必填
|
|
|
+ }else if("家装".equals(billtype)) {
|
|
|
+ icheadvo.setCwarehouseid("1001V5100000000003A0");//仓库必填
|
|
|
+ }
|
|
|
icheadvo.setBoutretflag(UFBoolean.FALSE);//是否退回
|
|
|
icheadvo.setBsalecooppur(UFBoolean.FALSE); // 销售出是否已协同生成采购入
|
|
|
icheadvo.setVnote("来源生产总订单");//备注
|
|
@@ -241,6 +443,7 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
icheadvo.setPk_cubasdocC("0001V510000000000674");//客户基本档案
|
|
|
icheadvo.setFbillflag(2);
|
|
|
icheadvo.setCoperatoridnow(PubEnv.getPk_user());//设置当前操作人
|
|
|
+ icheadvo.setAttributeValue("pk_defdoc1", vectors.get(0).get(2)==null?"":vectors.get(0).get(2).toString());//开票类型
|
|
|
aggvo.setParentVO(icheadvo);
|
|
|
GeneralBillItemVO[] itemvos = new GeneralBillItemVO[execsize];
|
|
|
Map<String, UFDouble> updatemap = new HashMap<>();
|
|
@@ -248,7 +451,7 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
int k = 0;
|
|
|
for(int j = 0; j < vectors.size(); j++) {
|
|
|
Vector<Object> vector = (Vector<Object>)vectors.get(j);
|
|
|
- //自定义项20为勾选按钮 :勾选为Y 没有勾选是null
|
|
|
+ //自定义项4为勾选按钮 :勾选为Y 没有勾选是null
|
|
|
if(null!=vector.get(0) && "Y".equals(vector.get(0).toString())){
|
|
|
GeneralBillItemVO itemvo = new GeneralBillItemVO();
|
|
|
String cmaterialcode = vector.get(8).toString();
|
|
@@ -260,14 +463,15 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
InvbasdocVO invbasvo = GetBaseDAOUtil.getInvVO(cmaterialcode);
|
|
|
pk_invbasdoc = invbasvo.getPrimaryKey();
|
|
|
}
|
|
|
- String prjcode = vector.get(3).toString();
|
|
|
- String cprojectid = "";
|
|
|
- if(prjcode.startsWith("1001")) {
|
|
|
- cprojectid = prjcode;
|
|
|
- }
|
|
|
- else {
|
|
|
- cprojectid = GetBaseDAOUtil.getprojectid(prjcode);
|
|
|
- }
|
|
|
+// String prjcode = vector.get(3).toString();
|
|
|
+// String cprojectid = "";
|
|
|
+// if(prjcode.startsWith("1001")) {
|
|
|
+// cprojectid = prjcode;
|
|
|
+// }
|
|
|
+// else {
|
|
|
+// cprojectid = GetBaseDAOUtil.getprojectid(prjcode);
|
|
|
+// }
|
|
|
+ String cprojectid=prjcode;
|
|
|
InvmandocVO invmanvo = GetBaseDAOUtil.getInvmanVO(pk_invbasdoc);
|
|
|
String pk_invmandoc = invmanvo.getPrimaryKey();
|
|
|
itemvo.setBbarcodeclose(UFBoolean.FALSE);
|
|
@@ -278,9 +482,14 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
itemvo.setBtransasset(UFBoolean.FALSE);
|
|
|
itemvo.setBzgflag(UFBoolean.FALSE);
|
|
|
itemvo.setCbodybilltypecode("4C");
|
|
|
- itemvo.setCbodywarehouseid("1001V5100000000003A1");
|
|
|
+ // itemvo.setCbodywarehouseid("1001V5100000000003A1");
|
|
|
+ if("工装".equals(billtype)) {
|
|
|
+ itemvo.setCbodywarehouseid("1001V51000000000039Z");//仓库必填
|
|
|
+ }else if("家装".equals(billtype)) {
|
|
|
+ itemvo.setCbodywarehouseid("1001V5100000000003A0");//仓库必填
|
|
|
+ }
|
|
|
itemvo.setCfirstbillhid(pk_order);
|
|
|
- itemvo.setCfirstbillbid(vector.get(51).toString());
|
|
|
+ itemvo.setCfirstbillbid(vector.get(34).toString());
|
|
|
// itemvo.setCfirsttype("55A2");
|
|
|
itemvo.setCinvbasid(pk_invbasdoc);
|
|
|
itemvo.setCinventoryid(pk_invmandoc);
|
|
@@ -290,7 +499,7 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
itemvo.setCreceieveid("0001V510000000000AJH");//收货单位
|
|
|
itemvo.setCrowno(Integer.toString((k+1)*10));
|
|
|
itemvo.setCsourcebillhid(pk_order);
|
|
|
- itemvo.setCsourcebillbid(vector.get(51).toString());
|
|
|
+ itemvo.setCsourcebillbid(vector.get(34).toString());
|
|
|
// itemvo.setCsourcetype("55A2");
|
|
|
itemvo.setVsourcerowno("10");
|
|
|
itemvo.setDbizdate(PubEnv.getServerDate());
|
|
@@ -301,15 +510,15 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
itemvo.setIsok(UFBoolean.FALSE);
|
|
|
itemvo.setNbarcodenum(new UFDouble(0));
|
|
|
itemvo.setNoutnum(new UFDouble(vector.get(1)==null?"0":vector.get(1).toString()));
|
|
|
- itemvo.setNquotentprice(new UFDouble(vector.get(27)==null?"0":vector.get(27).toString()));//原币无税单价
|
|
|
- itemvo.setNquotentmny(itemvo.getNoutnum().multiply(itemvo.getNquotentprice()));//原币无税金额
|
|
|
- itemvo.setAttributeValue("nquoteprice", new UFDouble(vector.get(23)==null?"0":vector.get(23).toString()));//报价含税单价
|
|
|
- itemvo.setAttributeValue("nquotemny", itemvo.getNoutnum().multiply(new UFDouble(vector.get(23)==null?"0":vector.get(23).toString())));//报价含税金额
|
|
|
- itemvo.setNsaleprice(new UFDouble(vector.get(27)==null?"0":vector.get(27).toString()));//销售价格
|
|
|
- itemvo.setNsalemny(itemvo.getNoutnum().multiply(new UFDouble(vector.get(27)==null?"0":vector.get(27).toString())));//销售金额
|
|
|
+// itemvo.setNquotentprice(new UFDouble(vector.get(27)==null?"0":vector.get(27).toString()));//原币无税单价
|
|
|
+// itemvo.setNquotentmny(itemvo.getNoutnum().multiply(itemvo.getNquotentprice()));//原币无税金额
|
|
|
+// itemvo.setAttributeValue("nquoteprice", new UFDouble(vector.get(23)==null?"0":vector.get(23).toString()));//报价含税单价
|
|
|
+// itemvo.setAttributeValue("nquotemny", itemvo.getNoutnum().multiply(new UFDouble(vector.get(23)==null?"0":vector.get(23).toString())));//报价含税金额
|
|
|
+// itemvo.setNsaleprice(new UFDouble(vector.get(27)==null?"0":vector.get(27).toString()));//销售价格
|
|
|
+// itemvo.setNsalemny(itemvo.getNoutnum().multiply(new UFDouble(vector.get(27)==null?"0":vector.get(27).toString())));//销售金额
|
|
|
itemvo.setNshouldoutnum(new UFDouble(vector.get(1)==null?"0":vector.get(1).toString()));
|
|
|
- itemvo.setNtaxprice(new UFDouble(vector.get(23)==null?"0":vector.get(23).toString()));
|
|
|
- itemvo.setNtaxmny(itemvo.getNoutnum().multiply(new UFDouble(vector.get(23)==null?"0":vector.get(23).toString())));
|
|
|
+// itemvo.setNtaxprice(new UFDouble(vector.get(23)==null?"0":vector.get(23).toString()));
|
|
|
+// itemvo.setNtaxmny(itemvo.getNoutnum().multiply(new UFDouble(vector.get(23)==null?"0":vector.get(23).toString())));
|
|
|
|
|
|
itemvo.setPk_bodycalbody(GetBaseDAOUtil.getcalpk(pk_corp));
|
|
|
itemvo.setPk_calbody(GetBaseDAOUtil.getcalpk(pk_corp));
|
|
@@ -327,9 +536,23 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
// itemvo.setHsl(new UFDouble(1));//换算率
|
|
|
// itemvo.setCastunitid(GetBaseDAOUtil.getMeasid(vector.get(21).toString()));//辅计量单位
|
|
|
itemvo.setVsourcebillcode(headvo.getVbillno());
|
|
|
+ itemvo.setAttributeValue("pk_defdoc1", vector.get(37)==null?null:vector.get(37).toString());//楼号楼层
|
|
|
+ itemvo.setAttributeValue("pk_defdoc2", vector.get(38)==null?null:vector.get(38).toString());//樘数(数量)
|
|
|
+ itemvo.setAttributeValue("pk_defdoc3", vector.get(39)==null?null:vector.get(39).toString());//框统计
|
|
|
+ itemvo.setAttributeValue("pk_defdoc4", vector.get(40)==null?null:vector.get(40).toString());//扇统计
|
|
|
+ itemvo.setAttributeValue("pk_defdoc5", vector.get(41)==null?null:vector.get(41).toString());//半成品分类
|
|
|
+ itemvo.setAttributeValue("pk_defdoc6", vector.get(42)==null?null:vector.get(42).toString());//面积
|
|
|
+ itemvo.setAttributeValue("pk_defdoc7", vector.get(43)==null?null:vector.get(43).toString());//切割长度
|
|
|
+ itemvo.setAttributeValue("pk_defdoc8", vector.get(44)==null?null:vector.get(44).toString());//切割角度左下
|
|
|
+ itemvo.setAttributeValue("pk_defdoc9", vector.get(45)==null?null:vector.get(45).toString());//切割角度右上
|
|
|
+ itemvo.setAttributeValue("pk_defdoc10",vector.get(46)==null?null:vector.get(46).toString());//备注
|
|
|
+ itemvo.setAttributeValue("pk_defdoc11",vector.get(19)==null?null:vector.get(19).toString());//宽度
|
|
|
+ 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());//玻璃编号
|
|
|
//回写数量
|
|
|
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()));
|
|
|
- updatemap.put(vector.get(51).toString(), updatenum);
|
|
|
+ updatemap.put(vector.get(34).toString(), updatenum);
|
|
|
itemvos[k]=itemvo;
|
|
|
k = k + 1;
|
|
|
}
|
|
@@ -341,7 +564,8 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
GeneralBillVO resvo = res[0];
|
|
|
Boolean updateres = iorder.UpdateInExecNum(updatemap);
|
|
|
|
|
|
- MessageDialog.showHintDlg(mainpanel, "成功", "销售出库单"+resvo.getVBillCode()+"新增成功");
|
|
|
+ // MessageDialog.showHintDlg(mainpanel, "成功", "销售出库单"+resvo.getVBillCode()+"新增成功");
|
|
|
+ this.closeCancel();
|
|
|
} catch (Exception e1) {
|
|
|
MessageDialog.showErrorDlg(mainpanel, "错误", e1.getMessage());
|
|
|
return;
|
|
@@ -353,6 +577,70 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
|
|
|
this.closeCancel();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ // 全选
|
|
|
+ if (e.getSource() == getSelectallBtn()) {
|
|
|
+ onselectall(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 全消
|
|
|
+ if (e.getSource() == getCancelallBtn()) {
|
|
|
+ onselectall(false);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // 筛选
|
|
|
+ if (e.getSource() == getQueryBtn()) {
|
|
|
+ TemplateInfo ti = new TemplateInfo();
|
|
|
+ ti.setTemplateId(null);
|
|
|
+ ti.setPk_Org(ce.getCorporation().getPrimaryKey());
|
|
|
+ ti.setUserid(ce.getUser().getPrimaryKey());
|
|
|
+ ti.setCurrentCorpPk(ce.getCorporation().getPrimaryKey());
|
|
|
+ // 功能节点默人模板分配后查询SELECT * from pub_systemplate order by ts desc
|
|
|
+ ti.setFunNode("40H204");
|
|
|
+ ti.setNodekey("qt");
|
|
|
+ QueryConditionDLG d = new QueryConditionDLG(this, ti, "销售出库明细");
|
|
|
+ Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
|
|
|
+ d.setSize(dimension.width - 1000, dimension.height - 650);
|
|
|
+ d.setLocation(500, 300);
|
|
|
+ if (d.showModal() != UIDialog.ID_OK) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ String dlgsql = d.getWhereSQL();
|
|
|
+ if (!(null != dlgsql && !"".equals(dlgsql))) {
|
|
|
+ getJlcardPanel().getBillModel().setBodyDataVO(inArrays);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String quresql = "select * from mmpac_order_in where " + dlgsql + " and ";
|
|
|
+ IUAPQueryBS iuap = (IUAPQueryBS) NCLocator.getInstance().lookup(IUAPQueryBS.class.getName());
|
|
|
+
|
|
|
+ try {
|
|
|
+ List<String> pks = new ArrayList<String>();
|
|
|
+ if (null != inArrays && inArrays.length > 0) {
|
|
|
+ for (OrderInVO vo : inArrays) {
|
|
|
+ String pk_order_in = vo.getPk_order_in();
|
|
|
+ pks.add(pk_order_in);
|
|
|
+ }
|
|
|
+ SqlBuilder sqlbuild = new SqlBuilder();
|
|
|
+ sqlbuild.append(quresql);
|
|
|
+ sqlbuild.append("pk_order_issue", pks.toArray(new String[0]));
|
|
|
+ List<OrderInVO> lisorderinvos = (List<OrderInVO>) iuap.executeQuery(sqlbuild.toString(),
|
|
|
+ new BeanListProcessor(OrderInVO.class));
|
|
|
+ OrderInVO[] invos = lisorderinvos.toArray(new OrderInVO[0]);
|
|
|
+ getJlcardPanel().getBillModel().setBodyDataVO(invos);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ getJlcardPanel().getBillModel().setBodyDataVO(null);
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (BusinessException e1) {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e1.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|