Commit 5e2ad83b by guanzhenshan

解决管理成本无法查看明细的问题

parent f12ec01b
...@@ -783,13 +783,13 @@ namespace Bailun.DC.Services ...@@ -783,13 +783,13 @@ namespace Bailun.DC.Services
if (!string.IsNullOrEmpty(feesupertype)) if (!string.IsNullOrEmpty(feesupertype))
{ {
sql += " and fee_super_type=@type"; sql += " and type_name=@type";
sqlparam.Add("type", feesupertype); sqlparam.Add("type", feesupertype);
} }
if (!string.IsNullOrEmpty(feesubtype)) if (!string.IsNullOrEmpty(feesubtype))
{ {
sql += " and fee_sub_type=@subtype"; sql += " and kind_name=@subtype";
sqlparam.Add("subtype", feesubtype); sqlparam.Add("subtype", feesubtype);
} }
......
...@@ -1985,7 +1985,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -1985,7 +1985,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
}); });
} }
public ActionResult ListAdministrativeCost(DateTime start,DateTime end,int? paycompanyid,string headname,string categoryname,int type,int issub) public ActionResult ListAdministrativeCost(DateTime start,DateTime end,int? paycompanyid,string headname,string categoryname,int type,int issub,int? ismanager)
{ {
ViewBag.start = start; ViewBag.start = start;
ViewBag.end = end; ViewBag.end = end;
...@@ -1994,6 +1994,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -1994,6 +1994,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
ViewBag.categoryname = categoryname; ViewBag.categoryname = categoryname;
ViewBag.type = type; ViewBag.type = type;
ViewBag.isSub = issub; ViewBag.isSub = issub;
ViewBag.ismanager = ismanager.HasValue?ismanager.Value.ToString() : "";
return View(); return View();
} }
...@@ -2008,7 +2009,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -2008,7 +2009,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="start"></param> /// <param name="start"></param>
/// <param name="end"></param> /// <param name="end"></param>
/// <returns></returns> /// <returns></returns>
public string ListAdministrativeCostJson(DateTime start, DateTime end, int? paycompanyid, string headname, string categoryname, int type, int issub) [BailunAuthentication(LoginMode.Enforce)]
public string ListAdministrativeCostJson(DateTime start, DateTime end, int? paycompanyid, string headname, string categoryname, int type, int issub,int? ismanager)
{ {
//var url = ConfigHelper.GetByName("FeeUrl") + "?o=0"; //var url = ConfigHelper.GetByName("FeeUrl") + "?o=0";
...@@ -2061,38 +2063,38 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -2061,38 +2063,38 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
//var obj = new Services.FinanceReportServices().ListOtherCost(url); //var obj = new Services.FinanceReportServices().ListOtherCost(url);
var obj = new Services.FinanceReportServices().ListFinanceManageCost(start, end, (issub == 0 ? categoryname : ""), (issub != 0 ? categoryname : ""), (type==1?headname:""), paycompanyid); var obj = new Services.FinanceReportServices().ListFinanceFee(start, end, (issub == 0 ? categoryname : ""), (issub != 0 ? categoryname : ""), (type==1?headname:""), paycompanyid, ismanager);
if (obj.Count > 0) if (obj.Count > 0)
{ {
var m = new Models.dc_base_finance_managecost { var m = new Models.dc_base_finance_fee {
no = "", cost_no = "",
company_name = "", company_name = "",
amount = obj.Sum(a => a.amount), amount = obj.Sum(a => (a.amount??0)),
amount_rmb = obj.Sum(a => a.amount_rmb), amount_rmb = obj.Sum(a => (a.amount_rmb??0)),
currency = "", dic = "",
department_name = "", department_name = "",
accounting_subject_name = "", accounting_subject_name = "",
fee_super_type = "合计", type_name = "合计",
}; };
obj.Add(m); obj.Add(m);
} }
var list = obj.Select(a => new { var list = obj.Select(a => new {
amount = a.amount.ToString("###,###.##"), amount = (a.amount??0).ToString("###,###.##"),
amountRmb = a.amount_rmb.ToString("###,###.##"), amountRmb = (a.amount_rmb??0).ToString("###,###.##"),
companyName = a.company_name, companyName = a.company_name,
a.currency, currency = a.dic,
departmentName = a.department_name, departmentName = a.department_name,
feeSubType = a.fee_sub_type, feeSubType = a.type_name,
a.accounting_subject_name, a.accounting_subject_name,
feeSuperType = a.fee_super_type, feeSuperType = a.kind_name,
a.no, no = a.cost_no,
manageCostType = a.manage_cost_type, manageCostType = a.accounting_subject_name,
receiveUnit = a.receive_unit, receiveUnit = a.pay_dic,
a.reason, reason = a.cost_reason,
payTime = a.pay_time.HasValue?a.pay_time.Value.ToString("yyyy-MM-dd HH:mm:ss"):"" payTime = a.pay_time.HasValue?a.pay_time.Value.ToString("yyyy-MM-dd HH:mm:ss"):""
}).ToList(); }).ToList();
......
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
for (var j = 0; j < item2.length - 1; j++) { for (var j = 0; j < item2.length - 1; j++) {
var tempFloat = parseFloat(item2[j]); var tempFloat = parseFloat(item2[j]);
str += '<td style="width:130px">' + (tempFloat > 0 ? '<span style="cursor:pointer" onclick="OpenDetail(\'' + dt[i].item1 + '\',\'' + (result.col[j] == null ? "" : result.col[j]) + '\',0)">' + numFormat(tempFloat) + '</span>' : tempFloat) + '</td>'; str += '<td style="width:130px">' + (tempFloat != 0 ? '<span style="cursor:pointer" onclick="OpenDetail(\'' + dt[i].item1 + '\',\'' + (result.col[j] == null ? "" : result.col[j]) + '\',0)">' + numFormat(tempFloat) + '</span>' : tempFloat) + '</td>';
rowamount = add(rowamount, tempFloat); rowamount = add(rowamount, tempFloat);
if (arrTotal.length > j) { if (arrTotal.length > j) {
...@@ -301,7 +301,7 @@ ...@@ -301,7 +301,7 @@
for (var j = 0; j < item2.length; j++) { for (var j = 0; j < item2.length; j++) {
var tempFloat = parseFloat(item2[j]); var tempFloat = parseFloat(item2[j]);
str += '<td>' + (tempFloat > 0 ? '<span style="cursor:pointer;" onclick="OpenDetail(\'' + dt[i].item1 + '\',\'' + (result.col[j] == null ? "" : result.col[j]) + '\',1)">' + numFormat(tempFloat) + '</span>' : tempFloat) + '</td>'; str += '<td>' + (tempFloat != 0 ? '<span style="cursor:pointer;" onclick="OpenDetail(\'' + dt[i].item1 + '\',\'' + (result.col[j] == null ? "" : result.col[j]) + '\',1)">' + numFormat(tempFloat) + '</span>' : tempFloat) + '</td>';
rowamount = add(rowamount, tempFloat); rowamount = add(rowamount, tempFloat);
} }
str += '<td>' + rowamount + '</td>'; str += '<td>' + rowamount + '</td>';
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
{ field: 'payTime', title: '付款时间' }, { field: 'payTime', title: '付款时间' },
]; ];
var url = '@Url.Content("~/Reports/Finance/ListAdministrativeCostJson")' + '?paycompanyid=' + companyid + '&headname=' + headname + '&categoryname=' + categoryname + '&start=' + start + '&end=' + end + '&type=' + type + '&issub=' + issub; var url = '@Url.Content("~/Reports/Finance/ListAdministrativeCostJson")' + '?paycompanyid=' + companyid + '&headname=' + headname + '&categoryname=' + categoryname + '&start=' + start + '&end=' + end + '&type=' + type + '&issub=' + issub +'&ismanager=@(ViewBag.ismanager)';
if (tb == undefined) { if (tb == undefined) {
tb = OnlyTable("roletable", columns, url, "", { tb = OnlyTable("roletable", columns, url, "", {
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
var start = $('#start').val(); var start = $('#start').val();
var end = $('#end').val(); var end = $('#end').val();
window.open('@Url.Content("~/Reports/Finance/ExportListAdministrativeCost")' + '?paycompanyid=' + companyid + '&headname=' + headname + '&categoryname=' + categoryname + '&start=' + start + '&end=' + end + '&type=' + type + '&issub=' + issub, '_blank'); window.open('@Url.Content("~/Reports/Finance/ExportListAdministrativeCost")' + '?paycompanyid=' + companyid + '&headname=' + headname + '&categoryname=' + categoryname + '&start=' + start + '&end=' + end + '&type=' + type + '&issub=' + issub +'&ismanager=@(ViewBag.ismanager)', '_blank');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment