2 コミット 401f2e03d0 ... 2c0b54079a

作者 SHA1 メッセージ 日付
  zthwr 2c0b54079a 出入库删除回写 9 ヶ月 前
  zthwr 3313fefe65 销售发票分摊 9 ヶ月 前

+ 83 - 34
mmpac/ic/srt/client/nc/ui/ic/pub/bill/GeneralButtonManager.java

@@ -865,23 +865,34 @@ public class GeneralButtonManager implements IButtonManager,BillActionListener {
 				if("46".equals(cbilltypecode)) {
 					//实入数量
 					UFDouble ninnum = generalBillItemVO[j].getNinnum();
+					
+					//实入辅数量
+					Object ninassistnumobj= generalBillItemVO[j].getNinassistnum();
+					
 					String sql = "select execnum from mmpac_order_in where 	pk_order_in = '"+cfirstbillbid+"'";
 					Object execnum = (Object) iuap.executeQuery(sql, new ColumnProcessor());
 					
+					String sql2 = "select execnastnum from mmpac_order_in where pk_order_in = '"+cfirstbillbid+"'";
+					Object execnastnum =(Object) iuap.executeQuery(sql, new ColumnProcessor());
+					
 					if(null==execnum) {
 						continue;
 					}
 					
-					
 					UFDouble result  = new UFDouble(execnum.toString()).sub(ninnum);
 					
+					UFDouble fzresult= UFDouble.ZERO_DBL;//已执行辅数量
+					if(null!=execnastnum) {
+						 fzresult= new UFDouble(execnastnum.toString()).sub(new UFDouble(ninassistnumobj.toString()));//已执行辅数量
+					}
+					
 					StringBuffer update = new StringBuffer();
 					update.append(" update mmpac_order_in set");
 					//如果生产总订单成品明细已执行数量已经为0,已执行数量直接给null.而不是0.00 避免显示误解
 					if(result.doubleValue() == 0) {
-						update.append(" execnum = null");
+						update.append(" execnum = null  , execnastnum=null  ");
 					}else {
-						update.append(" execnum = '"+result+"'");
+						update.append(" execnum = '"+result+"', execnastnum='"+fzresult+"'   ");
 					}
 					update.append(" where pk_order_in = '"+cfirstbillbid+"'");
 					iorder.updateExecnum(update.toString());
@@ -890,70 +901,97 @@ public class GeneralButtonManager implements IButtonManager,BillActionListener {
 				if("4D".equals(cbilltypecode)) {
 					//实出数量
 					UFDouble noutnum = generalBillItemVO[j].getNoutnum();
+					
+					//实出辅数量
+					Object noutassistnumobj = generalBillItemVO[j].getNoutassistnum();
+					
 					String sql = "select execnum from mmpac_order_issue where pk_order_issue = '"+cfirstbillbid+"'";
 					Object execnum = (Object) iuap.executeQuery(sql, new ColumnProcessor());
 					
+					
+					String sql2 = "select execnastnum from mmpac_order_issue where pk_order_issue = '"+cfirstbillbid+"'";
+					Object execnastnum = (Object) iuap.executeQuery(sql, new ColumnProcessor());
+					
+					
 					if(null==execnum) {
 						continue;
 					}
 					
 					UFDouble result  = new UFDouble(execnum.toString()).sub(noutnum);
-					StringBuffer update = new StringBuffer();
-					update.append(" update mmpac_order_issue set");
-					//如果生产总订单材料明细已执行数量已经为0,已执行数量直接给null.而不是0.00 避免显示误解
-					if(result.doubleValue() == 0) {
-						update.append(" execnum = null");
-					}else {
-						update.append(" execnum = '"+result+"'");
-					}
-					update.append(" where pk_order_issue = '"+cfirstbillbid+"'");
-					iorder.updateExecnum(update.toString());
-				}
-				//销售出库回写生产总订单材料明细
-				if("4C".equals(cbilltypecode)) {
-					//实出数量
-					UFDouble noutnum = generalBillItemVO[j].getNoutnum();
-					String sql = "select bdef8 from mmpac_order_in where 	pk_order_in = '"+cfirstbillbid+"'";
-					Object bdef8 = (Object) iuap.executeQuery(sql, new ColumnProcessor());
-					
 					
-					if(null==bdef8) {
-						continue;
+					UFDouble fzresult= UFDouble.ZERO_DBL;//已执行辅数量
+					if(null!=execnastnum) {
+						 fzresult= new UFDouble(execnastnum.toString()).sub(new UFDouble(noutassistnumobj.toString()));//已执行辅数量
 					}
 					
-					UFDouble result  = new UFDouble(bdef8.toString()).sub(noutnum);
 					
 					StringBuffer update = new StringBuffer();
-					update.append(" update mmpac_order_in set");
-					//如果生产总订单成品明细已执行数量已经为0,已执行数量直接给null.而不是0.00 避免显示误解
+					update.append(" update mmpac_order_issue set");
+					//如果生产总订单材料明细已执行数量已经为0,已执行数量直接给null.而不是0.00 避免显示误解
 					if(result.doubleValue() == 0) {
-						update.append(" bdef8 = null");
+						update.append(" execnum = null, execnastnum=null ");
 					}else {
-						update.append(" bdef8 = '"+result+"'");
+						update.append(" execnum = '"+result+"', execnastnum='"+fzresult+"'   ");
 					}
-					update.append(" where pk_order_in = '"+cfirstbillbid+"'");
+					update.append(" where pk_order_issue = '"+cfirstbillbid+"'");
 					iorder.updateExecnum(update.toString());
 				}
+				//销售出库回写生产总订单材料明细---销售订单删除再回写
+//				if("4C".equals(cbilltypecode)) {
+//					//实出数量
+//					UFDouble noutnum = generalBillItemVO[j].getNoutnum();
+//					String sql = "select bdef8 from mmpac_order_in where 	pk_order_in = '"+cfirstbillbid+"'";
+//					Object bdef8 = (Object) iuap.executeQuery(sql, new ColumnProcessor());
+//					
+//					
+//					if(null==bdef8) {
+//						continue;
+//					}
+//					
+//					UFDouble result  = new UFDouble(bdef8.toString()).sub(noutnum);
+//					
+//					StringBuffer update = new StringBuffer();
+//					update.append(" update mmpac_order_in set");
+//					//如果生产总订单成品明细已执行数量已经为0,已执行数量直接给null.而不是0.00 避免显示误解
+//					if(result.doubleValue() == 0) {
+//						update.append(" bdef8 = null");
+//					}else {
+//						update.append(" bdef8 = '"+result+"'");
+//					}
+//					update.append(" where pk_order_in = '"+cfirstbillbid+"'");
+//					iorder.updateExecnum(update.toString());
+//				}
 				//其他出库回写生产总订单委外其他出库
 				if("4I".equals(cbilltypecode)) {
 					//实出数量
 					UFDouble noutnum = generalBillItemVO[j].getNoutnum();
+					//实出辅数量
+					Object noutassistnumobj = generalBillItemVO[j].getNoutassistnum();
+					
 					String sql = "select execnum from mmpac_order_otherout where pk_order_otherout = '"+cfirstbillbid+"'";
 					Object execnum = (Object) iuap.executeQuery(sql, new ColumnProcessor());
 					
+					String sql2 = "select execnastnum from mmpac_order_otherout where pk_order_otherout = '"+cfirstbillbid+"'";
+					Object execnastnum = (Object) iuap.executeQuery(sql, new ColumnProcessor());
 					
 					if(null==execnum) {
 						continue;
 					}
 					
-					UFDouble result  = new UFDouble(execnum.toString()).sub(noutnum);
+					UFDouble result  = new UFDouble(execnum.toString()).sub(noutnum);//已执行主数量
+					
+					UFDouble fzresult= UFDouble.ZERO_DBL;//已执行辅数量
+					if(null!=execnastnum) {
+						 fzresult= new UFDouble(execnastnum.toString()).sub(new UFDouble(noutassistnumobj.toString()));//已执行辅数量
+					}
+					
 					StringBuffer update = new StringBuffer();
 					update.append(" update mmpac_order_otherout set");
 					//如果生产总订单委外其他出库已执行数量已经为0,已执行数量直接给null.而不是0.00 避免显示误解
 					if(result.doubleValue() == 0) {
-						update.append(" execnum = null");
+						update.append(" execnum = null , execnastnum=null ");
 					}else {
-						update.append(" execnum = '"+result+"'");
+						update.append(" execnum = '"+result+"' , execnastnum='"+fzresult+"'  ");
 					}
 					update.append(" where pk_order_otherout = '"+cfirstbillbid+"'");
 					iorder.updateExecnum(update.toString());
@@ -963,9 +1001,15 @@ public class GeneralButtonManager implements IButtonManager,BillActionListener {
 				if("4A".equals(cbilltypecode)) {
 					//实入数量
 					UFDouble ninnum = generalBillItemVO[j].getNinnum();
+					//实入辅数量
+					Object ninassistnumobj= generalBillItemVO[j].getNinassistnum();
+
 					String sql = "select execnum from mmpac_order_otherin where pk_order_otherin = '"+cfirstbillbid+"'";
 					Object execnum = (Object) iuap.executeQuery(sql, new ColumnProcessor());
 					
+					String sql2 = "select execnastnum from mmpac_order_otherout where pk_order_otherout = '"+cfirstbillbid+"'";
+					Object execnastnum = (Object) iuap.executeQuery(sql, new ColumnProcessor());
+					
 					
 					if(null==execnum) {
 						continue;
@@ -974,13 +1018,18 @@ public class GeneralButtonManager implements IButtonManager,BillActionListener {
 					
 					UFDouble result  = new UFDouble(execnum.toString()).sub(ninnum);
 					
+					UFDouble fzresult= UFDouble.ZERO_DBL;//已执行辅数量
+					if(null!=execnastnum) {
+						 fzresult= new UFDouble(execnastnum.toString()).sub(new UFDouble(ninassistnumobj.toString()));//已执行辅数量
+					}
+					
 					StringBuffer update = new StringBuffer();
 					update.append(" update mmpac_order_otherin set");
 					//如果生产总订单委外其他入库已执行数量已经为0,已执行数量直接给null.而不是0.00 避免显示误解
 					if(result.doubleValue() == 0) {
-						update.append(" execnum = null");
+						update.append(" execnum = null , execnastnum=null ");
 					}else {
-						update.append(" execnum = '"+result+"'");
+						update.append(" execnum = '"+result+"' , execnastnum='"+fzresult+"'   ");
 					}
 					update.append(" where pk_order_otherin = '"+cfirstbillbid+"'");
 					iorder.updateExecnum(update.toString());

+ 6 - 1
mmpac/so/src/client/nc/ui/so/so002/FtCountDLG.java

@@ -21,6 +21,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.awt.BorderLayout;
+import java.awt.Color;
 import java.awt.Dimension;
 import java.awt.FlowLayout;
 import java.awt.event.ActionEvent;
@@ -207,7 +208,7 @@ public class FtCountDLG extends UIDialog implements BillEditListener {
 			jlcardPanel = new BillCardPanel();
 			jlcardPanel.setName("jlcardPanel");
 			jlcardPanel.loadTemplet("FT99", null,ce.getUser().getPrimaryKey(),ce.getCorporation().getPrimaryKey());
-	//		billListPanel.setTatolRowShow(true);  //合计
+			jlcardPanel.setTatolRowShow(true);  //合计
 		}
 		return this.jlcardPanel;
 	}
@@ -396,6 +397,10 @@ public class FtCountDLG extends UIDialog implements BillEditListener {
 			 this.getBillCardPanel().setBodyValueAt(10*(i+1)+"", rowcount - 1, "row"); 
 			 this.getBillCardPanel().setBodyValueAt(entry.getKey(), rowcount - 1, "fttype");//开票类型
 			 this.getBillCardPanel().setBodyValueAt(entry.getValue(), rowcount - 1, "totalnum");//合计数量
+			 this.getBillCardPanel().getBillModel().setBackground(Color.yellow,i,
+                     this.getBillCardPanel().getBillModel().getItemIndex("row"));
+                     
+			 
 			 i+=1;
 		 }