/// <summary> /// 判断流水账部分编辑修改,新增是否已结账 /// </summary> /// <returns></returns> /// <remarks> /// 2017/4/3 sunp update /// </remarks> public string isCheckout(string repDate, string status) { int count = 0; ExceResult res = new ExceResult(); string CId = CompanyId(); List <T_Report <IncomeStatement> > rep = new List <T_Report <IncomeStatement> >(); rep = new ReportSvc().isCheckout(repDate, status, out count, CId); string msg = string.Empty; bool result = false; if (rep.Count == 0) { msg = General.Resource.Common.Success; result = true; } else { msg = General.Resource.Common.Failed; result = false; } return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}" , result.ToString().ToLower(), msg)); }
public String CreateTaxRecord(List <T_IERecord> TaxList) { bool result = false; ExceResult res = new ExceResult(); string msg = string.Empty; foreach (T_IERecord form in TaxList) { form.C_GUID = Session["CurrentCompanyGuid"].ToString(); form.Creator = base.userData.LoginFullName; form.Currency = Session["Currency"].ToString(); if (form.IEGroup == "增值税") { form.IE_Flag = "E"; } result = new IESvc().UpdVoucherFL(form, "NV"); if (result) { msg = General.Resource.Common.Success; } else { msg = General.Resource.Common.Failed; } } return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}" , result.ToString().ToLower(), msg)); }
public string CreateTaxSettlement(string repDate, string Amount, string Rep_status, string GUID, string Flag, string State) { bool result = false; ExceResult res = new ExceResult(); string msg = string.Empty; if (string.IsNullOrEmpty(GUID)) { GUID = Guid.NewGuid().ToString(); } string C_GUID = Session["CurrentCompanyGuid"].ToString(); result = new IESvc().CreateTaxSettlement(GUID, repDate, Amount, Rep_status, C_GUID, Flag, State, "非期初"); if (result) { res.success = true; msg = General.Resource.Common.Success; } else { res.success = false; msg = General.Resource.Common.Failed; } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
/// <summary> /// 判断增值税是否结算 /// </summary> /// <returns></returns> /// <remarks> /// 2018/7/23 zm update /// </remarks> public string isZenZhiCheckout(string repDate, string TaxName, string TaxationType) { int count = 0; ExceResult res = new ExceResult(); string CId = CompanyId(); //string c_TaxationType = Session["c_TaxationType"].ToString(); new ReportSvc().isZenZhiCheckout(repDate, out count, CId, TaxName, TaxationType); string msg = string.Empty; bool result = false; if (count == 0) { msg = General.Resource.Common.Success; result = true; } else { msg = General.Resource.Common.Failed; result = false; } return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}" , result.ToString().ToLower(), msg)); }
/// <summary> /// 判断是否可以反结账结账 /// </summary> /// <returns></returns> /// <remarks> /// /// </remarks> public string isFinish(string repDate, string status) { int count = 0; ExceResult res = new ExceResult(); string CId = CompanyId(); List <Co_Tr_ThirdAccount> rep = new List <Co_Tr_ThirdAccount>(); rep = new IESvc().isFinish(repDate, status, out count, CId); string msg = string.Empty; bool result = false; if (rep.Count == 0) { msg = General.Resource.Common.Success; result = true; } else { msg = General.Resource.Common.Failed; result = false; } return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}" , result.ToString().ToLower(), msg)); }
public string UpdWcRecord(string id, decimal total, string Currency, string name, string RPType, string Profit_Name) { bool result = false; ExceResult res = new ExceResult(); string msg = string.Empty; T_WageCost wag = new T_WageCost(); wag.PayType = RPType; wag.C_GUID = Session["CurrentCompanyGuid"].ToString(); wag.W_GUID = id; wag.Total = total; wag.Currency = Currency; wag.Employee = name; wag.Date = DateTime.Now; wag.State = "未付"; wag.Profit_Name = Profit_Name; wag.SalaryType = 1; string strVouchID = Guid.NewGuid().ToString(); result = new IESvc().UpdWageCost(wag, strVouchID); if (result) { res.success = true; msg = General.Resource.Common.Success; } else { res.success = false; msg = General.Resource.Common.Failed; } return(JsonConvert.SerializeObject(res)); }
public string CreatTaxSettlement(List <T_TaxSettlement> TaxList) { bool result = false; ExceResult res = new ExceResult(); string msg = string.Empty; string Flag = null; string C_GUID = Session["CurrentCompanyGuid"].ToString(); using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required)) { foreach (T_TaxSettlement tax in TaxList) { if (string.IsNullOrEmpty(tax.GUID)) { tax.GUID = Guid.NewGuid().ToString(); } switch (tax.Flag) { case "增值税": Flag = "TA"; break; case "营业税金及附加": Flag = "YT"; break; case "所得税费用": Flag = "CT"; break; case "个人所得税": Flag = "SA"; break; default: break; } result = new IESvc().CreateTaxSettlement(tax.GUID, tax.Rep_date, tax.Amount.ToString(), tax.Rep_status, C_GUID, Flag, tax.State, "期初"); } if (result) { scope.Complete(); } } if (result) { res.success = true; msg = General.Resource.Common.Success; } else { res.success = false; msg = General.Resource.Common.Failed; } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
public string CheckTaxSettlement(string Rep_date) { ExceResult res = new ExceResult(); res.success = false; List <T_TaxSettlement> TaxSetList = new List <T_TaxSettlement>(); TaxSetList = new IESvc().CheckTaxSettlement(Rep_date); int a = TaxSetList.Count(); if (a <= 0) { res.success = true; } return(JsonConvert.SerializeObject(res)); }
/// <summary> /// 更新利润表 /// </summary> /// <returns></returns> /// <remarks> /// 2017/1/3 liujf update /// </remarks> public string CreateIncomeStatement(string repDate, string type) { ExceResult res = new ExceResult(); string result = new ReportSvc().CreateIncomeStatement(CompanyId(), repDate, type); if (string.IsNullOrEmpty(result)) { res.success = true; } else { res.success = false; res.msg = result; } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
public string CreateBalanceSheet(string repDate, string type, List <T_BalanceSheetTemplate> lstBanlance) { ExceResult res = new ExceResult(); string result = ""; using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required)) { string strReportID = Guid.NewGuid().ToString(); string strRepNo = "BS"; string strStart = string.Empty; string strEnd = string.Empty; Common.Function.Common.GetReportDateAndRepNo(repDate, type, ref strRepNo, ref strStart, ref strEnd); result = new ReportSvc().CreateReportInfo(CompanyId(), repDate, type, strReportID, strRepNo + repDate); if (string.IsNullOrEmpty(result)) { T_ReportDetails report = new T_ReportDetails(); DataTable dtBanlance = Common.Function.Common.GetTableByEntity <T_ReportDetails>(report); foreach (var item in lstBanlance) { //result = new ReportSvc().CreateReportDetailByBanlance(item, strReportID); //if (!string.IsNullOrEmpty(result)) //{ // break; //} addDataToTableByEntity(item, dtBanlance, strReportID); } result = new ReportSvc().CreateReportDetailByBanlance(dtBanlance, typeof(T_ReportDetails).Name); } if (string.IsNullOrEmpty(result)) { scope.Complete(); } } //string result = new ReportSvc().UpdBalanceSheet(CompanyId(), repDate,type,lstBanlance); if (string.IsNullOrEmpty(result)) { res.success = true; } else { res.success = false; res.msg = result; } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
/// <summary> /// 上传图片 /// </summary> /// <param name="frGuid"></param> /// <returns></returns> /// <remarks>liujf 2016/05/05 create</remarks> public ActionResult FileUpload(string frGuid, string TempFileNameFirst) { var files = Request.Files; ExceResult res = new ExceResult(); //获取当前时间戳 string CreateDate = GetDetailDate(); if (files != null && files.Count > 0) { ControllerContext.HttpContext.Request.ContentEncoding = Encoding.GetEncoding("UTF-8"); ControllerContext.HttpContext.Response.ContentEncoding = Encoding.GetEncoding("UTF-8"); ControllerContext.HttpContext.Response.Charset = "UTF-8"; //写入数据流 Stream fileStream = files[0].InputStream; byte[] fileDataStream = new byte[files[0].ContentLength]; fileStream.Read(fileDataStream, 0, files[0].ContentLength); //写入数据 for (int iFile = 0; iFile < files.Count; iFile++) { T_Attachment entity = new T_Attachment(); entity.A_GUID = Guid.NewGuid().ToString(); entity.FileName = TempFileNameFirst + CreateDate; entity.FileType = files[0].ContentType; entity.FR_GUID = frGuid; entity.FlieData = fileDataStream; bool rResult = new AttachmentSvc().AddAttachment(entity); if (rResult) { res.success = true; } else { res.success = false; res.msg = "保存附件异常"; } } } return(Content(Newtonsoft.Json.JsonConvert.SerializeObject(res))); }
public string UpdTaxSet(string GUID, string Rep_status) { bool result = false; ExceResult res = new ExceResult(); string msg = string.Empty; result = new IESvc().UpdTaxProvisionRecord(GUID, Rep_status); if (result) { msg = General.Resource.Common.Success; } else { msg = General.Resource.Common.Failed; } return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}" , result.ToString().ToLower(), msg)); }
public string UpdateFixedAssets(FixAssetsAmount fixAmount) { fixAmount.C_GUID = Session["CurrentCompanyGuid"].ToString(); bool result = new AIDSvc().UpdateFixAssetAmount(fixAmount); ExceResult res = new ExceResult(); res.success = result; if (result) { res.msg = "更新成功!"; } else { res.msg = "更新失败!"; } return(JsonConvert.SerializeObject(res)); }
/// <summary> /// 修改默认语言 /// </summary> /// <returns></returns> public ActionResult ChangeLanguage(string language) { ExceResult res = new ExceResult(); string guid = Session["CurrentUserGuid"].ToString(); bool rResult = new UserSvc().ChangeLanguage(guid, language); if (rResult) { res.success = true; Session["Language"] = language; } else { res.success = false; res.msg = "保存附件异常"; } return(Content(Newtonsoft.Json.JsonConvert.SerializeObject(res))); }
///// <summary> ///// 获取bom结构 ///// </summary> ///// <returns></returns> public string GetProductBom(string subId) { ExceResult rs = new ExceResult(); DataTable bom = AIDSvc.GetProductBomList(subId); List <ProductNode> treeNode = new FMS.BLL.ProductManageController().GetProductNoeList(bom); if (treeNode != null) { rs.success = true; rs.msg = JsonConvert.SerializeObject(treeNode); } else { rs.success = false; rs.msg = "该产品未设置结构,请先设置结构。"; } return(JsonConvert.SerializeObject(rs)); }
/// <summary> /// 结账反结账 /// </summary> /// <returns></returns> /// <remarks> /// 2017/3/22 sunp update /// </remarks> public string settled(string id, string status) { ExceResult res = new ExceResult(); bool result = new ReportSvc().settled(id, status); string msg = string.Empty; if (result) { msg = General.Resource.Common.Success; } else { msg = General.Resource.Common.Failed; } return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}" , result.ToString().ToLower(), msg)); }
///// <summary> ///// 更新物料数量 ///// </summary> ///// <returns></returns> public string EditProductBomRecord(T_ProductBom form) { ExceResult rs = new ExceResult(); bool result = false; string msg = string.Empty; result = new AIDSvc().UpdProductBomRecord(form); if (result) { rs.success = true; rs.msg = "修改成功"; } else { rs.success = true; rs.msg = "修改失败"; } return(JsonConvert.SerializeObject(rs)); }
/// <summary> /// 结账反结账(现金流量表) /// </summary> /// <returns></returns> /// <remarks> /// 2018/06/07 zm /// </remarks> public string settledcash(string id, string status, string repDate, string period) { string CId = CompanyId(); ExceResult res = new ExceResult(); bool result = new ReportSvc().settledcash(id, status, CId, repDate, period); string msg = string.Empty; if (result) { msg = General.Resource.Common.Success; } else { msg = General.Resource.Common.Failed; } return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}" , result.ToString().ToLower(), msg)); }
/// <summary> /// 删除产品 /// </summary> /// <param name="guid">要删除的guid</param> /// <returns></returns> public string DeleteProduct(string guid) { ExceResult res = new ExceResult(); string C_GUID = Session["CurrentCompanyGuid"].ToString(); var result = ProductSvc.DeleteProduct(guid, C_GUID); if (result == 1) { res.success = true; res.msg = ""; } else { res.success = false; res.msg = "不可以删除"; } return(JsonConvert.SerializeObject(res)); }
/// <summary> /// 反结账() /// </summary> /// <returns></returns> /// <remarks> /// 2018/07/18 zm /// </remarks> public string DeleteTaxProvisionRecord(string RepDate, string TaxID) { bool result = false; ExceResult res = new ExceResult(); string msg = string.Empty; string C_GUID = Session["CurrentCompanyGuid"].ToString(); result = new IESvc().DeleteTaxProvisionRecord(RepDate, TaxID, C_GUID); if (result) { res.success = true; msg = General.Resource.Common.Success; } else { res.success = false; msg = General.Resource.Common.Failed; } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
/// <summary> /// 添加企业所得税记录 /// </summary> /// <returns></returns> public string AddCTProvisionRecord(string Amount, string Name, string Date) { bool result = false; ExceResult res = new ExceResult(); string msg = string.Empty; string C_GUID = Session["CurrentCompanyGuid"].ToString(); result = new IESvc().AddCTProvisionRecord(Amount, Name, C_GUID, Date + "/01"); if (result) { res.success = true; msg = General.Resource.Common.Success; } else { res.success = false; msg = General.Resource.Common.Failed; } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
/// <summary> /// 添加增值税记录 /// </summary> /// <returns></returns> public string AddTaxProvisionRecord(string Amount, string Date, string Name, string inputtax, string outputtax, string exportreduce, string transfertax, string exporttax, string payingtax) { bool result = false; ExceResult res = new ExceResult(); string msg = string.Empty; string C_GUID = Session["CurrentCompanyGuid"].ToString(); result = new IESvc().AddTaxProvisionRecord(Amount, Date, Name, inputtax, outputtax, exportreduce, transfertax, exporttax, payingtax, C_GUID); if (result) { res.success = true; msg = General.Resource.Common.Success; } else { res.success = false; msg = General.Resource.Common.Failed; } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
/// <summary> /// 更新费用数据 /// </summary> /// <param name="head">费用主数据</param> /// <param name="list">费用明细数据</param> /// <returns></returns> public string UpdExpenseRecord(T_IERecord form) { bool result = false; ExceResult res = new ExceResult(); string msg = string.Empty; form.C_GUID = Session["CurrentCompanyGuid"].ToString(); form.Creator = base.userData.LoginFullName; result = new IESvc().UpdExpenseRecord(form); if (result) { res.success = true; msg = General.Resource.Common.Success; } else { res.success = false; msg = General.Resource.Common.Failed; } return(JsonConvert.SerializeObject(res)); }
/// <summary> /// 反销账 /// </summary> /// <returns></returns> /// <remarks> /// 2017/4/3 sunp update /// </remarks> public string backCancelAccount(string id, string flag) { ExceResult res = new ExceResult(); string CId = CompanyId(); bool result = new RecPayRecordSvc().backCancelAccount(id, flag); string msg = string.Empty; if (result) { msg = General.Resource.Common.Success; result = true; } else { msg = General.Resource.Common.Failed; result = false; } return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}" , result.ToString().ToLower(), msg)); }
/// <summary> /// 获取产品数量 /// </summary> public string getProductNum(string BusId, string SBusId, string typeId, string subId, string mmId) { ExceResult rs = new ExceResult(); string comanyId = Session["CurrentCompanyGuid"].ToString(); List <T_ProductBom> bom = ProductSvc.getProductNum(comanyId, BusId, SBusId, typeId, subId, mmId); if (bom != null) { rs.success = true; rs.msg = JsonConvert.SerializeObject(bom); } else { rs.success = false; rs.msg = "该产品未设置产品结构,请先设置产品结构。"; } return(JsonConvert.SerializeObject(rs)); }
/// <summary> /// 获取产品结构 /// </summary> /// <returns></returns> public string GetProductDetail(string pId) { ExceResult rs = new ExceResult(); DataTable bom = ProductSvc.ProductDetail(pId); List <ProductNode> treeNode = GetProductNoeList(bom); if (treeNode != null) { rs.success = true; rs.msg = JsonConvert.SerializeObject(treeNode); } else { rs.success = false; rs.msg = "未找到产品明细!"; } return(JsonConvert.SerializeObject(rs)); }
/// <summary> /// 保存直接物料 /// </summary> /// <param name="recordList">直接物料列表</param> /// <returns></returns> public string UpdateRecord(List <T_AIDRecord> recordList) { bool saved = false; DateTime EditThreshold = DateTime.Parse(Session["EditThreshold"].ToString()); //日期必须在Now 和 EditThreshold之间 var dateCheck = DateCheck(recordList); ExceResult res = new ExceResult(); //无符合的日期返回日期异常提示 if (dateCheck.Count == 0) { res.success = false; res.msg = FMS.Resource.Finance.Finance.DateError; return(JsonConvert.SerializeObject(res)); } foreach (T_AIDRecord aid in recordList) { aid.C_GUID = Session["CurrentCompanyGuid"].ToString(); aid.State = "库存"; saved = new AIDSvc().UpdDirectMaterialPurchasingRecord(aid); if (saved) { res.success = true; res.msg = General.Resource.Common.Success; } else { res.success = false; res.msg = General.Resource.Common.Failed; break; } } return(JsonConvert.SerializeObject(res)); }
/// <summary> /// 记录营业税金及附加 /// </summary> /// <returns></returns> public string AddSalesTaxRecord(string Amount, string Name, string Date, string Excise, string EducationFee, string Sales, string UrbanConstruction, string Resource, string LandValue, string UrbanLand, string Property, string VehicleVessel, string MineralResources, string Dischargefee) { bool result = false; ExceResult res = new ExceResult(); string msg = string.Empty; string C_GUID = Session["CurrentCompanyGuid"].ToString(); result = new IESvc().AddSalesTaxRecord(Amount, Name, Date, Excise, EducationFee, Sales, UrbanConstruction, Resource, LandValue, UrbanLand, Property, VehicleVessel, MineralResources, Dischargefee, C_GUID); if (result) { res.success = true; msg = General.Resource.Common.Success; } else { res.success = false; msg = General.Resource.Common.Failed; } return(Newtonsoft.Json.JsonConvert.SerializeObject(res)); }
/// <summary> /// 更新产品 /// </summary> /// <param name="id"></param> /// <param name="count"></param> /// <returns></returns> public string UpdateProduct(string id, string count) { ExceResult res = new ExceResult(); if (string.IsNullOrEmpty(id)) { res.success = false; res.msg = "更新数据不正确"; return(JsonConvert.SerializeObject(res)); } int newCount; if (!int.TryParse(count, out newCount)) { res.success = false; res.msg = "数量不正确"; return(JsonConvert.SerializeObject(res)); } DataTable bom = ProductSvc.UpdateProductDetail(id, newCount); List <ProductNode> treeNode = GetProductNoeList(bom); if (treeNode != null) { res.success = true; res.msg = JsonConvert.SerializeObject(treeNode); } else { res.success = false; res.msg = "未找到产品明细!"; } return(JsonConvert.SerializeObject(res)); }
/// <summary> /// 添加物料 /// </summary> /// <returns></returns> public string SubmitProductBomRecord(List <T_ProductBom> recordList) { bool saved = false; ExceResult res = new ExceResult(); foreach (T_ProductBom aid in recordList) { saved = new AIDSvc().SubmitProductBomRecord(aid); if (saved) { res.success = true; res.msg = General.Resource.Common.Success; } else { res.success = false; res.msg = General.Resource.Common.Failed; break; } } return(JsonConvert.SerializeObject(res)); }