Browse Source

代码提交

yaoyu 1 năm trước cách đây
mục cha
commit
5bf36fbeff

BIN
pu/META-INF/hutool-all-5.3.0.jar


+ 92 - 218
pu/pu/src/client/nc/pub/filesystem/newui/ThOCRAction.java

@@ -62,12 +62,6 @@ public class ThOCRAction extends AbstractNCAction{
 		String billmaker = InvocationInfoProxy.getInstance().getUserId();
 		IThOcrService  ocrservice=(IThOcrService) NCLocator.getInstance().lookup(IThOcrService.class.getName());
 		
-//		IInvoiceOCRMaintain iInvoiceOCRMaintain = (IInvoiceOCRMaintain) NCLocator.getInstance().lookup(IInvoiceOCRMaintain.class.getName());
-		
-//		String filepath =  RuntimeEnv.getInstance().getNCHome()
-//			      +File.separator +"uploadfile" + File.separator+ vdef17; // 文件保存的路径
-//		List<String> filewjlis=getFileNames(filepath);
-		
 		List<String> filewjlis=ocrservice.getInvoiceInfo(vdef17);//获取"+vdef17+"文件夹下所有发票名
 		
 		 if(null==filewjlis||filewjlis.size()==0){
@@ -82,38 +76,25 @@ public class ThOCRAction extends AbstractNCAction{
 		try {
 			 token=ocrservice.getToken(billmaker);
 		} catch (Exception e) {
-	//		Logger.error(e.getMessage(), e);
 			MessageDialog.showErrorDlg(parentpanel, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/
 					,"获取token:\n"+e.getMessage());
 			return;
-//		} catch (IOException e) {
-//			MessageDialog.showErrorDlg(parentpanel, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/
-//					,"获取token:\n"+e.getMessage());
-//			return;
-//		} catch (BusinessException e) {
-//			MessageDialog.showErrorDlg(parentpanel, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/
-//					,"获取token:\n"+e.getMessage());
-//			return;
 		}
-		
-//		MessageDialog.showHintDlg(parentpanel, "提示","token:"+token);
+
 		StringBuffer sb=new StringBuffer();
 		StringBuffer sb2=new StringBuffer();
-		StringBuffer sb3=new StringBuffer();
 		for(int i=0;i<filewjlis.size();i++){
 			NCFileVO oldvo = (NCFileVO) parentpanel.getfiletablemodel()
 					.getVO(i);
 			NCFileVO newvo = oldvo.clone();
 			//已识别的发票不需要再次查询
 			String filedesc = newvo.getFiledesc();
-			if(filedesc != null && "OCR已识别".equals(filedesc)) {
+			if(filedesc != null) {
 				continue;
 			}
-		//	File file=new File(filepath+File.separator+filewjlis.get(i));
 			//发票上传
 			String idjson="";
 			try {
-//				idjson=ocrservice.uploadInvoice(upurl,token, file);
 				idjson=ocrservice.uploadInvoice(token, vdef17,newvo.getName());
 			} catch (Exception e) {
 				MessageDialog.showErrorDlg(parentpanel, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/
@@ -131,7 +112,6 @@ public class ThOCRAction extends AbstractNCAction{
 				String ocrinvoicejson=ocrservice.ocrIdentification(token,idjson);
 				sb2.append(ocrinvoicejson).append("\n");
 				 //识别数据保存数据库 add by pcy
-//				JSONObject json =iInvoiceOCRMaintain.startInvoiceOCR(file);
 				json = JSONObject.parseObject(ocrinvoicejson);
 				checkresult = checkJson(json);
 				if(checkresult != null){
@@ -149,10 +129,10 @@ public class ThOCRAction extends AbstractNCAction{
 			JSONObject data = json.getJSONObject("data");
 			JSONArray infos = data.getJSONArray("infos");
 			for(int j = 0;j < infos.size();j++){
+				String message = "OCR已识别";//发票识别标识
 				JSONObject info = infos.getJSONObject(j).getJSONObject("info");
 				String ret = infos.getJSONObject(j).getString("ret");
 				String is_valid = infos.getJSONObject(j).getString("is_valid");
-//				String name = filewjlis.get(i);
 				String name =newvo.getName();
 				String memo = info.getString("number");//发票号
 				String code = info.getString("fid");
@@ -165,153 +145,21 @@ public class ThOCRAction extends AbstractNCAction{
 				if(memo == null || "".equals(memo)) {
 					memo = "0";
 				}
-				if(!"0".equals(ret)) {
-					String message = infos.getJSONObject(j).getString("message");
-					MessageDialog.showErrorDlg(parentpanel, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/
-							,"ocr返回数据校验:\n"+"发票:"+name+":"+message);
-					return;
+				if(!"0".equals(ret)) {					
+					message = infos.getJSONObject(j).getString("message");					
 				}
-				String ext = info.getString("ext");
-				JSONObject extobj = JSONObject.parseObject(ext);
-				String trate = extobj.getString("trate");//税率
-				JSONArray flist = info.getJSONArray("flist");
-				JSONObject comm_info = info.getJSONObject("comm_info");
-				JSONObject pro = comm_info.getJSONObject("pro");
-				String date = pro.getString("date");//发票日期
-				String type = pro.getString("type");//发票类型
-				String cname = pro.getString("cname");//发票类型名称
-				//String kind = pro.getString("kind");//开票内容
-				String kind = extobj.getString("content");
-				JSONObject price = comm_info.getJSONObject("price");
 				//发票识别之后进行发票查验
 				//是否需要查验 0不需要 1需要
-				if("1".equals(is_valid)) {
+				if("OCR已识别".equals(message) && "1".equals(is_valid)) {
 					try {
 						ocrservice.InvoiceCheck(token,fid);
 					} catch (Exception e) {
-						MessageDialog.showErrorDlg(parentpanel, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/
-								,"发票查验:\n"+"发票:"+name+":"+e.getMessage());
-						return;
+						message = e.getMessage();
 					}
 				}
 				
-				String amount = "";
-				String total = price.getString("total");//价税合计
-				String dtax = price.getString("dtax");//可抵扣税额
-				String ttax = "";
-				
-				//专票带税额,不是专票无税金额=价税合计
-//				if(type.equals("1")||type.equals("28")||type.equals("32")){
-//					amount = price.getString("amount");//无税金额
-//					total = price.getString("total");//价税合计
-//					dtax = price.getString("dtax");//可抵扣税额
-//				}
-//				else{
-//					amount = price.getString("total");//无税金额
-//					total = amount;//价税合计
-//					dtax = "0";//可抵扣税额
-//					trate = "0";//非专票税率也为0
-//				}
-				
-				//如有可抵扣税额,无税金额等于无税金额,税额等于可抵扣税额,税率等于税率
-				//如没有可抵扣税额,无税金额等于无税金额+税额,税额等于0,税率等于0
-				if("0".equals(dtax)) {
-					//无税金额+税额 = 价税合计
-					amount = total;
-					ttax = "0";//税额
-					trate = "0";//税率
-				}else {
-					amount = price.getString("amount");//无税金额
-					ttax = extobj.getString("ttax");//税额
-				}
-				JSONObject buyer = comm_info.getJSONObject("buyer");
-				String mnecode = buyer.getString("tcode");//购买方纳税人识别号
-				String name2 = buyer.getString("company");//购买方公司名称
-				JSONObject payer = comm_info.getJSONObject("payer");
-				String name3 = payer.getString("tcode");//销售方纳税人识别号
-				String name4 = payer.getString("company");//购买方公司名称
-				
-				IDefdocService idefservice = NCLocator.getInstance().lookup(IDefdocService.class);
-				
-//				DefdocVO[] updatevos=QryDefdocvoInfo(code);
-//				if(updatevos.length>0){
-//					//自定义档案存在这个编码,走修改
-//					DefdocVO defvo =updatevos[0];
-//					//赋值
-//					defvo.setAttributeValue("name", memo);
-//					defvo.setAttributeValue("memo", name);
-//					defvo.setAttributeValue("mnecode", mnecode);
-//					defvo.setAttributeValue("name2", name2);
-//					defvo.setAttributeValue("name3", name3);
-//					defvo.setAttributeValue("name4", name4);
-//					defvo.setAttributeValue("name5", fid);
-//					defvo.setAttributeValue("name6", vdef17);
-//					defvo.setAttributeValue("shortname", amount);
-//					defvo.setAttributeValue("shortname2", total);
-//					defvo.setAttributeValue("shortname3", ttax);
-//					defvo.setAttributeValue("pid", date);
-//					defvo.setAttributeValue("shortname5", cname);
-//					defvo.setAttributeValue("shortname6", trate);
-//					defvo.setAttributeValue("enablestate", 2);
-//					defvo.setAttributeValue("innercode", "0");
-//					defvo.setAttributeValue("shortname4", kind);
-//					defvo.setAttributeValue("modifier", codenumber);
-//					
-//					try {
-//						idefservice.updateDefdocs(pk_group,updatevos);
-//					} catch (BusinessException e1) {
-//						MessageDialog.showErrorDlg(parentpanel, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/
-//								,"修改自定义档案数据:\n"+e1.getMessage());
-//						return;
-//					}
-//				}else{
-					DefdocVO[] vos = new DefdocVO[1];
-					DefdocVO defvo = new DefdocVO();
-					//赋值
-					defvo.setAttributeValue("code", code);
-					defvo.setAttributeValue("name", memo);
-					defvo.setAttributeValue("memo", name );
-					defvo.setAttributeValue("mnecode", mnecode);
-					defvo.setAttributeValue("name2", name2);
-					defvo.setAttributeValue("name3", name3);
-					defvo.setAttributeValue("name4", name4);
-					defvo.setAttributeValue("name5", fid);
-					defvo.setAttributeValue("name6", vdef17);
-					defvo.setAttributeValue("pk_defdoclist", QryOCRPk());
-					defvo.setAttributeValue("pk_group", pk_group);
-					defvo.setAttributeValue("pk_org", pk_group);
-					defvo.setAttributeValue("datatype", 1);
-					defvo.setAttributeValue("enablestate", 2);
-					defvo.setAttributeValue("shortname", amount);
-					defvo.setAttributeValue("shortname2", total);
-					defvo.setAttributeValue("shortname3", ttax);
-					defvo.setAttributeValue("pid", date);
-					defvo.setAttributeValue("shortname5", cname);
-					defvo.setAttributeValue("shortname6", trate);
-					defvo.setAttributeValue("dataoriginflag", 0);
-					defvo.setAttributeValue("shortname4", kind);
-					defvo.setAttributeValue("innercode", codenumber);
-					defvo.setAttributeValue("modifier", dtax);
-					vos[0] = defvo;
-					try {
-						idefservice.insertDefdocs(pk_group, vos);
-						
-						Map<String,String> map = new HashMap<String,String>();
-						map.put("KYHSJE", "~");
-						map.put("KYWSJE", "~");
-						map.put("JYSE", "~");
-						map.put("FPXZ", url);
-						map.put("VDEF17",vdef17);
-						map.put("NUMBERID",code);
-						ocrservice.addORC(map);
-					} catch (Exception e) {
-						// TODO 自动生成的 catch 块
-						MessageDialog.showErrorDlg(parentpanel, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/
-									,"保存自定义档案数据:\n"+e.getMessage());
-						return;
-					}
-				//}
-				newvo.setFiledesc("OCR已识别");
+				//添加描述
+				newvo.setFiledesc(message);
 				// 修改人
 				newvo.setModifier(InvocationInfoProxy.getInstance()
 						.getUserId());
@@ -327,7 +175,7 @@ public class ThOCRAction extends AbstractNCAction{
 							.getFullPath());
 					if (b) {
 						// 更新table
-						oldvo.setFiledesc("OCR已识别");
+						oldvo.setFiledesc(message);
 						oldvo.setModifier(newvo.getModifier());
 						oldvo.setModifytime(newvo.getModifytime());
 						parentpanel.getfiletablemodel().clearTable();
@@ -352,45 +200,94 @@ public class ThOCRAction extends AbstractNCAction{
 				   return;				
 
 				}
+				if(!"OCR已识别".equals(message)) {
+					continue;
+				}
+				
+				String ext = info.getString("ext");
+				JSONObject extobj = JSONObject.parseObject(ext);
+				String trate = extobj.getString("trate");//税率
+				JSONObject comm_info = info.getJSONObject("comm_info");
+				JSONObject pro = comm_info.getJSONObject("pro");
+				String date = pro.getString("date");//发票日期
+				String cname = pro.getString("cname");//发票类型名称
+				String kind = extobj.getString("content");
+				JSONObject price = comm_info.getJSONObject("price");
+				String amount = "";
+				String total = price.getString("total");//价税合计
+				String dtax = price.getString("dtax");//可抵扣税额
+				String ttax = "";
+				//如有可抵扣税额,无税金额等于无税金额,税额等于可抵扣税额,税率等于税率
+				//如没有可抵扣税额,无税金额等于无税金额+税额,税额等于0,税率等于0
+				if("0".equals(dtax)) {
+					//无税金额+税额 = 价税合计
+					amount = total;
+					ttax = "0";//税额
+					trate = "0";//税率
+				}else {
+					amount = price.getString("amount");//无税金额
+					ttax = extobj.getString("ttax");//税额
+				}
+				JSONObject buyer = comm_info.getJSONObject("buyer");
+				String mnecode = buyer.getString("tcode");//购买方纳税人识别号
+				String name2 = buyer.getString("company");//购买方公司名称
+				JSONObject payer = comm_info.getJSONObject("payer");
+				String name3 = payer.getString("tcode");//销售方纳税人识别号
+				String name4 = payer.getString("company");//购买方公司名称
+				
+				IDefdocService idefservice = NCLocator.getInstance().lookup(IDefdocService.class);
+				DefdocVO[] vos = new DefdocVO[1];
+				DefdocVO defvo = new DefdocVO();
+				//赋值
+				defvo.setAttributeValue("code", code);
+				defvo.setAttributeValue("name", memo);
+				defvo.setAttributeValue("memo", name );
+				defvo.setAttributeValue("mnecode", mnecode);
+				defvo.setAttributeValue("name2", name2);
+				defvo.setAttributeValue("name3", name3);
+				defvo.setAttributeValue("name4", name4);
+				defvo.setAttributeValue("name5", fid);
+				defvo.setAttributeValue("name6", vdef17);
+				defvo.setAttributeValue("pk_defdoclist", QryOCRPk());
+				defvo.setAttributeValue("pk_group", pk_group);
+				defvo.setAttributeValue("pk_org", pk_group);
+				defvo.setAttributeValue("datatype", 1);
+				defvo.setAttributeValue("enablestate", 2);
+				defvo.setAttributeValue("shortname", amount);
+				defvo.setAttributeValue("shortname2", total);
+				defvo.setAttributeValue("shortname3", ttax);
+				defvo.setAttributeValue("pid", date);
+				defvo.setAttributeValue("shortname5", cname);
+				defvo.setAttributeValue("shortname6", trate);
+				defvo.setAttributeValue("dataoriginflag", 0);
+				defvo.setAttributeValue("shortname4", kind);
+				defvo.setAttributeValue("innercode", codenumber);
+				defvo.setAttributeValue("modifier", dtax);
+				vos[0] = defvo;
+				try {
+					idefservice.insertDefdocs(pk_group, vos);
+					
+					Map<String,String> map = new HashMap<String,String>();
+					map.put("KYHSJE", "~");
+					map.put("KYWSJE", "~");
+					map.put("JYSE", "~");
+					map.put("FPXZ", url);
+					map.put("VDEF17",vdef17);
+					map.put("NUMBERID",code);
+					ocrservice.addORC(map);
+				} catch (Exception e) {
+					// TODO 自动生成的 catch 块
+					MessageDialog.showErrorDlg(parentpanel, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/
+								,"保存自定义档案数据:\n"+e.getMessage());
+					return;
+				}
+				
 			}
 		}
 		MessageDialog.showHintDlg(parentpanel, "提示","识别结束!");
 	}
 	
 
-	/**
-     * 得到文件名称
-     *
-     * @param path 路径
-     * @return {@link List}<{@link String}>
-     */
-   /* private  List<String> getFileNames(String path) {
-        File file = new File(path);
-        if (!file.exists()) {
-            return null;
-        }
-        List<String> fileNames = new ArrayList<String>();
-        return getFileNames(file, fileNames);
-    }*/
-
-/**
-     * 得到文件名称
-     *
-     * @param file      文件
-     * @param fileNames 文件名
-     * @return {@link List}<{@link String}>
-     */
-/*    private  List<String> getFileNames(File file, List<String> fileNames) {
-        File[] files = file.listFiles();
-        for (File f : files) {
-            if (f.isDirectory()) {
-                getFileNames(f, fileNames);
-            } else {
-                fileNames.add(f.getName());
-            }
-        }
-        return fileNames;
-    }*/
     
     private String checkJson(JSONObject json) throws Exception {
 		
@@ -423,27 +320,4 @@ public class ThOCRAction extends AbstractNCAction{
   			return object.toString();
   		}
       }
-      
-      
-      
-    @SuppressWarnings("unchecked")
-	private DefdocVO[]  QryDefdocvoInfo(String code){
-        	String sql = "select * from  bd_defdoc where  nvl(dr, 0) = 0 and pk_defdoclist="
-        			+ "(select pk_defdoclist from bd_defdoclist where code='OCRTHNC' and nvl(dr,0)=0) and code='" + code + "' ";
-        	ArrayList<Object> arrayvos=null;
-        	try {
-				arrayvos=(ArrayList<Object>) iuap.executeQuery(sql, new BeanListProcessor(DefdocVO.class));
-			} catch (BusinessException e) {
-				// TODO 自动生成的 catch 块
-				e.printStackTrace();
-			}
-        	
-        	if (arrayvos==null||arrayvos.size()==0) {
-      			return new DefdocVO[0];
-      		}else {
-      			return arrayvos.toArray(new DefdocVO[0]);
-      		}
-        	
-        } 
-      
 }

+ 63 - 0
pu/pu/src/client/nc/ui/pu/m25/action/InvoiceEditAction.java

@@ -0,0 +1,63 @@
+/**
+ * $文件说明$
+ * 
+ * @author zhaoyha
+ * @version
+ * @see
+ * @since
+ * @time 2009-8-5 下午04:07:12
+ */
+package nc.ui.pu.m25.action;
+
+import nc.ui.pu.pub.action.PUEditAction;
+import nc.vo.pu.m25.entity.InvoiceVO;
+import nc.vo.pu.pub.util.ApproveFlowUtil;
+
+/**
+ * <p>
+ * <b>本类主要完成以下功能:</b>
+ * <ul>
+ * <li>功能条目1
+ * <li>功能条目2
+ * <li>...
+ * </ul>
+ * <p>
+ * <b>变更历史(可选):</b>
+ * <p>
+ * XXX版本增加XXX的支持。
+ * <p>
+ * <p>
+ * 
+ * @version 本版本号
+ * @since 上一版本号
+ * @author zhaoyha
+ * @time 2009-8-5 下午04:07:12
+ */
+public class InvoiceEditAction extends PUEditAction {
+
+  /**
+  * 
+  */
+  private static final long serialVersionUID = 4435766414744657347L;
+
+  /**
+   * 父类方法重写
+   * 
+   * @see nc.ui.uif2.actions.EditAction#isActionEnable()
+   */
+  @Override
+  protected boolean isActionEnable() {
+    boolean isEnable = super.isActionEnable();
+    if (isEnable) {
+      InvoiceVO vo = (InvoiceVO) this.getModel().getSelectedData();
+      isEnable &= ApproveFlowUtil.isCanEdit(vo);
+      //Yaoyu 2023-08-15  提交后不允许修改
+      int fbillstatus = vo.getParentVO().getFbillstatus();
+      if(fbillstatus == 1 || fbillstatus == 2) {
+    	  isEnable = false;
+      }
+    }
+    return isEnable;
+  }
+
+}

+ 23 - 9
pu/pu/src/client/nc/ui/pu/m25/editor/card/afteredit/body/OcrRefaft.java

@@ -24,7 +24,7 @@ public class OcrRefaft implements ICardBodyAfterEditEventListener{
 	@Override
 	public void afterEdit(CardBodyAfterEditEvent arg0) {
 		try {
-			UIRefPane ref=(UIRefPane) arg0.getBillCardPanel().getBodyItem("OCR").getComponent();
+			UIRefPane ref = (UIRefPane) arg0.getBillCardPanel().getBodyItem("OCR").getComponent();
 			String[] pks = ref.getRefPKs();
 			StringBuffer sbf = new StringBuffer();
 			// 处理PK
@@ -177,18 +177,32 @@ public class OcrRefaft implements ICardBodyAfterEditEventListener{
 					arg0.getBillCardPanel().setBodyValueAt("不一致", arg0.getRow(), "vbdef14");
 				}
 			}
+			
+			//价税合计小于0
+			if(SumTotal.compareTo(new UFDouble(0)) < 0) {
+				arg0.getBillCardPanel().setBodyValueAt(-1, arg0.getRow(), "nastnum");//数量
+				arg0.getBillCardPanel().setBodyValueAt(-1, arg0.getRow(), "nnum");//主数量
+				arg0.getBillCardPanel().setBodyValueAt(SumTotal.abs(), arg0.getRow(), "nastorigtaxprice");//含税单价
+				arg0.getBillCardPanel().setBodyValueAt(SumTotal.abs(), arg0.getRow(), "nasttaxprice");//本币含税单价
+				arg0.getBillCardPanel().setBodyValueAt(SumTotal.abs(), arg0.getRow(), "ntaxprice");//主本币含税单价
+				arg0.getBillCardPanel().setBodyValueAt(SumAmount.abs(), arg0.getRow(), "nastorigprice");//无税单价
+				arg0.getBillCardPanel().setBodyValueAt(SumAmount.abs(), arg0.getRow(), "nastprice");//本币无税单价
+				arg0.getBillCardPanel().setBodyValueAt(SumAmount.abs(), arg0.getRow(), "nprice");//主本币无税单价
+			}else {
+				arg0.getBillCardPanel().setBodyValueAt(1, arg0.getRow(), "nastnum");//数量
+				arg0.getBillCardPanel().setBodyValueAt(1, arg0.getRow(), "nnum");//主数量
+				arg0.getBillCardPanel().setBodyValueAt(SumTotal, arg0.getRow(), "nastorigtaxprice");//含税单价
+				arg0.getBillCardPanel().setBodyValueAt(SumTotal, arg0.getRow(), "nasttaxprice");//本币含税单价
+				arg0.getBillCardPanel().setBodyValueAt(SumTotal, arg0.getRow(), "ntaxprice");//主本币含税单价
+				arg0.getBillCardPanel().setBodyValueAt(SumAmount, arg0.getRow(), "nastorigprice");//无税单价
+				arg0.getBillCardPanel().setBodyValueAt(SumAmount, arg0.getRow(), "nastprice");//本币无税单价
+				arg0.getBillCardPanel().setBodyValueAt(SumAmount, arg0.getRow(), "nprice");//主本币无税单价
+			}
+			
 			arg0.getBillCardPanel().setBodyValueAt(url, arg0.getRow(), "vbdef11");//发票地址
-			arg0.getBillCardPanel().setBodyValueAt(1, arg0.getRow(), "nastnum");//数量
-			arg0.getBillCardPanel().setBodyValueAt(1, arg0.getRow(), "nnum");//主数量
-			arg0.getBillCardPanel().setBodyValueAt(SumAmount, arg0.getRow(), "nastorigprice");//无税单价
-			arg0.getBillCardPanel().setBodyValueAt(SumAmount, arg0.getRow(), "nastprice");//本币无税单价
-			arg0.getBillCardPanel().setBodyValueAt(SumAmount, arg0.getRow(), "nprice");//主本币无税单价
 			arg0.getBillCardPanel().setBodyValueAt(SumAmount, arg0.getRow(), "norigmny");//无税金额
 			arg0.getBillCardPanel().setBodyValueAt(SumAmount, arg0.getRow(), "nmny");//本币无税金额
 			arg0.getBillCardPanel().setBodyValueAt(SumAmount, arg0.getRow(), "ncalcostmny");//计成本金额
-			arg0.getBillCardPanel().setBodyValueAt(SumTotal, arg0.getRow(), "nastorigtaxprice");//含税单价
-			arg0.getBillCardPanel().setBodyValueAt(SumTotal, arg0.getRow(), "nasttaxprice");//本币含税单价
-			arg0.getBillCardPanel().setBodyValueAt(SumTotal, arg0.getRow(), "ntaxprice");//主本币含税单价
 			arg0.getBillCardPanel().setBodyValueAt(SumTotal, arg0.getRow(), "norigtaxmny");//价税合计
 			arg0.getBillCardPanel().setBodyValueAt(SumTotal, arg0.getRow(), "ntaxmny");//本币价税合计
 			arg0.getBillCardPanel().setBodyValueAt(SumTax, arg0.getRow(), "ntax");//税额

+ 4 - 0
pu/pu/src/client/nc/ui/pu/m25/editor/card/beforeedit/body/OcrRefbf.java

@@ -21,6 +21,10 @@ public class OcrRefbf  implements ICardBodyBeforeEditEventListener {
 		if(objvdef17 == null || "".equals(objvdef17)){
 			ExceptionUtils.wrappBusinessException("请添加发票!");
 		}
+		String pk_material = (String) cpanel.getBodyValueAt(cardbodybeforeeditevent.getRow(), "pk_material");
+		if(pk_material == null) {
+			ExceptionUtils.wrappBusinessException("请先选择物料!");
+		}
 		int count=cpanel.getRowCount();
 		String vbdef20 = "";
 		for(int i=0;i<count;i++){

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 10
pu/pu/src/client/nc/ui/pubapp/uif2app/actions/MultiSelectDialog.java


+ 8 - 7
pu/pu/src/private/nc/bs/ic/base/InvoiceAfterCheckEvent.java

@@ -89,20 +89,21 @@ public class InvoiceAfterCheckEvent implements IRule<InvoiceVO>{
 						String[] arrVbdef20 = invoiceItemVO.getVbdef20().split(",");
 						for(String Vbdef20 : arrVbdef20) {
 							DefdocVO defdocVO = (DefdocVO) service.queryBillOfNCObjectByPKWithDR(DefdocVO.class, Vbdef20, true).getContainmentObject();
-							UFDate date = new UFDate(System.currentTimeMillis());
-							UFDate date2 = new UFDate(defdocVO.getPid());
-							//当年只能报销当年的控制
-							if(date.getYear() != date2.getYear()) {
-								ExceptionUtils.wrappBusinessException("行:"+invoiceItemVO.getCrowno()+"不能跨年报销发票!");
+							if(defdocVO.getPid() != null) {
+								UFDate date = new UFDate(System.currentTimeMillis());
+								UFDate date2 = new UFDate(defdocVO.getPid());
+								//当年只能报销当年的控制
+								if(date.getYear() != date2.getYear()) {
+									ExceptionUtils.wrappBusinessException("行:"+invoiceItemVO.getCrowno()+"不能跨年报销发票!");
+								}
 							}
-							
 							//特殊发票不存在抬头与纳税人识别号可不做校验
 							if(defdocVO.getName2() != null && !"".equals(defdocVO.getName2())) {
 								//比较抬头
 								String sql1 = "select name from org_financeorg_v where pk_vid ='"+InvoiceVO.getParent().getAttributeValue("pk_org_v")+"'";
 								String orgname = (String) bs.executeQuery(sql1, new ColumnProcessor());
 								if(!orgname.equals(defdocVO.getName2())) {
-									ExceptionUtils.wrappBusinessException("行:"+invoiceItemVO.getCrowno()+"发票抬头不正确!");
+									ExceptionUtils.wrappBusinessException("行:"+invoiceItemVO.getCrowno()+"发票抬头不正确!请检查自定义档案是否维护!");
 								}
 								//比较纳税人识别号
 								StringBuffer sql2 = new StringBuffer();

+ 0 - 28
pu/pu/src/private/nc/bs/ic/base/InvoiceAfterSubmitEvent.java

@@ -1,28 +0,0 @@
-package nc.bs.ic.base;
-
-import nc.bs.framework.common.NCLocator;
-import nc.impl.pubapp.pattern.rule.IRule;
-import nc.itf.th.IThOcrService;
-import nc.vo.pu.m25.entity.InvoiceVO;
-import nc.vo.pubapp.pattern.exception.ExceptionUtils;
-
-
-/**
- * 采购发票提交后传发票云
- * @author Yaoyu
- *
- */
-public class InvoiceAfterSubmitEvent  implements IRule<InvoiceVO>{
-
-	@Override
-	public void process(InvoiceVO[] vos) {
-		IThOcrService  iThOcrService=(IThOcrService) NCLocator.getInstance().lookup(IThOcrService.class.getName());
-		try {
-			iThOcrService.UpdateInvoiceStatus("T", vos);
-		} catch (Exception e) {
-			e.printStackTrace();
-			ExceptionUtils.wrappBusinessException(e.getMessage());
-		}
-	}
-
-}

+ 1 - 1
pu/pu/src/private/nc/bs/ic/base/InvoiceAfterUnApproveEvent.java

@@ -27,7 +27,7 @@ public class InvoiceAfterUnApproveEvent implements IRule<InvoiceVO>{
 			int vostatus = orgVos[0].getParentVO().getFbillstatus();
 			if(vostatus == 3) {
 				System.out.println();
-				iThOcrService.UpdateInvoiceStatus("T", vos);
+				iThOcrService.UpdateInvoiceStatus("N", vos);
 			}
 			
 		} catch (Exception e) {

+ 0 - 28
pu/pu/src/private/nc/bs/ic/base/InvoiceAfterUnSubmitEvent.java

@@ -1,28 +0,0 @@
-package nc.bs.ic.base;
-
-import nc.bs.framework.common.NCLocator;
-import nc.impl.pubapp.pattern.rule.IRule;
-import nc.itf.th.IThOcrService;
-import nc.vo.pu.m25.entity.InvoiceVO;
-import nc.vo.pubapp.pattern.exception.ExceptionUtils;
-
-/**
- * 
- * 采购发票收回后传发票云
- * @author Yaoyu
- *
- */
-public class InvoiceAfterUnSubmitEvent implements IRule<InvoiceVO>{
-
-	@Override
-	public void process(InvoiceVO[] vos) {
-		IThOcrService  iThOcrService=(IThOcrService) NCLocator.getInstance().lookup(IThOcrService.class.getName());
-		try {
-			iThOcrService.UpdateInvoiceStatus("S", vos);
-		} catch (Exception e) {
-			e.printStackTrace();
-			ExceptionUtils.wrappBusinessException(e.getMessage());
-		}
-	}
-}
-

+ 0 - 1
pu/pu/src/private/nc/impl/pu/m25/action/InvoiceDeleteAction.java

@@ -7,7 +7,6 @@ import java.util.List;
 import java.util.Set;
 import nc.bs.framework.common.NCLocator;
 import nc.bs.ic.base.InvoiceAfterDeleteEvent;
-import nc.bs.ic.base.InvoiceAfterSubmitEvent;
 import nc.bs.pu.m25.maintain.InvoiceDeleteBP;
 import nc.bs.pu.m25.plugin.InvoicePluginPoint;
 import nc.impl.pubapp.pattern.data.bill.tool.BillTransferTool;

+ 0 - 29
pu/pu/src/private/nc/impl/pu/m25/action/InvoiceSendApproveAction.java

@@ -1,29 +0,0 @@
-package nc.impl.pu.m25.action;
-
-import nc.bs.ic.base.InvoiceAfterSubmitEvent;
-import nc.impl.pu.m25.action.rule.sendapprove.ApproveFlowCheckRule;
-import nc.impl.pu.m25.action.rule.sendapprove.InvoiceStateChgRule;
-import nc.impl.pubapp.pattern.data.bill.BillUpdate;
-import nc.impl.pubapp.pattern.data.bill.tool.BillTransferTool;
-import nc.impl.pubapp.pattern.rule.plugin.IPluginPoint;
-import nc.impl.pubapp.pattern.rule.processer.AroundProcesser;
-import nc.vo.pu.m25.entity.InvoiceVO;
-
-public class InvoiceSendApproveAction {
-	public InvoiceVO[] sendapprove(InvoiceVO[] invoiceVOs) {
-		BillTransferTool<InvoiceVO> tool = new BillTransferTool(invoiceVOs);
-		InvoiceVO[] orgVos = (InvoiceVO[]) tool.getOriginBills();
-		AroundProcesser<InvoiceVO> processer = new AroundProcesser((IPluginPoint) null);
-		this.addRule(processer);
-		processer.before(invoiceVOs);
-		processer.after(invoiceVOs);
-		InvoiceVO[] updatedVos = (InvoiceVO[]) (new BillUpdate()).update(invoiceVOs, orgVos);
-		return (InvoiceVO[]) tool.getBillForToClient(updatedVos);
-	}
-
-	private void addRule(AroundProcesser<InvoiceVO> processer) {
-		processer.addBeforeFinalRule(new ApproveFlowCheckRule());
-		processer.addBeforeFinalRule(new InvoiceStateChgRule());
-		processer.addAfterFinalRule(new InvoiceAfterSubmitEvent());
-	}
-}

+ 0 - 80
pu/pu/src/private/nc/impl/pu/m25/action/InvoiceUnSendApproveAction.java

@@ -1,80 +0,0 @@
-/**
- * $文件说明$
- * 
- * @author zhaoyha
- * @version 6.0
- * @see
- * @since 6.0
- * @time 2010-1-26 下午02:38:25
- */
-package nc.impl.pu.m25.action;
-
-import nc.bs.ic.base.InvoiceAfterUnSubmitEvent;
-import nc.bs.pu.m25.plugin.InvoicePluginPoint;
-import nc.bs.pub.compiler.AbstractCompiler2;
-import nc.impl.pubapp.pattern.data.bill.BillQuery;
-import nc.impl.pubapp.pattern.data.bill.BillUpdate;
-import nc.impl.pubapp.pattern.data.bill.tool.BillTransferTool;
-import nc.impl.pubapp.pattern.rule.processer.CompareAroundProcesser;
-import nc.vo.pu.m25.entity.InvoiceVO;
-import nc.vo.pu.m25.rule.approve.UnSendApproveStatusChkRule;
-import nc.vo.pu.pub.util.AggVOUtil;
-import nc.vo.pub.VOStatus;
-import nc.vo.pubapp.pattern.exception.ExceptionUtils;
-
-/**
- * <p>
- * <b>本类主要完成以下功能:</b>
- * <ul>
- * <li>采购发票收回动作
- * </ul>
- * <p>
- * <p>
- * 
- * @version 6.0
- * @since 6.0
- * @author zhaoyha
- * @time 2010-1-26 下午02:38:25
- */
-public class InvoiceUnSendApproveAction {
-  public InvoiceVO[] unSendApprove(InvoiceVO[] invoiceVOs,
-      AbstractCompiler2 script) {
-    InvoiceVO[] vos = invoiceVOs;
-    BillTransferTool<InvoiceVO> tool = new BillTransferTool<InvoiceVO>(vos);
-    vos = tool.getClientFullInfoBill();
-    InvoiceVO[] orgVos = tool.getOriginBills();
-    CompareAroundProcesser<InvoiceVO> prcr =
-        new CompareAroundProcesser<InvoiceVO>(InvoicePluginPoint.UNSENDAPPROVE);
-    this.addRule(prcr);
-    prcr.before(vos, orgVos);
-    if (null != script) {
-      try {
-        script.procRecallFlow(script.getPfParameterVO());
-        InvoiceVO[] unappovedVos =
-            (InvoiceVO[]) script.getPfParameterVO().m_preValueVos;
-        for (InvoiceVO vo : unappovedVos) {
-          vo.getParentVO().setStatus(VOStatus.UPDATED);
-        }
-        vos = new BillUpdate<InvoiceVO>().update(unappovedVos, orgVos);
-      }
-      catch (Exception e) {
-        // 日志异常
-        ExceptionUtils.wrappException(e);
-
-      }
-    }
-    prcr.after(vos, orgVos);
-    // 重新查一下VO
-    String[] ids = AggVOUtil.getPrimaryKeys(vos);
-    InvoiceVO[] approvedVos =
-        new BillQuery<InvoiceVO>(InvoiceVO.class).query(ids);
-    // 返回差异VO
-    return tool.getBillForToClient(approvedVos);
-  }
-
-  private void addRule(CompareAroundProcesser<InvoiceVO> prcr) {
-    // 发票可取消审批状态检查
-    prcr.addBeforeFinalRule(new UnSendApproveStatusChkRule());
-    prcr.addAfterFinalRule(new InvoiceAfterUnSubmitEvent());
-  }
-}

+ 4 - 2
pu/pu/src/private/nc/impl/th/ThOcrServiceImpl.java

@@ -744,8 +744,8 @@ public class ThOcrServiceImpl implements IThOcrService{
 								UFDouble shortname = new UFDouble(mapdb.get("shortname"));
 								//该发票税额
 								UFDouble shortname3 = new UFDouble(mapdb.get("shortname3"));
-								//提交情况下
-								if("T".equals(status)){
+								//审批的情况下
+								if("Y".equals(status)){
 									int index = invoiceItemVO.getVbdef16().indexOf("—");
 									//去掉拼接时间戳
 							    	String code = index == -1 ? invoiceItemVO.getVbdef16() : invoiceItemVO.getVbdef16().substring(0, index);
@@ -763,6 +763,8 @@ public class ThOcrServiceImpl implements IThOcrService{
 									sql.append(" AND po_invoice.fbillstatus <> '1' ");
 									sql.append(" AND po_invoice.vbillcode <> '"+invoiceVO.getParentVO().getVbillcode()+"'");
 									sql.append(" AND po_invoice_b.vbdef20 IN ( SELECT pk_defdoc FROM bd_defdoc WHERE code LIKE '"+code+"%' )");
+									sql.append(" AND nvl(po_invoice.dr,0) = 0");
+									sql.append(" AND nvl(po_invoice_b.dr,0) = 0");
 									Map<String,String> mappo = (Map<String, String>) iuap.executeQuery(sql.toString(), new MapProcessor());
 									//价税合计
 									Object objectNorigtaxmny = mappo.get("norigtaxmny");

+ 0 - 62
pu/pu/src/public/nc/bs/pub/action/N_25_APPROVE.java

@@ -1,62 +0,0 @@
-package nc.bs.pub.action;
-
-import nc.bs.framework.common.NCLocator;
-import nc.bs.pub.compiler.AbstractCompiler2;
-import nc.itf.pu.m25.IInvoiceApprove;
-import nc.itf.th.IThOcrService;
-import nc.vo.pub.BusinessException;
-import nc.vo.pub.compiler.PfParameterVO;
-import nc.vo.uap.pf.PFBusinessException;
-
-/**
- * 备注:采购发票的审批 单据动作执行中的动态执行类的动态执行类。 创建日期:(2009-7-3)
- * 
- * @author 平台脚本生成
- */
-public class N_25_APPROVE extends AbstractCompiler2 {
-
-  /**
-   * N_25_APPROVE 构造子注解。
-   */
-  public N_25_APPROVE() {
-    super();
-  }
-
-  /*
-   * 备注:平台编写原始脚本
-   */
-  @Override
-  public String getCodeRemark() {
-    return "	/*************从平台取得由该动作传入的入口参数。本方法取得需要的VO。************/\n      nc.vo.pu.m25.entity.InvoiceVO inObject  =(nc.vo.pu.m25.entity.InvoiceVO) getVo();\n      /**************设置参数******************************************************/\n      setParameter(\"INVO\", inObject);\n	return null;\n";/* -=notranslate=- */
-  }
-
-  /*
-   * 备注:平台编写规则类 接口执行类
-   */
-  @Override
-  public Object runComClass(PfParameterVO vo) throws BusinessException {
-    try {
-      super.m_tmpVo = vo;
-
-      /************* 该组件为批动作工作流处理开始...不能进行修改 *********************/
-      Object retValue = null;
-      nc.vo.pu.m25.entity.InvoiceVO[] vos = (nc.vo.pu.m25.entity.InvoiceVO[]) this.getVos();
-      nc.vo.pu.m25.env.InvoiceUIToBSEnv[] envs = nc.vo.pu.m25.pub.InvoiceEnvExtractUtil.getEnvs(vo);
-      retValue = NCLocator.getInstance().lookup(IInvoiceApprove.class).approve(vos, this, envs);
-      String status = vo.m_workFlow.getApproveresult();
-      //只处理驳回的单据,并且是驳回到制单人,单据状态为自由
-		if("R".equals(status)) {
-			NCLocator.getInstance().lookup(IThOcrService.class).UpdateInvoiceStatus(status,vos);
-		}
-      
-      return retValue;
-      /**************************************************************************/
-    }
-    catch (Exception ex) {
-      if (ex instanceof BusinessException) {
-        throw (BusinessException) ex;
-      }
-      throw new PFBusinessException(ex.getMessage(), ex);
-    }
-  }
-}

+ 29 - 155
pu/pu/src/public/nc/ui/bd/ref/model/StorDocReportRefModel.java

@@ -13,17 +13,9 @@ import nc.vo.ml.NCLangRes4VoTransl;
  * OCR发票识别参照
  */
 public class StorDocReportRefModel extends AbstractRefModel{
-	 private DefdocDefaultModelUtil util = new DefdocDefaultModelUtil();
-	public StorDocReportRefModel() {
-		super();
-		getRefQueryVO();
-	}
-	
-	 @Override
-	    public void filterValueChanged(ValueChangedEvent changedValue) {
-	        super.filterValueChanged(changedValue);
-	        util.filterValueChanged(this, changedValue);
-	    }
+    public StorDocReportRefModel() {
+        this.reset();
+    }
 
 	  
 	 
@@ -31,149 +23,31 @@ public class StorDocReportRefModel extends AbstractRefModel{
 	
 	@Override
 	public void reset() {
-        this.setFieldCode(new String[] {
-        		DefdocVO.SHORTNAME5,DefdocVO.SHORTNAME,"shortname3","modifier",DefdocVO.SHORTNAME6,"shortname2",
-        		"innercode", DefdocVO.NAME, DefdocVO.MEMO, DefdocVO.MNECODE,DefdocVO.NAME2,DefdocVO.NAME3,DefdocVO.NAME4,
-        		DefdocVO.PID,
-        		DefdocVO.SHORTNAME4
-            });
-            this.setFieldName(new String[] {
-            		"发票类型",
-            		"发票金额",
-            		"税额",
-            		"可抵扣税额",
-            		"税率",
-            		"价税合计",
-            		"发票代码",
-            		"发票号",
-            		"发票名称",
-            		"购买方纳税人识别号",
-            		"购买方公司名称", 
-            		"销售方纳税人识别号",
-            		"销售方公司名称",
-            		"发票时间",
-            		"开票内容"
-            		
-            });
-            this.setHiddenFieldCode(new String[] {
-                DefdocVO.PK_DEFDOC
-            });
-            this.setRefCodeField(DefdocVO.CODE);
-            this.setRefNameField(DefdocVO.NAME);
-            this.setPkFieldCode(DefdocVO.PK_DEFDOC);
-            this.setTableName(this.getPara2());
-            this.setMnecode(new String[] {
-                DefdocVO.MNECODE
-            });
-            this.setOrderPart(DefdocVO.CODE);
-            // 设置数据权限
-            this.setResourceID(this.getResourceCode());
-            final String[] funcodes = util.getFuncode(this.getPara1());
-            // 设置默认不显示停用
-            this.setAddEnableStateWherePart(true);
-            if (util.isContainBuData(this.getPara1())) {
-                this.setFilterRefNodeName(new String[] {
-                    "业务单元" /* -=notranslate=- */
-                });
-            }
-            // 维护
- /*           setRefMaintenanceHandler(new IRefMaintenanceHandler() {
-
-                @Override
-                public String[] getFucCodes() {
-                    return funcodes;
-                }
-
-                @Override
-                public IRefDocEdit getRefDocEdit() {
-                    return null;
-                }
-            });*/
-            this.resetFieldName();
-        }
-
-	/**
-	 * 参照标题 创建日期:(01-4-4 0:57:23)
-	 *
-	 * @return java.lang.String
-	 */
-	public String getRefTitle() {
-		return "OCR识别参照";
-	}
-	
-	
-	public Object getValue(String field) {
-		Object[] values = getValues(field);
-
-		Object value = null;
-		String strValue = "";
-		if (values != null && values.length > 1) {
-			for (Object pkobj : values) {
-				strValue += pkobj + ",";
-			}
-			strValue = strValue.substring(0, strValue.lastIndexOf(","));
-			value = strValue;
-			
-		}else if(values != null && values.length > 0){
-			value = values[0];
+       
+		super.setFieldCode(new String[] {"bd_defdoc.shortname5","ocr_defdoc.kyhsje","ocr_defdoc.kywsje","ocr_defdoc.jyse","bd_defdoc.shortname2","bd_defdoc.shortname",
+			"bd_defdoc.shortname6","bd_defdoc.shortname3","bd_defdoc.modifier","bd_defdoc.innercode","bd_defdoc.name","bd_defdoc.memo","bd_defdoc.mnecode","bd_defdoc.name2","bd_defdoc.name3","bd_defdoc.name4","bd_defdoc.pid","bd_defdoc.shortname4",
+			"bd_defdoc.code"
+		
+		
+		
+		});
+		super.setFieldName(new String[] {"发票类型","可用含税金额","可用无税金额","可用税额","票面含税金额","票面无税金额","票面税率","票面税额","票面可抵扣金额","发票代码","发票号",
+        		"发票名称",
+        		"购买方纳税人识别号",
+        		"购买方公司名称", 
+        		"销售方纳税人识别号",
+        		"销售方公司名称",
+        		"发票时间",
+        		"开票内容",
+        		"fid"});
+		super.setTableName("bd_defdoc bd_defdoc  left join ocr_defdoc ocr_defdoc on bd_defdoc.code = ocr_defdoc.numberid");
+		super.setHiddenFieldCode(new String[] {"pk_defdoc"});
+		super.setPkFieldCode("pk_defdoc");
+		super.setRefCodeField("bd_defdoc.code");
+		super.setRefNameField("bd_defdoc.name");
+		super.setOrderPart("bd_defdoc.code");
+		super.setDefaultFieldCount(8);
+		super.setRefTitle("OCR参照");
+		this.resetFieldName(); 
 		}
-
-		return value;
-	}
-
-	/**
-	 * 设置不显示参照
-	 */
-	public String[] getHiddenFieldCode() {
-		return new String[] { "pk_defdoc" };
-	}
-
-	/**
-	 * 设置参照表名
-	 */
-	public String getTableName() {
-		return "bd_defdoc";
-	}
-
-	/**
-	 * 设置参照查询规则
-	 * 
-	 */
-	public String getWherePart(){
-		return " isnull(dr, 0) = 0 and pk_defdoclist="
-				+ "(select pk_defdoclist from bd_defdoclist where code='OCRTHNC' and nvl(dr,0)=0) ";
-	}
-
-	public boolean isMatchPkWithWherePart() {
-		return true;
-	}
-
-	/**
-	 * 获取主键字段,必要
-	 */
-	public String getPkFieldCode() {
-		return DefdocVO.PK_DEFDOC;
-	}
-	
-	private String getResourceCode() {
-        return util.getResourceCode(this.getRefNodeName());
-    }
-	
-//	  /**
-//     * 重写数据权限缓存Key值
-//     */
-//    @Override
-//    protected String getDataPowerSqlKey(String strTableName,
-//            String dataPowerField) {
-//        String pk_org = null;
-//        String tableName = strTableName;
-//        if (strTableName != null) {
-//            tableName = strTableName.trim();
-//        }
-//        String dataPowerKey =
-//                tableName + this.getPara1() + "_" + dataPowerField
-//                        + getDataPowerOperation_code() + pk_org;
-//        return dataPowerKey;
-//    }
-
 }

+ 74 - 0
pu/pu/src/test/nc/ui/pubapp/uif2app/actions/BodyCopyLineAction.java

@@ -0,0 +1,74 @@
+package nc.ui.pubapp.uif2app.actions;
+
+import java.awt.event.ActionEvent;
+
+import nc.bs.uif2.IActionCode;
+import nc.ui.pub.bill.action.BillTableLineAction;
+import nc.ui.pubapp.uif2app.actions.intf.ICardPanelDefaultActionProcessor;
+import nc.ui.pubapp.uif2app.event.card.BodyRowEditType;
+import nc.ui.pubapp.uif2app.event.card.CardBodyAfterRowEditEvent;
+import nc.ui.uif2.NCAction;
+import nc.ui.uif2.ShowStatusBarMsgUtil;
+import nc.ui.uif2.actions.ActionInitializer;
+
+public class BodyCopyLineAction extends AbstractBodyTableExtendAction implements
+    ICardPanelDefaultActionProcessor {
+  private static final long serialVersionUID = 1L;
+
+  public BodyCopyLineAction() {
+    this.setCode(IActionCode.COPYLINE);
+    NCAction action = new NCAction() {
+      private static final long serialVersionUID = 1L;
+
+      @Override
+      public void doAction(ActionEvent e) throws Exception {
+        // do nothing
+      }
+    };
+    ActionInitializer.initializeAction(action, IActionCode.COPYLINE);
+    this.putActionValue(action);
+  }
+
+  @Override
+  public void doAction() {
+    boolean doOperateFlag =
+        this.getCardPanel().doLineAction(
+            super.getCardPanel().getCurrentBodyTableCode(),
+            BillTableLineAction.COPYLINE);
+    if (doOperateFlag) {
+      this.fireEvent();
+    }
+  }
+  
+  private void fireEvent() {
+    int[] rows = this.getCardPanel().getBodyPanel().getTable().getSelectedRows();
+    this.getModel().fireEvent(new CardBodyAfterRowEditEvent(this.getCardPanel(),BodyRowEditType.COPYLINE, rows));
+  }
+
+  @Override
+  public int getType() {
+    return BillTableLineAction.COPYLINE;
+  }
+
+  @Override
+  protected boolean doBeforeAction(ActionEvent e) {
+	int[] rows = this.getCardPanel().getBodyPanel().getTable().getSelectedRows();
+	String name = this.getCardPanel().getBodyPanel().getName();
+	if(name != null && "采购发票明细".equals(name)) {
+		for (int i = 0; i < rows.length; i++) {
+			String vbdef20 = (String) this.getCardPanel().getBodyValueAt(rows[i], "vbdef20");
+			if(vbdef20 != null) {
+			ShowStatusBarMsgUtil.showStatusBarMsg("发票参照的行不允许复制!", getModel().getContext());
+		      return false;
+			}
+		}
+	}
+    if (this.getCurrentSelectIndex() == -1) {
+      String message = nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("pubapp_0","0pubapp-0110")/*@res "请选择要复制的单据行"*/;
+      ShowStatusBarMsgUtil.showStatusBarMsg(message, getModel().getContext());
+      return false;
+    }
+    return true;
+  }
+
+}

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác