| | |
| | | return; |
| | | } |
| | | firmAccount = _OA_FirmAccountBLL.getSingleSubject(Request["selAccountName"].ToInt32()); |
| | | var money = this.txtReciveMoney.Text.ToDecimal2(); |
| | | if (this.txtReciveMoney.Text.ToDecimal2() > 0 && firmAccount.Balance < this.txtReciveMoney.Text.ToDecimal2()) |
| | | var money = this.txtReciveMoney.Value.ToDecimal2(); |
| | | var molingmoney = this.txtMolingMoney.Value.ToDecimal2(); |
| | | if (this.txtReciveMoney.Value.ToDecimal2() > 0 && firmAccount.Balance < this.txtReciveMoney.Value.ToDecimal2()) |
| | | { |
| | | JavaScript.MessageBox("账户余额不足", this); |
| | | return; |
| | |
| | | |
| | | var id = this.Keyid.Value.ToInt32().Value; |
| | | var fukuanshenqing = _fukuanshenqingBLL.GetModelByKeyid(id); |
| | | |
| | | if (fukuanshenqing.FukuanStatus == 2 && money > 0) |
| | | { |
| | | JavaScript.MessageBox("该申请已经付款结束!", this); |
| | | return; |
| | | } |
| | | |
| | | if (money > (fukuanshenqing.Fukuanmoney - fukuanshenqing.Yishoumoney)) |
| | | { |
| | | JavaScript.MessageBox("操作金额大于剩余应付金额!", this); |
| | | return; |
| | | } |
| | | |
| | | var Youwufapiao = Request["rdoReceiveQuannbu"]; |
| | | if (fukuanshenqing.Youwufapiao == 2 && Youwufapiao == "1") |
| | | { |
| | | JavaScript.MessageBox("已经保存为有发票,无法修改为无发票!", this); |
| | | return; |
| | | } |
| | | |
| | | if (molingmoney.HasValue) |
| | | { |
| | | if ((money + molingmoney.Value) != (fukuanshenqing.Fukuanmoney - fukuanshenqing.Yishoumoney)) |
| | | { |
| | | JavaScript.MessageBox("操作金额加抹零金额必须等于剩余应付金额!", this); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | string[] Keys = fukuanshenqing.DindanId.Trim(',').Split(','); |
| | | using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, |
| | | new TransactionOptions |
| | |
| | | { |
| | | fukuanshenqing.FukuanStatus = 2; |
| | | } |
| | | if (molingmoney.HasValue) |
| | | { |
| | | if ((money + molingmoney.Value) >= (fukuanshenqing.Fukuanmoney - fukuanshenqing.Yishoumoney)) |
| | | { |
| | | fukuanshenqing.FukuanStatus = 2; |
| | | } |
| | | } |
| | | fukuanshenqing.Yishoumoney = yishoumoney + money; |
| | | fukuanshenqing.Updater = CurrentUser.ShortName; |
| | | fukuanshenqing.LastUpdateTime = DateTime.Now; |
| | | fukuanshenqing.Youwufapiao = Youwufapiao.ToInt32(); |
| | | ssss = _fukuanshenqingBLL.UpdateModel(fukuanshenqing); |
| | | if(this.txtReciveMoney.Text.ToDecimal2() > 0) |
| | | if(this.txtReciveMoney.Value.ToDecimal2() > 0) |
| | | { |
| | | decimal molingmoneyvalue = 0; |
| | | if (molingmoney.HasValue) |
| | | { |
| | | molingmoneyvalue = molingmoney.Value; |
| | | } |
| | | foreach (var item in Keys) |
| | | { |
| | | if (!string.IsNullOrEmpty(item)) |
| | |
| | | firmAccountRecord.AccountId = Request["selAccountName"].ToInt32(); |
| | | firmAccountRecord.LastUpdateTime = DateTime.Now; |
| | | firmAccountRecord.Money = orderBasic.UnPayedMoney; |
| | | var UnPayedMoney = orderBasic.UnPayedMoney; |
| | | if (molingmoneyvalue > 0) |
| | | { |
| | | if (UnPayedMoney >= molingmoneyvalue) |
| | | { |
| | | |
| | | firmAccountRecord.Money = UnPayedMoney - molingmoneyvalue; |
| | | molingmoneyvalue = 0; |
| | | } |
| | | else |
| | | { |
| | | firmAccountRecord.Money = 0; |
| | | molingmoneyvalue = molingmoneyvalue - UnPayedMoney; |
| | | |
| | | } |
| | | |
| | | } |
| | | orderNo = orderBasic.SellerOrderId; |
| | | firmAccountRecord.OperationalMatters = "外协付款" + "(" + orderNo + ")"; |
| | | firmAccountRecord.Operator = CurrentUser.ShortName; |
| | |
| | | |
| | | this.spanAllMoney.InnerText = "¥" + AllMoney.Value.ToString("0.00"); |
| | | this.spanReceiveMoney.InnerText = "¥" + ReceiveMoney.Value.ToString("0.00"); |
| | | this.txtReciveMoney.Text = ReceiveMoney.Value.ToString("0.00"); |
| | | this.hidReceiveMoney.Value = ReceiveMoney.Value.ToString(); |
| | | this.txtReciveMoney.Value = ReceiveMoney.Value.ToString("0.00"); |
| | | this.spanCountRe.InnerHtml = Keys.Count().ToString2() + " 单"; |
| | | } |
| | | |