1
duhe
2024-06-05 c423a61ae9ee84f71a75ac793dac083fbd590eb1
WebAPI/Controllers/Kf_EntrustInBillController.cs
@@ -269,7 +269,7 @@
                websLsmain.HDate = lsmain[0].HDate;
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HBillType = lsmain[0].HBillType;
                websLsmain.HBillerID = DBUtility.ClsPub.isLong(DBUtility.ClsPub.CurUserID);
                websLsmain.HBillerID = lsmain[0].HBillerID;
                websLsmain.HDeptID = lsmain[0].HDeptID;
                websLsmain.HEmpID = lsmain[0].HEmpID;
                websLsmain.HRemark = "";
@@ -447,6 +447,89 @@
            }
        }
        #region 委外加工入库单 删除
        /// </summary>
        [Route("Kf_EntrustInBill/DeleteKf_EntrustInBill")]
        [HttpGet]
        public object DeleteKf_EntrustInBill(string HInterID, string user)
        {
            try
            {
                string s = "";
                DAL.ClsKf_OtherInBill oBill = new DAL.ClsKf_OtherInBill();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Kf_EntrustInBill_Drop", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无删除权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (HInterID == null || HInterID.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID不能为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oBill.ShowBill(long.Parse(HInterID), ref s) == false)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此单据有误!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                //判断是否可编辑
                if (oBill.omodel.HChecker != "" && oBill.omodel.HChecker != null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此单据已经被审核,不允许删除!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                //进行 会计期间 结账 的判断和控制
                int sYear = 0;
                int sPeriod = 0;
                DateTime HDate = DateTime.Now;
                if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
                {
                    objJsonResult.Message = s;
                    return objJsonResult;
                }
                oCN.BeginTran();
                oCN.RunProc("delete from Kf_ICStockBillMain where HInterID = " + HInterID);
                oCN.RunProc("delete from Kf_ICStockBillSub where HInterID= " + HInterID);
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "删除成功";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 委外加工入库单 审核/反审核
        /// <summary>
@@ -478,6 +561,17 @@
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //进行 会计期间 结账 的判断和控制
                string s = "";
                int sYear = 0;
                int sPeriod = 0;
                DateTime HDate = DateTime.Now;
                if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
                {
                    objJsonResult.Message = s;
                    return objJsonResult;
                }
@@ -525,7 +619,7 @@
                            objJsonResult.Message = "单据已审核!不能再次审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        }
                        //审核单据
                        if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                        {
@@ -569,6 +663,7 @@
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //反审核单据
                        if (!BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                        {