| | |
| | | { |
| | | try |
| | | { |
| | | string s = ""; |
| | | |
| | | //查看权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Xs_SeOrderChangeBill_Drop", 1, false, user)) |
| | | { |
| | |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID不能为空!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (BillOld.ShowBill(long.Parse(HInterID), ref s) == false) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "此单据有误!"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | //判断是否可编辑 |
| | | if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "此单据已经被审核,不允许删除!"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | |
| | |
| | | //进行需要进行的审核/反审核操作 |
| | | if (IsAudit == 0) //审核提交 |
| | | { |
| | | //检验子表数据 |
| | | string errorMessage = ""; |
| | | DateTime today = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")); //当日日期 |
| | | foreach (Model.ClsXs_SeOrderChangeBillSub oSub in oBill.DetailColl) |
| | | { |
| | | //判断新数量是否小于单据关联数量 |
| | | if(oSub.HQty_New < oSub.HRelationQty) |
| | | { |
| | | errorMessage += "第" + oSub.HEntryID + "行物料新数量小于单据被关联数量!"; |
| | | } |
| | | //判断新交货日期是否早于当日 |
| | | if ( oSub.HDate_New.CompareTo(today) < 0 ) |
| | | { |
| | | errorMessage += "第" + oSub.HEntryID + "行新交货日期早于当日!"; |
| | | } |
| | | } |
| | | if(errorMessage != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "审核失败!原因:子表" + errorMessage; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | //审核提交 |
| | | if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |