Browse Source

审批态才能生单,执行完的不在生单界面展示,默认执行数量

pancy 1 year ago
parent
commit
56040de6af

+ 5 - 5
mmpac/mmpac/src/client/u8c/ui/mmpac/action/PushMaterialAction.java

@@ -47,11 +47,11 @@ public class PushMaterialAction extends AbstractAction {
 		int selectedRow = ((OrderMainPanel) getMainPanel()).getSelectedRow();
 		HRAggVO s = (HRAggVO) mainMgrPanel.getMainBillCardPanel().getData();
 		if (null != s && s != null){
-//			OrderMainVO headvo = (OrderMainVO)s.getParentVO();
-//			int billstatus = headvo.getBillstatus();
-//			if(billstatus != 1) {
-//				throw new ValidationException("非审批态单据不允许生成材料出库单");
-//			}
+			OrderMainVO headvo = (OrderMainVO)s.getParentVO();
+			int billstatus = headvo.getBillstatus();
+			if(billstatus != 1) {
+				throw new ValidationException("非审批态单据不允许生成材料出库单");
+			}
 			ToMaterialOutDialog tomaterialdlg = new ToMaterialOutDialog(s);
 			tomaterialdlg.show();
 			

+ 5 - 0
mmpac/mmpac/src/client/u8c/ui/mmpac/action/PushOtherInAction.java

@@ -17,6 +17,7 @@ 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.CircularlyAccessibleValueObject;
+import nc.vo.pub.ValidationException;
 import nc.vo.pub.lang.UFBoolean;
 import nc.vo.pub.lang.UFDate;
 import nc.vo.pub.lang.UFDouble;
@@ -46,6 +47,10 @@ public class PushOtherInAction extends AbstractAction{
 		HRAggVO s = (HRAggVO) mainMgrPanel.getMainBillCardPanel().getData();
 		if (null != s && s != null){
 			OrderMainVO headvo = (OrderMainVO) s.getParentVO();
+			int billstatus = headvo.getBillstatus();
+			if(billstatus != 1) {
+				throw new ValidationException("非审批态单据不允许生成其他入库单");
+			}
 			String pk_corp = headvo.getPk_corp();
 			String pk_order = headvo.getPk_order();
 			OrderOtherinVO[] invos = getInVOs(s);

+ 5 - 0
mmpac/mmpac/src/client/u8c/ui/mmpac/action/PushOtherOutAction.java

@@ -17,6 +17,7 @@ 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.CircularlyAccessibleValueObject;
+import nc.vo.pub.ValidationException;
 import nc.vo.pub.lang.UFBoolean;
 import nc.vo.pub.lang.UFDate;
 import nc.vo.pub.lang.UFDouble;
@@ -45,6 +46,10 @@ public class PushOtherOutAction extends AbstractAction{
 		HRAggVO s = (HRAggVO) mainMgrPanel.getMainBillCardPanel().getData();
 		if (null != s && s != null){
 			OrderMainVO headvo = (OrderMainVO) s.getParentVO();
+			int billstatus = headvo.getBillstatus();
+			if(billstatus != 1) {
+				throw new ValidationException("非审批态单据不允许生成其他出库单");
+			}
 			String pk_corp = headvo.getPk_corp();
 			String pk_order = headvo.getPk_order();
 			OrderOtheroutVO[] outvos = getOutVOs(s);

+ 12 - 1
mmpac/mmpac/src/client/u8c/ui/mmpac/action/PushProductAction.java

@@ -9,9 +9,11 @@ import nc.ui.hr.frame.impl.MainBillMgrPanel;
 import nc.vo.hr.tools.pub.HRAggVO;
 import nc.vo.pub.CircularlyAccessibleValueObject;
 import nc.vo.pub.ValidationException;
+import nc.vo.pub.lang.UFDouble;
 import nc.vo.trade.pub.IBillStatus;
 import u8c.ui.mmpac.panel.OrderMainPanel;
 import u8c.vo.OrderInVO;
+import u8c.vo.OrderIssueVO;
 import u8c.vo.OrderMainVO;
 
 public class PushProductAction extends AbstractAction{
@@ -46,7 +48,16 @@ public class PushProductAction extends AbstractAction{
 			CircularlyAccessibleValueObject[] vos = s.getAllChildrenVO();
 			for (int i = 0; i < vos.length; i++) {
 				if(vos[i] instanceof OrderInVO) {
-					listOrderInVO.add((OrderInVO) vos[i]);
+					//本次执行数量不填就默认
+					//执行完的表体在生单界面不展示
+					OrderInVO invo = (OrderInVO) vos[i];
+					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;
+					}
+					invo.setBdef2(num.sub(execnum).toString());
+					listOrderInVO.add(invo);
 				}
 			}
 			//弹框勾选数据

+ 7 - 0
mmpac/mmpac/src/client/u8c/ui/mmpac/action/PushSaleOutAction.java

@@ -4,8 +4,10 @@ import nc.ui.hr.frame.FrameUI;
 import nc.ui.hr.frame.action.AbstractAction;
 import nc.ui.hr.frame.impl.MainBillMgrPanel;
 import nc.vo.hr.tools.pub.HRAggVO;
+import nc.vo.pub.ValidationException;
 import u8c.ui.mmpac.panel.OrderMainPanel;
 import u8c.ui.mmpac.panel.OrderTestUI;
+import u8c.vo.OrderMainVO;
 
 public class PushSaleOutAction extends AbstractAction {
 	OrderTestUI frameUI = null;
@@ -20,6 +22,11 @@ public class PushSaleOutAction extends AbstractAction {
 		MainBillMgrPanel mainMgrPanel = (MainBillMgrPanel) getMainPanel();
 		HRAggVO s = (HRAggVO) mainMgrPanel.getMainBillCardPanel().getData();
 		if (null != s && s != null){
+			OrderMainVO headvo = (OrderMainVO)s.getParentVO();
+			int billstatus = headvo.getBillstatus();
+			if(billstatus != 1) {
+				throw new ValidationException("非审批态单据不允许生成销售出库单");
+			}
 			ToSaleOutDialog saleoutdlg = new ToSaleOutDialog(s);
 			saleoutdlg.show();
 		}

+ 10 - 7
mmpac/mmpac/src/client/u8c/ui/mmpac/action/ToMaterialOutDialog.java

@@ -61,12 +61,6 @@ public class ToMaterialOutDialog extends UIDialog implements ActionListener,Bill
 	IMaterialOutMaintainAPI imaterapi=(IMaterialOutMaintainAPI) NCLocator.getInstance().lookup(IMaterialOutMaintainAPI.class.getName());
 	IOrderTotalInfo iorder = NCLocator.getInstance().lookup(IOrderTotalInfo.class);
 	
-//	public GxCLCDialog() {
-//		super();
-//		initialize();
-//		
-//	}
-	
 	public ToMaterialOutDialog(HRAggVO aggvo) {
 		super();
 		initialize(aggvo);
@@ -99,7 +93,16 @@ public class ToMaterialOutDialog extends UIDialog implements ActionListener,Bill
 		List<OrderIssueVO> issuevos = new ArrayList();
 		for(CircularlyAccessibleValueObject vo : vos) {
 			if(vo instanceof OrderIssueVO) {
-				issuevos.add((OrderIssueVO)vo);
+				//本次执行数量不填就默认
+				//执行完的表体在生单界面不展示
+				OrderIssueVO issuevo = (OrderIssueVO) vo;
+				UFDouble num = issuevo.getNum() == null ? new UFDouble(0) : issuevo.getNum();
+				UFDouble execnum = issuevo.getExecnum() == null ? new UFDouble(0) : issuevo.getExecnum();
+				if(num.equals(execnum) && num.equals(new UFDouble(0))) {
+					continue;
+				}
+				issuevo.setBdef2(num.sub(execnum).toString());
+				issuevos.add(issuevo);
 			}
 		}
 		Object[] objArrays = issuevos.toArray();

+ 10 - 1
mmpac/mmpac/src/client/u8c/ui/mmpac/action/ToSaleOutDialog.java

@@ -152,7 +152,16 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
 		List<OrderInVO> invos = new ArrayList();
 		for(CircularlyAccessibleValueObject vo : vos) {
 			if(vo instanceof OrderInVO) {
-				invos.add((OrderInVO)vo);
+				//本次执行数量不填就默认
+				//执行完的表体在生单界面不展示
+				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;
+				}
+				invo.setBdef2(num.sub(execnum).toString());
+				invos.add(invo);
 			}
 		}
 		OrderInVO[] inArrays = new OrderInVO[invos.size()];