diff --git a/TradeManageNew/DataNew.cs b/TradeManageNew/DataNew.cs index 973f6ca..4863361 100644 --- a/TradeManageNew/DataNew.cs +++ b/TradeManageNew/DataNew.cs @@ -31544,7 +31544,7 @@ select @id"; public static List GetListCustomFee(string where, int PageIndex, int PageSize, string Sort, out int RowCount) { QueryService2 ser = new QueryService2(); - ser.Tsql = "select id=cast(a.id as int),a.customname,a.htdate,a.htcode,a.yjprice,a.rmbprice,a.usdprice,a.njprice,a.hyprice,a.hlrate,a.llrate,a.totalrmbprice,a.totalusdprice,yfprice=isnull(a.yfprice,0),a.lxprice,a.inname,a.indate,a.state,a.jxdate,a.feetype,zfprice=case when a.feetype=1 then a.rmbprice else a.usdprice end,a.yjrate,a.njrmbprice,a.hyrmbprice,a.yjrmbprice,days=DATEDIFF(day,jxdate,getdate()) from HT_CustomFee a"; + ser.Tsql = "select id=cast(a.id as int),a.customname,a.htdate,a.htcode,a.yjprice,a.rmbprice,a.usdprice,a.njprice,a.hyprice,a.hlrate,a.llrate,a.totalrmbprice,a.totalusdprice,yfprice=isnull(a.yfprice,0),a.lxprice,a.inname,a.indate,a.state,a.jxdate,a.feetype,zfprice=case when a.feetype=1 then a.rmbprice else a.usdprice end,a.yjrate,a.njrmbprice,a.hyrmbprice,a.yjrmbprice,days=DATEDIFF(day,jxdate,getdate()),a.predate,days2=case when predate is not null then DATEDIFF(day,predate,getdate()) else -1 end from HT_CustomFee a"; ser.Tsql += " " + ser.Filter(where); ser.PageIndex = PageIndex; ser.PageSize = PageSize; @@ -31572,8 +31572,13 @@ Update [HT_CustomFeeDetail] set [feeid]=@feeid,[feedate]=@feedate,[feermbprice]= end else begin -INSERT INTO [HT_CustomFeeDetail]([feeid],[feedate],[feermbprice],[feeusdprice],[hlrate],[feetype],[jsbprice],[jslxprice])values(@feeid,@feedate,@feermbprice,@feeusdprice,@hlrate,@feetype,@jsbprice,@jslxprice) +declare @prefeedate datetime,@prejsbprice decimal(18,2),@preyfprice decimal(18,2) +select @prefeedate=predate,@prejsbprice=lxprice,@preyfprice=yfprice from HT_CustomFee where id=@feeid +INSERT INTO [HT_CustomFeeDetail]([feeid],[feedate],[feermbprice],[feeusdprice],[hlrate],[feetype],[jsbprice],[jslxprice],prefeedate,prejsbprice,preyfprice)values(@feeid,@feedate,@feermbprice,@feeusdprice,@hlrate,@feetype,@jsbprice,@jslxprice,@prefeedate,@prejsbprice,@preyfprice) set @id=SCOPE_IDENTITY() + +update HT_CustomFee set yfprice=@hkprice,lxprice=@leftprice,predate=@feedate where id=@feeid +update HT_CustomFee set state=1 where lxprice<=0 end select @id"; Database db = DatabaseFactory.CreateDatabase(); @@ -31585,8 +31590,10 @@ select @id"; db.AddInParameter(cmd, "@feeusdprice", DbType.Decimal, Model.feeusdprice); db.AddInParameter(cmd, "@hlrate", DbType.Decimal, Model.hlrate); db.AddInParameter(cmd, "@feetype", DbType.Int32, Model.feetype); - db.AddInParameter(cmd, "@jsbprice", DbType.Decimal, Model.jsbprice); + db.AddInParameter(cmd, "@jsbprice", DbType.String, Model.jsbprice); db.AddInParameter(cmd, "@jslxprice", DbType.Decimal, Model.jslxprice); + db.AddInParameter(cmd, "@hkprice", DbType.Decimal, Model.hkprice); + db.AddInParameter(cmd, "@leftprice", DbType.Decimal, Model.leftprice); int a = Convert.ToInt32(db.ExecuteScalar(cmd)); return a; } @@ -31595,7 +31602,11 @@ select @id"; public static void Delete_CustomFeeDetail(int id) { string tsql = @" - delete from HT_CustomFeeDetail where id=@id"; +declare @prefeedate datetime,@prejsbprice decimal(18,2),@preyfprice decimal(18,2),@feeid int +select @prefeedate=prefeedate,@prejsbprice=prejsbprice,@preyfprice=preyfprice,@feeid=feeid from HT_CustomFeeDetail where id=@id + delete from HT_CustomFeeDetail where id=@id +update HT_CustomFee set yfprice=@preyfprice,lxprice=@prejsbprice,predate=@prefeedate,state=0 where id=@feeid +"; Database db = DatabaseFactory.CreateDatabase(); DbCommand cmd = db.GetSqlStringCommand(tsql); db.AddInParameter(cmd, "@id", DbType.Int32, id); @@ -31625,7 +31636,7 @@ select @id"; public static List GetListCustomFeeDetail(int feeid) { //string tsql = "select a.id,a.feeid,a.feedate,a.feermbprice,a.feeusdprice,a.hlrate,a.feetype,a.jsbprice,a.jslxprice from HT_CustomFeeDetail"; - string tsql = "select * from HT_CustomFeeDetail where feeid=@feeid order by a.feedate"; + string tsql = "select * from HT_CustomFeeDetail where feeid=@feeid order by feedate"; Database db = DatabaseFactory.CreateDatabase(); DbCommand cmd = db.GetSqlStringCommand(tsql); db.AddInParameter(cmd, "@feeid", DbType.Int32, feeid); diff --git a/TradeManageNew/HT_CustomList.aspx b/TradeManageNew/HT_CustomList.aspx index 6c565d9..927449a 100644 --- a/TradeManageNew/HT_CustomList.aspx +++ b/TradeManageNew/HT_CustomList.aspx @@ -48,7 +48,7 @@ CreateDataGrid(); CreateDataGrid2(); ReadData(); - + $("#cmdAdd").click(function () { $("#a_zhprice").html(""); num = 0; @@ -91,6 +91,12 @@ var index = $(this).parentsUntil("tr").parent().attr("index"); Model = datagrid1.Get_Model(index); if (CommandName == "cmdEdit") { + if (Model.yfprice>0) { + + alert("该合同已经有付款记录,不能编辑"); + return; + } + //有审核时用 //if (Model.State == 1 || Model.State == 2) { $("#cmdSave").hide(); } //else { $("#cmdSave").show(); } @@ -118,6 +124,7 @@ if (CommandName == "cmdDetail") { // CreateGetModel("MainTable", Model); + ReadData2(Model.id); ShowFancybox("MainTable2"); } if (CommandName == "cmdFee") { @@ -127,18 +134,30 @@ return; } // CreateGetModel("MainTable", Model);listfeetype2 txthlrate2 - $("#txtjsbprice").val(Model.lxprice); + num4 = 0; + $("#a_feejsprice").html(""); + $("#txtfeedate").val(""); + $("#txtjsbprice").val(parseFloat(Model.lxprice) + parseFloat(Model.lxprice2)); $("#listfeetype2").val(Model.feetype); $("#txthlrate2").val(Model.hlrate); $("#txtfeejsprice").val(""); $("#a_bz").html(Model.feeflag); + feetype = Model.feetype; ShowFancybox("MainTable3"); } if (CommandName == "cmdDel") { Delete(Model.id); } }); - + $("#DataGrid2 [CommandName]").live("click", function () { + var CommandName = $(this).attr("CommandName"); + var index = $(this).parentsUntil("tr").parent().attr("index"); + var dmd = datagrid2.Get_Model(index); + + if (CommandName == "cmdDel") { + DeleteDetail(dmd.id); + } + }); }); var num = 0; var num2 = 0; @@ -353,7 +372,7 @@ col = new nblf.ui.DataGridColumn(); col.HeaderText = "金额"; - col.CellTemplate ="${Bind usdprice}【¥{Bind usdprice}】"; + col.CellTemplate ="${Bind usdprice}【¥{Bind rmbprice}】"; Array.add(datagrid1.Columns, col); col = new nblf.ui.DataGridColumn(); col.HeaderText = "佣金"; @@ -396,19 +415,26 @@ //col.HeaderText = "totalusdprice"; //col.CellTemplate ="{Bind totalusdprice}"; //Array.add(datagrid1.Columns, col); - - col = new nblf.ui.DataGridColumn(); - col.HeaderText = "欠费金额"; - col.CellTemplate = "{Bind feeflag}{Bind lxprice}"; - Array.add(datagrid1.Columns, col); col = new nblf.ui.DataGridColumn(); col.HeaderText = "已支付"; col.CellTemplate = "{Bind feeflag}{Bind yfprice}"; Array.add(datagrid1.Columns, col); col = new nblf.ui.DataGridColumn(); - col.HeaderText = "剩余未支付"; - col.CellTemplate = "{Bind feeflag}{Bind leftprice}"; + col.HeaderText = "上次支付日期"; + col.CellTemplate = "{Bind predate,yyyy-MM-dd}"; + Array.add(datagrid1.Columns, col); + col = new nblf.ui.DataGridColumn(); + col.HeaderText = "当前欠费金额"; + col.CellTemplate = "{Bind feeflag}{Bind lxprice}"; + Array.add(datagrid1.Columns, col); + col = new nblf.ui.DataGridColumn(); + col.HeaderText = "当前利息"; + col.CellTemplate = "{Bind feeflag}{Bind lxprice2}"; Array.add(datagrid1.Columns, col); + //col = new nblf.ui.DataGridColumn(); + //col.HeaderText = "剩余未支付"; + //col.CellTemplate = "{Bind feeflag}{Bind leftprice}"; + //Array.add(datagrid1.Columns, col); @@ -438,14 +464,14 @@ col = new nblf.ui.DataGridColumn(); col.HeaderText = "付款明细"; col.Width = "160px"; - col.CellTemplate = "付款明细"; + col.CellTemplate = "付款明细  付款"; Array.add(datagrid1.Columns, col); col = new nblf.ui.DataGridColumn(); col.HeaderText = "操作"; - col.Width = "160px"; - col.CellTemplate = "编辑 付款 删除"; + col.Width = "120px"; + col.CellTemplate = "编辑 删除"; Array.add(datagrid1.Columns, col); //datagrid1.SetPageSize(20); @@ -469,53 +495,47 @@ col.HeaderText = "支付日期"; col.CellTemplate = "{Bind feedate,yyyy-MM-dd}"; Array.add(datagrid2.Columns, col); - col = new nblf.ui.DataGridColumn(); - col.HeaderText = "feermbprice"; - col.CellTemplate = "{Bind feermbprice}"; - Array.add(datagrid2.Columns, col); + col.HeaderText = "结算币种"; + col.CellTemplate = "{Bind feetype}"; + col.CellFormatter = function (value) { + switch (value) { + case 1: return "人民币"; + case 2: return "美金"; + default: return ""; + } + }; + Array.add(datagrid2.Columns, col); col = new nblf.ui.DataGridColumn(); - col.HeaderText = "feeusdprice"; - col.CellTemplate = "{Bind feeusdprice}"; + col.HeaderText = "结算金额"; + col.CellTemplate = "${Bind feeusdprice}【¥{Bind feermbprice}】"; Array.add(datagrid2.Columns, col); - col = new nblf.ui.DataGridColumn(); col.HeaderText = "结算汇率"; col.CellTemplate = "{Bind hlrate}"; Array.add(datagrid2.Columns, col); - col = new nblf.ui.DataGridColumn(); - col.HeaderText = "1人民币结算 2美金结算"; - col.CellTemplate = "{Bind feetype}"; - Array.add(datagrid2.Columns, col); + col = new nblf.ui.DataGridColumn(); col.HeaderText = "结算时欠费金额"; col.CellTemplate = "{Bind jsbprice}"; Array.add(datagrid2.Columns, col); - - col = new nblf.ui.DataGridColumn(); - col.HeaderText = "结算时产生的总利息"; - col.CellTemplate = "{Bind jslxprice}"; - Array.add(datagrid2.Columns, col); - - - col = new nblf.ui.DataGridColumn(); col.HeaderText = "操作"; col.Width = "160px"; - col.CellTemplate = "编辑  删除"; + col.CellTemplate = "删除"; Array.add(datagrid2.Columns, col); //datagrid1.SetPageSize(20); datagrid2.IsFixHeader = false; datagrid2.ShowIndexColumn = false; - datagrid2.AllowPaging = true; + datagrid2.AllowPaging = false; datagrid2.Width = "100%"; datagrid2.SelectMode = nblf.ui.SelectMode.None; datagrid2.Init(); - datagrid2.add_PageIndexChanged(function () { ReadData(); }); + datagrid2.add_PageIndexChanged(function () { ReadData2(); }); } //#endregion @@ -536,6 +556,22 @@ }); } //#endregion + + //#region 读取数据 + function ReadData2(feeid) { + var param = new Object(); + + param.feeid = feeid; + $.ajax({ + url: "SysManageServiceNew.asmx/GetListCustomFeeDetail", + data: Sys.Serialization.JavaScriptSerializer.serialize(param), + success: function (data) { + + datagrid2.DataBind(data.d); + } + }); + } + //#endregion //#region 删除 function Delete(id) { if (window.confirm("确定要删除吗?") == false) return; @@ -553,6 +589,25 @@ }); } //#endregion + + //#region 删除 + function DeleteDetail(id) { + if (window.confirm("确定要删除吗?") == false) return; + var param = new Object(); + param.id = id; + WindowLoadModel.Show(); + $.ajax({ + url: "SysManageServiceNew.asmx/Delete_CustomFeeDetail", + data: Sys.Serialization.JavaScriptSerializer.serialize(param), + success: function (data) { + WindowLoadModel.Hide(); + if (data.d == false) { alert("已经使用过,无法删除"); return; } + ReadData2(Model.id); //刷新DataGrid + ReadData(); + } + }); + } + //#endregion //#region 保存 function Save() { var error = CreateSaveModel("MainTable", Model); @@ -564,7 +619,7 @@ Model.usdprice = num; Model.njrmbprice = $("#txtnjprice").val(); Model.njprice = num2; - Model.rmbprice = $("#txthyprice").val(); + Model.hyrmbprice = $("#txthyprice").val(); Model.hydprice = num3; } else if (Model.feetype == 2) { @@ -589,11 +644,14 @@ }); } - + var feetype = 1; function SaveFeeDetail() { var param = new Object(); + if ($("#txtjsbprice").val() == "") { + alert("欠款金额没填"); return; + } if ($("#txtfeedate").val() == "") { alert("付款日期没填"); return; @@ -602,14 +660,14 @@ alert("汇率没填"); return; } - if ($("#txtjsbprice").val() == "") { + if ($("#txtfeejsprice").val() == "") { - alert("付款金额没填"); return; + alert("结算金额没填"); return; } var dmd = new Object(); dmd.feeid = Model.id; - dmd.jsbprice = $("#txtjsbprice").val(); + dmd.jsbprice = $("#a_bz").html()+$("#txtjsbprice").val(); dmd.feetype = $("#listfeetype2").val(); dmd.hlrate = $("#txthlrate2").val(); dmd.feedate = $("#txtfeedate").val(); @@ -623,7 +681,14 @@ dmd.feeusdprice = $("#txtfeejsprice").val(); dmd.feermbprice = num4; } - + if (feetype == 1) { + + dmd.hkprice = dmd.feermbprice; + + } + else + dmd.hkprice = dmd.feeusdprice; + dmd.leftprice = parseFloat($("#txtjsbprice").val()) - dmd.hkprice; WindowLoadModel.Show(); $.ajax({ url: "SysManageServiceNew.asmx/Save_CustomFeeDetail", @@ -683,7 +748,7 @@ - + 注:未支付过的按计息日期计算利息,有已支付记录的按上次支付日期开始计算利息(因为上次支付时已经把利息结算到总金额去了) @@ -768,6 +833,7 @@ + 注:如要删除支付记录,请按日期从最新的那条开始删除,否则还原欠费数据会有问题
@@ -778,7 +844,7 @@ - *欠费金额 + *欠费金额(欠费+利息) *结算币种 *结算状态 - + + <%-- + --%> diff --git a/TradeManageNew/IndexErp.aspx b/TradeManageNew/IndexErp.aspx index ed7b10f..2349d96 100644 --- a/TradeManageNew/IndexErp.aspx +++ b/TradeManageNew/IndexErp.aspx @@ -135,7 +135,10 @@ GetTemuGoodPriceCheckQty(); } - + $("#sp21").bind("click", function(){ + window.open("HT_CustomList.aspx"); + }); + if (UserId!=1&&UserId!=51) $("#div_1,#div_3,#div_21,#div_22,#div_23,#div_24").hide(); $("#leftmenu-trigger").click(function () { @@ -197,7 +200,7 @@ }); $("#sp_name,#a_name").html(name); if (UserId == 1 || UserId == 53) - $("#tr_ck,#tr_ck2,#a_33,#a_333,#a_grxs2,#sp_Num8,#sp_Num88,#sp12,#sp15").show(); + $("#tr_ck,#tr_ck2,#a_33,#a_333,#a_grxs2,#sp_Num8,#sp_Num88,#sp12,#sp15,#sp21").show(); if (UserId == 51 || UserId == 114 || UserId == 190) $("#sp_Num8").show(); if (UserId == 225) { @@ -2728,6 +2731,8 @@ 店铺索赔
人员订单销售数据
<%-- 店铺邮件
--%> + +
diff --git a/TradeManageNew/ModelNew.cs b/TradeManageNew/ModelNew.cs index b0b0114..44f405e 100644 --- a/TradeManageNew/ModelNew.cs +++ b/TradeManageNew/ModelNew.cs @@ -11486,10 +11486,12 @@ namespace TradeManageNew /// 利率 /// public Decimal? llrate { get; set; } - /// - /// totalrmbprice - /// - public Decimal? totalrmbprice { get; set; } + public Decimal? lxprice2 { get; set; } + public DateTime? predate { get; set; } + /// + /// totalrmbprice + /// + public Decimal? totalrmbprice { get; set; } /// /// totalusdprice /// @@ -11522,6 +11524,8 @@ namespace TradeManageNew public DateTime? jxdate { get; set; } public Int32? days { get; set; } + + public Int32? days2 { get; set; } /// /// 0 未结清 1已结清 /// @@ -11563,10 +11567,17 @@ namespace TradeManageNew /// /// 结算时欠费金额 /// - public Decimal? jsbprice { get; set; } + public string jsbprice { get; set; } /// /// 结算时产生的总利息 /// public Decimal? jslxprice { get; set; } + + /// + /// 还款金额 + /// + public Decimal? hkprice { get; set; } + public Decimal? leftprice { get; set; } + } } \ No newline at end of file diff --git a/TradeManageNew/SysManageServiceNew.asmx.cs b/TradeManageNew/SysManageServiceNew.asmx.cs index 510f7ea..4d9bd3c 100644 --- a/TradeManageNew/SysManageServiceNew.asmx.cs +++ b/TradeManageNew/SysManageServiceNew.asmx.cs @@ -18126,15 +18126,15 @@ where a.storeid in (6,9,11) and a.OrderGoodsId=0 and a.KCNum>0 " + tj + " gr Model.jxdate = Model.htdate; Model.state = 0; - Model.lxprice = Model.rmbprice; - Model.yjprice = Model.usdprice * Model.yjrate; - Model.yjrmbprice = Model.rmbprice * Model.yjrate; + + Model.yjprice = Model.usdprice * Model.yjrate*0.01M; + Model.yjrmbprice = Model.rmbprice * Model.yjrate * 0.01M; Model.yfprice = 0; if (Model.feetype == 1) { Model.lxprice = Model.rmbprice + Model.yjrmbprice + Model.njrmbprice + Model.hyrmbprice; } - if (Model.feetype == 2) + else if (Model.feetype == 2) { Model.lxprice = Model.usdprice + Model.yjprice + Model.njprice + Model.hyprice; } @@ -18184,10 +18184,13 @@ where a.storeid in (6,9,11) and a.OrderGoodsId=0 and a.KCNum>0 " + tj + " gr { foreach (var md in resultModel.DataSource) { + md.lxprice2 = 0; if (md.state == 0) { - md.lxprice = md.lxprice * +md.llrate * md.days; - md.leftprice = md.lxprice - md.yfprice; + if (md.days2>=0) + md.lxprice2 = md.lxprice * md.llrate * md.days2; + else md.lxprice2 = md.lxprice * md.llrate * md.days; + // md.leftprice = md.lxprice - md.yfprice; } else { diff --git a/TradeManageNew/bin/TradeManageNew.dll b/TradeManageNew/bin/TradeManageNew.dll index cc84a02..2cc5a85 100644 Binary files a/TradeManageNew/bin/TradeManageNew.dll and b/TradeManageNew/bin/TradeManageNew.dll differ diff --git a/TradeManageNew/bin/TradeManageNew.pdb b/TradeManageNew/bin/TradeManageNew.pdb index 8187223..e41a5dc 100644 Binary files a/TradeManageNew/bin/TradeManageNew.pdb and b/TradeManageNew/bin/TradeManageNew.pdb differ diff --git a/TradeManageNew/obj/Debug/TradeManageNew.dll b/TradeManageNew/obj/Debug/TradeManageNew.dll index cc84a02..2cc5a85 100644 Binary files a/TradeManageNew/obj/Debug/TradeManageNew.dll and b/TradeManageNew/obj/Debug/TradeManageNew.dll differ diff --git a/TradeManageNew/obj/Debug/TradeManageNew.pdb b/TradeManageNew/obj/Debug/TradeManageNew.pdb index 8187223..e41a5dc 100644 Binary files a/TradeManageNew/obj/Debug/TradeManageNew.pdb and b/TradeManageNew/obj/Debug/TradeManageNew.pdb differ