| | |
| | | ViewBag.accounttype = _liaotianService.GetSYScode("fi_account", "accounttype"); |
| | | ViewBag.FiSubject = _ifiSubjectService.GetList().Where(x => x.Subjecttype == "01").ToList(); |
| | | |
| | | |
| | | |
| | | |
| | | ViewBag.cooperatecustomCustomerDTO = _cooperatecustomCustomerService.Get(cooperOrderDTO.Khdw); |
| | | |
| | | ViewData.Model = dto; |
| | | return View(); |
| | |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["curentuser"] = curentuser; |
| | | using (TransactionScope scope = new TransactionScope()) |
| | | using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, |
| | | new TransactionOptions |
| | | { |
| | | IsolationLevel = IsolationLevel.ReadCommitted, |
| | | Timeout = TransactionManager.MaximumTimeout |
| | | } |
| | | )) |
| | | { |
| | | data.RecStatus = "A"; |
| | | if (String.IsNullOrEmpty(data.Id)) |
| | |
| | | } |
| | | data.Modifier = curentuser.Id; |
| | | data.Modifytime = DateTime.Now; |
| | | |
| | | resultEntity = _fiOrderrecievemoneyService.save(data); |
| | | CooperOrderDTO cooperOrderDTO = _cooperOrderService.Get(data.OrderId); |
| | | CooperatecustomCustomerDTO cooperatecustomCustomerDTO = _cooperatecustomCustomerService.Get(cooperOrderDTO.Khdw); |
| | | FiAccountRecordDTO data1 = new FiAccountRecordDTO(); |
| | | data1.RecStatus = "A"; |
| | | data1.Creater = curentuser.Id; |
| | | data1.Createtime = DateTime.Now; |
| | | data1.Modifier = curentuser.Id; |
| | | data1.Modifytime = DateTime.Now; |
| | | data1.SubjectId = data.SubjectId; |
| | | if (data.PayType == "03") |
| | | { |
| | | if(data.Recievemoney>((cooperatecustomCustomerDTO.Yufukuan ?? 0)+ (cooperatecustomCustomerDTO.Shouxinedu ?? 0) - (cooperatecustomCustomerDTO.Shenyushouxin ?? 0))) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "剩余预付款和剩余授信不足!"; |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | else |
| | | { |
| | | if (data.Recievemoney > (cooperatecustomCustomerDTO.Yufukuan??0)) |
| | | { |
| | | cooperatecustomCustomerDTO.Shenyushouxin = data.Recievemoney - (cooperatecustomCustomerDTO.Yufukuan??0); |
| | | if (cooperatecustomCustomerDTO.Shenyushouxin> (cooperatecustomCustomerDTO.Shouxinedu??0)) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "剩余授信不足!"; |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | cooperatecustomCustomerDTO.Yufukuan = 0; |
| | | |
| | | } |
| | | else |
| | | { |
| | | cooperatecustomCustomerDTO.Yufukuan = cooperatecustomCustomerDTO.Yufukuan - data.Recievemoney; |
| | | } |
| | | resultEntity = _cooperatecustomCustomerService.saveyufukuan(cooperatecustomCustomerDTO); |
| | | } |
| | | } |
| | | |
| | | |
| | | data1.AccountId = data.AccountId; |
| | | data1.Money = data.Recievemoney; |
| | | data1.PaymentUnit = cooperatecustomCustomerDTO.Name; |
| | | data1.OperationalMatters = "订单收款"+ cooperOrderDTO.OrderNo; |
| | | resultEntity = _fiOrderrecievemoneyService.save(data); |
| | | if (data.PayType != "03") |
| | | { |
| | | FiAccountRecordDTO data1 = new FiAccountRecordDTO(); |
| | | data1.RecStatus = "A"; |
| | | data1.Creater = curentuser.Id; |
| | | data1.Createtime = DateTime.Now; |
| | | data1.Modifier = curentuser.Id; |
| | | data1.Modifytime = DateTime.Now; |
| | | data1.SubjectId = data.SubjectId; |
| | | |
| | | data1.AccountId = data.AccountId; |
| | | data1.Money = data.Recievemoney; |
| | | data1.PaymentUnit = cooperatecustomCustomerDTO.Name; |
| | | data1.OperationalMatters = "订单收款" + cooperOrderDTO.OrderNo; |
| | | |
| | | |
| | | FiAccountDTO firmAccount = _fiAccountService.Get(data1.AccountId); |
| | | |
| | | |
| | | data1.RecordTypeId = "1";//收入 |
| | | data1.Department = ""; |
| | | |
| | | |
| | | |
| | | FiAccountDTO firmAccount = _fiAccountService.Get(data1.AccountId); |
| | | firmAccount.AllIncome = (firmAccount.AllIncome ?? 0) + data1.Money; |
| | | firmAccount.Balance = (firmAccount.Balance ?? 0) + data1.Money; |
| | | |
| | | data1.AccountMoney = firmAccount.Balance; |
| | | resultEntity = _iFiAccountRecordService.save(data1); |
| | | resultEntity = _fiAccountService.save(firmAccount); |
| | | } |
| | | |
| | | data1.RecordTypeId = "1";//收入 |
| | | data1.Department = ""; |
| | | |
| | | |
| | | |
| | | firmAccount.AllIncome = (firmAccount.AllIncome ?? 0) + data1.Money; |
| | | firmAccount.Balance = (firmAccount.Balance ?? 0) + data1.Money; |
| | | |
| | | data1.AccountMoney = firmAccount.Balance; |
| | | resultEntity = _iFiAccountRecordService.save(data1); |
| | | resultEntity = _fiAccountService.save(firmAccount); |
| | | |
| | | scope.Complete(); |
| | | } |
| | | |
| | |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["curentuser"] = curentuser; |
| | | using (TransactionScope scope = new TransactionScope()) |
| | | using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, |
| | | new TransactionOptions |
| | | { |
| | | IsolationLevel = IsolationLevel.ReadCommitted, |
| | | Timeout = TransactionManager.MaximumTimeout |
| | | } |
| | | )) |
| | | { |
| | | data.RecStatus = "A"; |
| | | if (String.IsNullOrEmpty(data.Id)) |
| | |
| | | |
| | | resultEntity = _fiCustomerrecievemoneyService.save(data); |
| | | CooperatecustomCustomerDTO cooperatecustomCustomerDTO = _cooperatecustomCustomerService.Get(data.CustomerId); |
| | | if (cooperatecustomCustomerDTO.Shenyushouxin.HasValue) |
| | | { |
| | | if(data.Recievemoney.Value> cooperatecustomCustomerDTO.Shenyushouxin.Value) |
| | | { |
| | | data.Recievemoney = data.Recievemoney.Value - cooperatecustomCustomerDTO.Shenyushouxin.Value; |
| | | cooperatecustomCustomerDTO.Shenyushouxin = 0; |
| | | } |
| | | else |
| | | { |
| | | cooperatecustomCustomerDTO.Shenyushouxin = cooperatecustomCustomerDTO.Shenyushouxin.Value - data.Recievemoney.Value; |
| | | data.Recievemoney = 0; |
| | | } |
| | | } |
| | | |
| | | if(cooperatecustomCustomerDTO.Yufukuan.HasValue) |
| | | cooperatecustomCustomerDTO.Yufukuan = cooperatecustomCustomerDTO.Yufukuan.Value + data.Recievemoney.Value; |
| | | else |