From 72b668c965a3f5308d1a388296eb4c3f8fb7be72 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期五, 12 九月 2025 08:46:01 +0800
Subject: [PATCH] 批量入库,操作成功关闭窗口 完成
---
CY_ECommercePlatform/CY.WebForm/Pages/financial/WaixieExpenses.aspx.cs | 85 +++++++++++++++++++++++++++++++++++++-----
1 files changed, 74 insertions(+), 11 deletions(-)
diff --git a/CY_ECommercePlatform/CY.WebForm/Pages/financial/WaixieExpenses.aspx.cs b/CY_ECommercePlatform/CY.WebForm/Pages/financial/WaixieExpenses.aspx.cs
index f826db9..26592f9 100644
--- a/CY_ECommercePlatform/CY.WebForm/Pages/financial/WaixieExpenses.aspx.cs
+++ b/CY_ECommercePlatform/CY.WebForm/Pages/financial/WaixieExpenses.aspx.cs
@@ -23,6 +23,8 @@
OA_FirmAccount firmAccount = null;
OA_FukuanshenqingBLL _fukuanshenqingBLL = null;
OA_SuppliersBLL oA_SuppliersBLL = null;
+ OA_StaffBLL staffBLL = null;
+ OA_BaozhengjinBLL oA_BaozhengjinBLL = null;
public WaixieExpenses()
{
@@ -34,6 +36,8 @@
firmAccountRecord = new OA_FirmAccountRecord();
_fukuanshenqingBLL = new OA_FukuanshenqingBLL();
oA_SuppliersBLL = new OA_SuppliersBLL();
+ staffBLL = new OA_StaffBLL();
+ oA_BaozhengjinBLL = new OA_BaozhengjinBLL();
}
protected void Page_Load(object sender, EventArgs e)
@@ -87,15 +91,10 @@
}
else
{
- if (fukuanshenqing.SupplierId > 0)
- {
- var oA_Suppliers = oA_SuppliersBLL.getSingleSupplier(fukuanshenqing.SupplierId.ToString());
- if (oA_Suppliers != null)
- {
- this.txtPaymentUnit.Value = oA_Suppliers.Name;
- this.txtSupplierId.Value = oA_Suppliers.Keyid.ToString();
- }
- }
+ this.txtPaymentUnit.Value = fukuanshenqing.SupplierName;
+ this.txtSupplierId.Value = fukuanshenqing.SupplierId.ToString();
+
+
}
@@ -123,10 +122,11 @@
{
var id = this.Keyid.Value.ToInt32().Value;
var money = this.txtMoney.Value.ToDecimal2().Value;
+ var molingmoney = this.txtMolingMoney.Value.ToDecimal2();
var Youwufapiao = Request["rdoReceiveQuannbu"];
var fukuanshenqing = _fukuanshenqingBLL.GetModelByKeyid(id);
- if (fukuanshenqing.FukuanStatus == 2 && money>0)
+ if (fukuanshenqing.FukuanStatus == 2 && money > 0)
{
JavaScript.MessageBox("璇ョ敵璇峰凡缁忎粯娆剧粨鏉燂紒", this);
return;
@@ -136,6 +136,16 @@
{
JavaScript.MessageBox("鎿嶄綔閲戦澶т簬鍓╀綑搴斾粯閲戦锛�", this);
return;
+ }
+
+
+ if (molingmoney.HasValue && molingmoney.Value > 0)
+ {
+ if((money + molingmoney.Value ) != (fukuanshenqing.Fukuanmoney - fukuanshenqing.Yishoumoney))
+ {
+ JavaScript.MessageBox("鎿嶄綔閲戦鍔犳姽闆堕噾棰濆繀椤荤瓑浜庡墿浣欏簲浠橀噾棰濓紒", this);
+ return;
+ }
}
if (fukuanshenqing.Youwufapiao == 2 && Youwufapiao == "1")
@@ -156,11 +166,20 @@
try
{
var yishoumoney = fukuanshenqing.Yishoumoney.HasValue ? fukuanshenqing.Yishoumoney.Value : 0;
- fukuanshenqing.Yishoumoney = yishoumoney + money;
if (money >= (fukuanshenqing.Fukuanmoney - fukuanshenqing.Yishoumoney))
{
fukuanshenqing.FukuanStatus = 2;
}
+
+ if (molingmoney.HasValue && molingmoney.Value > 0)
+ {
+ 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();
@@ -186,12 +205,56 @@
firmAccount.AllExpenses = this.txtMoney.Value.ToDecimal2() + firmAccount.AllExpenses;
firmAccount.Balance = firmAccount.Balance - this.txtMoney.Value.ToDecimal2();
sddd = _OA_FirmAccountRecordBLL.AddModel(firmAccountRecord, firmAccount);
+
+ if (!string.IsNullOrEmpty(this.selSubject.Value))
+ {
+ var oA_SubjectSet = _OA_SubjectSetBLL.getSingleSubject(firmAccountRecord.SubjectId);
+ if (oA_SubjectSet.SubjectName.IndexOf("鎶曟爣淇濊瘉閲�") >= 0 || oA_SubjectSet.SubjectName.IndexOf("灞ョ害淇濊瘉閲�") >= 0)
+ {
+ //濡傛灉閫夋嫨绉戠洰鏄繚璇侀噾锛屾彃鍏ヤ互鏉′繚璇侀噾鏁版嵁
+ OA_Baozhengjin oA_Baozhengjin = new OA_Baozhengjin();
+ oA_Baozhengjin.FirmId = CurrentUser.MemberId;
+ oA_Baozhengjin.FukuanTime = DateTime.Now;
+
+ oA_Baozhengjin.Zhanghuleixing = this.selAcoountType.Value;
+
+ var ss = _Sys_DictionaryBLL.GetDataByType("璐︽埛绫诲瀷").FirstOrDefault(x => x.Name == oA_Baozhengjin.Zhanghuleixing);
+ if (ss != null)
+ {
+ oA_Baozhengjin.ReceiveWay = ss.Keyid;
+ }
+
+ oA_Baozhengjin.Account = Request["selAccountName"].ToInt32();
+ oA_Baozhengjin.Fukuanzhanghu = firmAccount.AccountName + "-" + firmAccount.UserName;
+ oA_Baozhengjin.Subject = firmAccountRecord.SubjectId;
+ oA_Baozhengjin.Fukuankemu = oA_SubjectSet.SubjectName;
+ oA_Baozhengjin.Fukuanmoney = firmAccountRecord.Money;
+ oA_Baozhengjin.Shoukuandanwei = firmAccountRecord.PaymentUnit;
+ oA_Baozhengjin.remark = firmAccountRecord.OperationalMatters;
+ oA_Baozhengjin.TuikuanTime = null;
+
+ oA_Baozhengjin.TuikuanStatus = 1;
+ oA_Baozhengjin.Creater = CurrentUser.ShortName;
+ oA_Baozhengjin.CreateTime = oA_Baozhengjin.FukuanTime;
+ oA_Baozhengjin.Updater = CurrentUser.ShortName;
+ oA_Baozhengjin.LastUpdateTime = oA_Baozhengjin.FukuanTime;
+ oA_Baozhengjin.MemberName = fukuanshenqing.Creater;
+
+ var oA_Staff = staffBLL.SelectListByFirmId(CurrentUser.MemberId, false, false).Where(x => x.Name == oA_Baozhengjin.MemberName).FirstOrDefault();
+ oA_Baozhengjin.MemberId = oA_Staff.Keyid;
+
+ var sss = oA_BaozhengjinBLL.InsertModel(oA_Baozhengjin);
+
+ }
+ }
}
if (sddd)
{
+
+
scope.Complete();
JavaScript.MessageBox("浠樻鎴愬姛", this, true, true);
}
--
Gitblit v1.9.1