From cffef136c5d15764cd58c546418ab05fd1f18f7b Mon Sep 17 00:00:00 2001 From: ddlucky Date: Mon, 26 Feb 2024 14:42:36 +0800 Subject: [PATCH 1/2] 1 --- DSWeb/Areas/Account/DAL/Chfee_settlement/Chfee_SettlementDAL.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DSWeb/Areas/Account/DAL/Chfee_settlement/Chfee_SettlementDAL.cs b/DSWeb/Areas/Account/DAL/Chfee_settlement/Chfee_SettlementDAL.cs index a515eb13..f27e723c 100644 --- a/DSWeb/Areas/Account/DAL/Chfee_settlement/Chfee_SettlementDAL.cs +++ b/DSWeb/Areas/Account/DAL/Chfee_settlement/Chfee_SettlementDAL.cs @@ -2995,7 +2995,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement } var strSql = new StringBuilder(); strSql.Append("SELECT *" + - ",AMOUNT-DOAMOUNT AS BALAMOUNT,AMOUNTOT-OTDOAMOUNT AS OTBALAMOUNT" + + ",AMOUNT-DOAMOUNT AS BALAMOUNT,OTAMOUNT-OTDOAMOUNT AS OTBALAMOUNT" + ",USDAMOUNT-USDDOAMOUNT AS USDBALAMOUNT FROM " + "(SELECT GID,BILLNO,BILLSTATUS,CUSTOMERNAME,CURR,CHEQUEPAYABLE,SETTLETYPE "); strSql.Append(" ,PAYABLETIME,RATE,AMOUNTRMB AMOUNT,ISNULL(AMOUNTOT,0) OTAMOUNT,ISNULL(AMOUNTUSD,0) USDAMOUNT");//AMOUNT OTAMOUNT USDAMOUNT From c9be8b756e3914885062f6ded9eaccb0545cc30a Mon Sep 17 00:00:00 2001 From: ddlucky Date: Mon, 26 Feb 2024 17:05:18 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=94=B6=E8=B4=B9=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E4=B9=9F=E5=A2=9E=E5=8A=A0=E6=8C=89=E5=B8=81=E5=88=AB=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DSWeb.Common/DB/Comm.cs | 42 +++++++++ DSWeb.Common/DB/CommonDataContext.cs | 3 +- .../Chfee_RecvapplicationDAL.cs | 32 ++++++- .../Chfee_settlement/Chfee_SettlementDAL.cs | 27 +++++- .../Chfee_settlement/Chfee_Paysettlement.cs | 22 +++-- .../Chfee_do_detail/Chfee_do_detailModel.js | 8 +- .../ChRecvAppBLsettlementEdit.js | 94 ++++++++++++++++++- DSWeb/DSWeb.csproj.user | 2 +- 8 files changed, 211 insertions(+), 19 deletions(-) diff --git a/DSWeb.Common/DB/Comm.cs b/DSWeb.Common/DB/Comm.cs index a323bf80..fe255a92 100644 --- a/DSWeb.Common/DB/Comm.cs +++ b/DSWeb.Common/DB/Comm.cs @@ -1197,6 +1197,48 @@ namespace DSWeb.Common.DB public DateTime? PRINTTIME { get; set; } } + + [Table("ch_fee_recvapplication")] + + public partial class ch_fee_recvapplication_md + { + [Key] + public string GID { get; set; } + public string BILLNO { get; set; } + public int? BILLSTATUS { get; set; } + public string CUSTOMERNAME { get; set; } + public string INVOICETITLE { get; set; } + public int? SETTLETYPE { get; set; } + public DateTime? RECVTIME { get; set; } + public decimal? AMOUNTRMB { get; set; } + public decimal? AMOUNTUSD { get; set; } + public decimal? RATE { get; set; } + public decimal? SETTLERMB { get; set; } + public decimal? SETTLEUSD { get; set; } + public decimal? SETTLERATE { get; set; } + public string APPLICANT { get; set; } + public DateTime? APPLYTIME { get; set; } + public DateTime? ENTERTIME { get; set; } + public string SETTLEUSER { get; set; } + public DateTime? SETTLETIME { get; set; } + public string AUDITUSER { get; set; } + public DateTime? AUDITTIME { get; set; } + public string REMARK { get; set; } + public bool? ISDELETE { get; set; } + public string DELETEUSER { get; set; } + public DateTime? DELETETIME { get; set; } + public string INVOICENUMREMARK { get; set; } + public string COMPANYID { get; set; } + public string CURR { get; set; } + public decimal? PREAMOUNTRMB { get; set; } + public decimal? PREAMOUNTUSD { get; set; } + public string ACCOUNT { get; set; } + public string SALECORPID { get; set; } + public int? PRINTCOUNT { get; set; } + } + + + [Table("company")] public class company_md { diff --git a/DSWeb.Common/DB/CommonDataContext.cs b/DSWeb.Common/DB/CommonDataContext.cs index b794de50..f4039f97 100644 --- a/DSWeb.Common/DB/CommonDataContext.cs +++ b/DSWeb.Common/DB/CommonDataContext.cs @@ -49,7 +49,8 @@ namespace DSWeb.Common.DB public DbSet ch_fee_do { get; set; } public DbSet ch_fee_payapplication { get; set; } - + public DbSet ch_fee_recvapplication { get; set; } + public DbSet company { get; set; } diff --git a/DSWeb/Areas/Account/DAL/Chfee_recvapplication/Chfee_RecvapplicationDAL.cs b/DSWeb/Areas/Account/DAL/Chfee_recvapplication/Chfee_RecvapplicationDAL.cs index 6d109863..019ca565 100644 --- a/DSWeb/Areas/Account/DAL/Chfee_recvapplication/Chfee_RecvapplicationDAL.cs +++ b/DSWeb/Areas/Account/DAL/Chfee_recvapplication/Chfee_RecvapplicationDAL.cs @@ -16,6 +16,8 @@ using DSWeb.Areas.CommMng.DAL; using DSWeb.Areas.Account.Models.ChfeeDetail; using DSWeb.MvcShipping.DAL.MsSysParamSet; using DSWeb.MvcShipping.DAL.MsBaseInfoDAL; +using DSWeb.Common.DB; +using System.Linq; namespace DSWeb.Areas.Account.DAL.Chfee_Recvapplication { @@ -1196,10 +1198,32 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Recvapplication #region 提交审核和撤销审核 + public static DBResult CanSubmit(string bill) + { + var result = new DBResult(); + var cdc = new CommonDataContext(); + var head = cdc.ch_fee_recvapplication.First(x => x.BILLNO == bill); + if (string.IsNullOrWhiteSpace(head.CURR)) + { + result.SetErrorInfo("必须选择币别"); + } + else { + result.OK(); + } + + + return result; + } public static DBResult SubmitAudit(String WorkFlowName, String USERID, String bill) { + + + var result = new DBResult(); + result = CanSubmit(bill); + if (!result.Success) return result; + Database db = DatabaseFactory.CreateDatabase(); using (var conn = db.CreateConnection()) { @@ -1209,7 +1233,6 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Recvapplication try { - var cmdupdate = db.GetSqlStringCommand("update ch_fee_recvapplication set BILLSTATUS=2 where BILLNO=@BILLNO"); @@ -1247,6 +1270,13 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Recvapplication var result = new DBResult(); var billList = bills.Split(','); + foreach (var bill in billList) + { + result = CanSubmit(bill); + if (!result.Success) return result; + } + + Database db = DatabaseFactory.CreateDatabase(); using (var conn = db.CreateConnection()) { diff --git a/DSWeb/Areas/Account/DAL/Chfee_settlement/Chfee_SettlementDAL.cs b/DSWeb/Areas/Account/DAL/Chfee_settlement/Chfee_SettlementDAL.cs index f27e723c..97fbb56b 100644 --- a/DSWeb/Areas/Account/DAL/Chfee_settlement/Chfee_SettlementDAL.cs +++ b/DSWeb/Areas/Account/DAL/Chfee_settlement/Chfee_SettlementDAL.cs @@ -3002,9 +3002,9 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement strSql.Append(" ,APPLICANT,APPLYTIME,ENTERTIME,SETTLEUSER,SETTLETIME "); strSql.Append(",(select STLNAME from [code_stlmode] where STLCODE=cm.SETTLETYPE) as SETTLETYPEREF"); strSql.Append(" ,REMARK,COMPANYID,SALECORPID,(select [NAME] from [company] where GID=cm.SALECORPID) as SALECORP "); - strSql.Append(",(select SUM(CASE FEETYPE WHEN 1 THEN -DOAMOUNT ELSE DOAMOUNT END) from ch_fee_do where CURRENCY='RMB' AND BILLNO=cm.BILLNO) as DOAMOUNT "); - strSql.Append(",(select SUM(CASE FEETYPE WHEN 1 THEN -DOAMOUNT ELSE DOAMOUNT END) from ch_fee_do where CURRENCY='USD' AND BILLNO=cm.BILLNO) as USDDOAMOUNT "); - strSql.Append(",(select SUM(CASE FEETYPE WHEN 1 THEN -DOAMOUNT ELSE DOAMOUNT END) from ch_fee_do where CURRENCY<>'USD' and CURRENCY<>'RMB' AND BILLNO=cm.BILLNO) as OTDOAMOUNT "); + strSql.Append(",isnull((select SUM(CASE FEETYPE WHEN 1 THEN -DOAMOUNT ELSE DOAMOUNT END) from ch_fee_do where CURRENCY='RMB' AND BILLNO=cm.BILLNO),0) as DOAMOUNT "); + strSql.Append(",isnull((select SUM(CASE FEETYPE WHEN 1 THEN -DOAMOUNT ELSE DOAMOUNT END) from ch_fee_do where CURRENCY='USD' AND BILLNO=cm.BILLNO),0) as USDDOAMOUNT "); + strSql.Append(",isnull((select SUM(CASE FEETYPE WHEN 1 THEN -DOAMOUNT ELSE DOAMOUNT END) from ch_fee_do where CURRENCY<>'USD' and CURRENCY<>'RMB' AND BILLNO=cm.BILLNO),0) as OTDOAMOUNT "); strSql.Append(",(select EnumValueName from tSysEnumValue where LangId=0 and EnumTypeID=97005 and EnumValueID=cm.BILLSTATUS) as BILLSTATUSREF"); strSql.Append(",(select ShowName from [user] where GID=cm.APPLICANT) as APPLICANTNAME"); strSql.Append(",CUSTACCOUNTGID"); @@ -3977,10 +3977,13 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement strSql.Append(" SELECT GID,BILLNO,BILLSTATUS,CUSTOMERNAME,CURR,INVOICETITLE,SETTLETYPE "); strSql.Append(" ,RECVTIME,AMOUNTRMB,RATE,AMOUNTUSD,SETTLERMB,SETTLEUSD,SETTLERATE"); + + strSql.Append(" ,APPLICANT,APPLYTIME,ENTERTIME,SETTLEUSER,SETTLETIME,AUDITUSER,AUDITTIME "); strSql.Append(" ,REMARK,COMPANYID,INVOICENUMREMARK "); - strSql.Append(",(select SUM(CASE FEETYPE WHEN 2 THEN -DOAMOUNT ELSE DOAMOUNT END) from ch_fee_do where CURRENCY='RMB' AND BILLNO=cm.BILLNO) as RMBDOAMOUNT "); - strSql.Append(",(select SUM(CASE FEETYPE WHEN 2 THEN -DOAMOUNT ELSE DOAMOUNT END) from ch_fee_do where CURRENCY='USD' AND BILLNO=cm.BILLNO) as USDDOAMOUNT "); + strSql.Append(",isnull((select SUM(CASE FEETYPE WHEN 2 THEN -DOAMOUNT ELSE DOAMOUNT END) from ch_fee_do where CURRENCY='RMB' AND BILLNO=cm.BILLNO),0) as RMBDOAMOUNT "); + strSql.Append(",isnull((select SUM(CASE FEETYPE WHEN 2 THEN -DOAMOUNT ELSE DOAMOUNT END) from ch_fee_do where CURRENCY='USD' AND BILLNO=cm.BILLNO),0) as USDDOAMOUNT "); + strSql.Append(",(select EnumValueName from tSysEnumValue where LangId=0 and EnumTypeID=97005 and EnumValueID=cm.BILLSTATUS) as BILLSTATUSREF"); strSql.Append(",(select ShowName from [user] where GID=cm.APPLICANT) as APPLICANTNAME"); strSql.Append(",cm.SALECORPID,(select [NAME] from [company] where GID=cm.SALECORPID) as SALECORP"); @@ -4022,6 +4025,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement data.AMOUNT = Convert.ToDecimal(reader["AMOUNTRMB"]); if (reader["AMOUNTUSD"] != DBNull.Value) data.USDAMOUNT = Convert.ToDecimal(reader["AMOUNTUSD"]); + if (reader["RMBDOAMOUNT"] != DBNull.Value) data.DOAMOUNT = Convert.ToDecimal(reader["RMBDOAMOUNT"]); if (reader["USDDOAMOUNT"] != DBNull.Value) @@ -4032,6 +4036,19 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement data.USDBALAMOUNT = data.USDAMOUNT - data.USDDOAMOUNT; data.USDSTLAMOUNT = data.USDAMOUNT - data.USDDOAMOUNT; + if (data.CURR != "RMB" && data.CURR != "USD") + { + data.OTAMOUNT = data.USDAMOUNT; + data.OTDOAMOUNT = data.USDDOAMOUNT; + data.OTBALAMOUNT = data.USDBALAMOUNT; + data.OTSTLAMOUNT = data.USDSTLAMOUNT; + + data.USDAMOUNT = 0; + data.USDDOAMOUNT = 0; + data.USDBALAMOUNT = 0; + data.USDSTLAMOUNT = 0; + } + data.APPLICANT = Convert.ToString(reader["APPLICANT"]); data.APPLICANTNAME = Convert.ToString(reader["APPLICANTNAME"]); if (reader["APPLYTIME"] != DBNull.Value) diff --git a/DSWeb/Areas/Account/Models/Chfee_settlement/Chfee_Paysettlement.cs b/DSWeb/Areas/Account/Models/Chfee_settlement/Chfee_Paysettlement.cs index 109e543b..67257a0b 100644 --- a/DSWeb/Areas/Account/Models/Chfee_settlement/Chfee_Paysettlement.cs +++ b/DSWeb/Areas/Account/Models/Chfee_settlement/Chfee_Paysettlement.cs @@ -26,6 +26,12 @@ namespace DSWeb.Areas.Account.Models.Chfee_Settlement private decimal _usddoamount = 0; private decimal _usdstlamount = 0; private decimal _usdbalamount = 0; + + private decimal _otamount = 0; + private decimal _otdoamount = 0; + private decimal _otstlamount = 0; + private decimal _otbalamount = 0; + private decimal _exchangerate = 0; private string _applicant;// private string _applicantname;// @@ -146,25 +152,25 @@ namespace DSWeb.Areas.Account.Models.Chfee_Settlement public decimal OTAMOUNT { - get { return _usdamount; } - set { _usdamount = value; } + get { return _otamount; } + set { _otamount = value; } } public decimal OTDOAMOUNT { - get { return _usddoamount; } - set { _usddoamount = value; } + get { return _otdoamount; } + set { _otdoamount = value; } } public decimal OTSTLAMOUNT { - get { return _usdstlamount; } - set { _usdstlamount = value; } + get { return _otstlamount; } + set { _otstlamount = value; } } public decimal OTBALAMOUNT { - get { return _usdbalamount; } - set { _usdbalamount = value; } + get { return _otbalamount; } + set { _otbalamount = value; } } public decimal EXCHANGERATE { diff --git a/DSWeb/Areas/Account/Viewsjs/Chfee_do_detail/Chfee_do_detailModel.js b/DSWeb/Areas/Account/Viewsjs/Chfee_do_detail/Chfee_do_detailModel.js index 602ff022..c7f3b236 100644 --- a/DSWeb/Areas/Account/Viewsjs/Chfee_do_detail/Chfee_do_detailModel.js +++ b/DSWeb/Areas/Account/Viewsjs/Chfee_do_detail/Chfee_do_detailModel.js @@ -359,7 +359,13 @@ Ext.define('Payapplication_do_detail', { { name: 'USDAMOUNT', type: 'number' }, { name: 'USDDOAMOUNT', type: 'number' }, { name: 'USDBALAMOUNT', type: 'number' }, - { name: 'USDSTLAMOUNT', type: 'number' }, + { name: 'USDSTLAMOUNT', type: 'number' }, + + { name: 'OTAMOUNT', type: 'number' }, + { name: 'OTDOAMOUNT', type: 'number' }, + { name: 'OTBALAMOUNT', type: 'number' }, + { name: 'OTSTLAMOUNT', type: 'number' }, + { name: 'ORIGCURRENCY', type: 'string' }, { name: 'ORIGAMOUNT', type: 'number' }, { name: 'EXCHANGERATE', type: 'number' }, diff --git a/DSWeb/Areas/Account/Viewsjs/Chfee_settlement/ChRecvAppBLsettlementEdit.js b/DSWeb/Areas/Account/Viewsjs/Chfee_settlement/ChRecvAppBLsettlementEdit.js index 0693aa91..678d2fc6 100644 --- a/DSWeb/Areas/Account/Viewsjs/Chfee_settlement/ChRecvAppBLsettlementEdit.js +++ b/DSWeb/Areas/Account/Viewsjs/Chfee_settlement/ChRecvAppBLsettlementEdit.js @@ -886,6 +886,11 @@ Ext.extend(Shipping.MsChRecvAppSettlementEdit, Ext.Panel, { dataIndex: 'CUSTOMERNAME', header: Zi.LAN.CustomerName, width: 80 + }, { + sortable: true, + dataIndex: 'CURR', + header: Zi.LAN.Currency, + width: 60 }, { sortable: true, dataIndex: 'AMOUNT', @@ -1073,7 +1078,92 @@ Ext.extend(Shipping.MsChRecvAppSettlementEdit, Ext.Panel, { return value; }, width: 100 - }, { + }, { + sortable: true, + dataIndex: 'OTAMOUNT', + header: Zi.LAN.OTApplyMoney, + width: 100, + renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { + try { + var lsValue = usMoney(value, 2, '', false); + if (lsValue != "NaN") { + value = lsValue; if (parseFloat(lsValue) < 0) { + return '' + lsValue + ''; + } + } + else { + return value; + } + } + catch (e) { + return value; + } + return value; + } + }, { + sortable: true, + dataIndex: 'OTBALAMOUNT', + header: Zi.LAN.OTBalaMount, + width: 100, + renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { + try { + var lsValue = usMoney(value, 2, '', false); + if (lsValue != "NaN") { + value = lsValue; if (parseFloat(lsValue) < 0) { + return '' + lsValue + ''; + } + } + else { + return value; + } + } + catch (e) { + return value; + } + return value; + } + }, { + sortable: true, + dataIndex: 'OTSTLAMOUNT', + header: Zi.LAN.OTStlaMount, + editor: { + xtype: 'numberfield', + keyNavEnabled: false, + allowDecimals: true, + decimalPrecision: 2, + selectOnFocus: true, + mouseWheelEnabled: false, + enableKeyEvents: true, + listeners: { + keydown: function (textfield, e) { + if (e.getKey() == 40) { + _this.onNextKeyClick(8) + } else if (e.getKey() == 38) { + _this.onUpKeyClick(8) + } + } + + } + }, + renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { + try { + var lsValue = usMoney(value, 2, '', false); + if (lsValue != "NaN") { + value = lsValue; if (parseFloat(lsValue) < 0) { + return '' + lsValue + ''; + } + } + else { + return value; + } + } + catch (e) { + return value; + } + return value; + }, + width: 100 + }, { sortable: true, dataIndex: 'APPLYTIME', header: Zi.LAN.ApplyTime, @@ -4260,7 +4350,7 @@ Ext.extend(Shipping.MsChRecvAppSettlementEdit, Ext.Panel, { //#endregion - + // onSubmitAuditClick: function () { var Duino = this.formEdit.getForm().findField('BILLNO').getValue(); diff --git a/DSWeb/DSWeb.csproj.user b/DSWeb/DSWeb.csproj.user index 430b3149..a964372c 100644 --- a/DSWeb/DSWeb.csproj.user +++ b/DSWeb/DSWeb.csproj.user @@ -4,7 +4,7 @@ ShowAllFiles D:\DS7_JingHan\DSWeb\Properties\PublishProfiles\FolderProfile.pubxml true - Release|Any CPU + Debug|Any CPU