master
cmj 1 day ago
parent fd8125bf5c
commit 9e605e89bb

@ -31544,7 +31544,7 @@ select @id";
public static List<HT_CustomFee> 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<HT_CustomFeeDetail> 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);

@ -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 ="<span>${Bind usdprice}【¥{Bind usdprice}】</span>";
col.CellTemplate ="<span>${Bind usdprice}【¥{Bind rmbprice}】</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "佣金";
@ -396,19 +415,26 @@
//col.HeaderText = "totalusdprice";
//col.CellTemplate ="<span>{Bind totalusdprice}</span>";
//Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "欠费金额";
col.CellTemplate = "<span>{Bind feeflag}{Bind lxprice}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "已支付";
col.CellTemplate = "<span>{Bind feeflag}{Bind yfprice}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "剩余未支付";
col.CellTemplate = "<span>{Bind feeflag}{Bind leftprice}</span>";
col.HeaderText = "上次支付日期";
col.CellTemplate = "<span>{Bind predate,yyyy-MM-dd}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "当前欠费金额";
col.CellTemplate = "<span>{Bind feeflag}{Bind lxprice}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "当前利息";
col.CellTemplate = "<span>{Bind feeflag}{Bind lxprice2}</span>";
Array.add(datagrid1.Columns, col);
//col = new nblf.ui.DataGridColumn();
//col.HeaderText = "剩余未支付";
//col.CellTemplate = "<span>{Bind feeflag}{Bind leftprice}</span>";
//Array.add(datagrid1.Columns, col);
@ -438,14 +464,14 @@
col = new nblf.ui.DataGridColumn();
col.HeaderText = "付款明细";
col.Width = "160px";
col.CellTemplate = "<span CommandName='cmdDetail' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>付款明细</span>";
col.CellTemplate = "<span CommandName='cmdDetail' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>付款明细</span>&nbsp;&nbsp;<span CommandName='cmdFee' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>付款</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "操作";
col.Width = "160px";
col.CellTemplate = "<span CommandName='cmdEdit' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>编辑</span>&nbsp;<span CommandName='cmdFee' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>付款</span>&nbsp;<span CommandName='cmdDel' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>删除</span>";
col.Width = "120px";
col.CellTemplate = "<span CommandName='cmdEdit' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>编辑</span>&nbsp;<span CommandName='cmdDel' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>删除</span>";
Array.add(datagrid1.Columns, col);
//datagrid1.SetPageSize(20);
@ -469,53 +495,47 @@
col.HeaderText = "支付日期";
col.CellTemplate = "<span>{Bind feedate,yyyy-MM-dd}</span>";
Array.add(datagrid2.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "feermbprice";
col.CellTemplate = "<span>{Bind feermbprice}</span>";
Array.add(datagrid2.Columns, col);
col.HeaderText = "结算币种";
col.CellTemplate = "<span>{Bind feetype}</span>";
col.CellFormatter = function (value) {
switch (value) {
case 1: return "<span>人民币</span>";
case 2: return "<span>美金</span>";
default: return "";
}
};
Array.add(datagrid2.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "feeusdprice";
col.CellTemplate = "<span>{Bind feeusdprice}</span>";
col.HeaderText = "结算金额";
col.CellTemplate = "<span>${Bind feeusdprice}【¥{Bind feermbprice}】</span>";
Array.add(datagrid2.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "结算汇率";
col.CellTemplate = "<span>{Bind hlrate}</span>";
Array.add(datagrid2.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "1人民币结算 2美金结算";
col.CellTemplate = "<span>{Bind feetype}</span>";
Array.add(datagrid2.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "结算时欠费金额";
col.CellTemplate = "<span>{Bind jsbprice}</span>";
Array.add(datagrid2.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "结算时产生的总利息";
col.CellTemplate = "<span>{Bind jslxprice}</span>";
Array.add(datagrid2.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "操作";
col.Width = "160px";
col.CellTemplate = "<span CommandName='cmdEdit' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>编辑</span>&nbsp;&nbsp;<span CommandName='cmdDel' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>删除</span>";
col.CellTemplate = "<span CommandName='cmdDel' style='color: #0000FF;cursor:pointer;text-decoration: underline;'>删除</span>";
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 @@
<tr>
<td colspan="9">
<input id="cmdAdd" type="button" value="新增" />
<input id="cmdAdd" type="button" value="新增" /><font color="red">注:未支付过的按计息日期计算利息,有已支付记录的按上次支付日期开始计算利息(因为上次支付时已经把利息结算到总金额去了)</font>
</td>
</tr>
<tr>
@ -768,6 +833,7 @@
<tr>
<td colspan="4">
<font color="red">注:如要删除支付记录,请按日期从最新的那条开始删除,否则还原欠费数据会有问题</font><br />
<div id="DataGrid2" class="DataGridStyle"></div>
</td>
</tr>
@ -778,7 +844,7 @@
<tr>
<td class="f1" ><font color="red">*</font>欠费金额</td>
<td class="f1" ><font color="red">*</font>欠费金额(欠费+利息)</td>
<td><input id='txtjsbprice' type='text' style='width: 90%' precision="2" min="0" max="99999" columnname="jsbprice" columndesc="欠费金额" columnrequired="true" /><a id="a_bz"></a></td>
<td class="f1" ><font color="red">*</font>结算币种</td>
<td><select id='listfeetype2' style="width: 99%;" columnname="feetype" columndesc="结算币种" columnrequired="true">
@ -794,11 +860,12 @@
<tr>
<td class="f1" ><font color="red">*</font>结算金额</td>
<td><input id='txtfeejsprice' type='text' style='width: 50%' precision="2" min="0" max="99999" columnname="feejsprice" columndesc="结算金额" columnrequired="true" /><a id="a_feejsprice" style="color:red"></a></td> <td class="f1" ><font color="red">*</font>结算状态</td>
<td><select id='liststate' style="width: 99%;" columnname="feetype" columndesc="结算状态" columnrequired="true">
<td><input id='txtfeejsprice' type='text' style='width: 50%' precision="2" min="0" max="99999" columnname="feejsprice" columndesc="结算金额" columnrequired="true" /><a id="a_feejsprice" style="color:red"></a></td>
<td></td> <td></td>
<%-- <td><select id='liststate' style="width: 99%;" columnname="feetype" columndesc="结算状态" columnrequired="true">
<option value="0">未结清</option>
<option value="1">已结清</option>
</select></td>
</select></td>--%>
</tr>

@ -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 @@
<span class="sp_1" id="sp18" >店铺索赔</span><br />
<span class="sp_1" id="sp20" >人员订单销售数据</span><br />
<%-- <span class="sp_1" id="sp19" >店铺邮件</span><br />--%>
<span class="sp_1" id="sp21" style="display:none;color:red">借款合同填写</span><br />
<canvas height="20" width="80"></canvas></div>
</div>
</a>

@ -11486,10 +11486,12 @@ namespace TradeManageNew
/// 利率
/// </summary>
public Decimal? llrate { get; set; }
/// <summary>
/// totalrmbprice
/// </summary>
public Decimal? totalrmbprice { get; set; }
public Decimal? lxprice2 { get; set; }
public DateTime? predate { get; set; }
/// <summary>
/// totalrmbprice
/// </summary>
public Decimal? totalrmbprice { get; set; }
/// <summary>
/// totalusdprice
/// </summary>
@ -11522,6 +11524,8 @@ namespace TradeManageNew
public DateTime? jxdate { get; set; }
public Int32? days { get; set; }
public Int32? days2 { get; set; }
/// <summary>
/// 0 未结清 1已结清
/// </summary>
@ -11563,10 +11567,17 @@ namespace TradeManageNew
/// <summary>
/// 结算时欠费金额
/// </summary>
public Decimal? jsbprice { get; set; }
public string jsbprice { get; set; }
/// <summary>
/// 结算时产生的总利息
/// </summary>
public Decimal? jslxprice { get; set; }
/// <summary>
/// 还款金额
/// </summary>
public Decimal? hkprice { get; set; }
public Decimal? leftprice { get; set; }
}
}

@ -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
{

Loading…
Cancel
Save