Commit b00a9099 by guanzhenshan

完成固定资产明细展示

parent 3ac856d7
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models
{
public class dc_base_buy
{
/// <summary>
///
/// </summary>
public int id { get; set; }
/// <summary>
/// 采购计划单号
/// </summary>
public string no { get; set; }
/// <summary>
/// 采购单号
/// </summary>
public string buyno { get; set; }
/// <summary>
/// 采购单状态,-2:已拆单,-1:作废,0:采购员未确认,1:采购员确认,2:主管审核,3:发货入库中,4:采购完成,5:待出纳审核,6:出纳未付款
/// </summary>
public int buystatus { get; set; }
/// <summary>
/// 付款主体名称
/// </summary>
public string paycompanyname { get; set; }
/// <summary>
/// sku 编号
/// </summary>
public string skucode { get; set; }
/// <summary>
/// sku标题
/// </summary>
public string skuname { get; set; }
/// <summary>
/// 预计到货日期
/// </summary>
public DateTime arrivaldate { get; set; }
/// <summary>
/// 接收货物仓库code
/// </summary>
public string warehouseid { get; set; }
/// <summary>
/// 接收货物仓库名称
/// </summary>
public string warehousename { get; set; }
/// <summary>
/// 付款主体value
/// </summary>
public int paycompanyid { get; set; }
/// <summary>
/// 供应商id
/// </summary>
public int supplierid { get; set; }
/// <summary>
/// 供应商名称
/// </summary>
public string suppliername { get; set; }
/// <summary>
/// 付款类型,1先款后货,2先货后款,3无需付款
/// </summary>
public int paytype { get; set; }
/// <summary>
/// 采购总金额
/// </summary>
public decimal amount { get; set; }
/// <summary>
/// 实际支付总金额
/// </summary>
public decimal payamount { get; set; }
/// <summary>
/// 采购总数量
/// </summary>
public int count { get; set; }
/// <summary>
/// 快递费
/// </summary>
public decimal expressfee { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime createtime { get; set; }
/// <summary>
/// 最后操作人id
/// </summary>
public int lastupdateuserid { get; set; }
/// <summary>
/// 最后操作人名称
/// </summary>
public string lastupdateusername { get; set; }
/// <summary>
/// 最后更新时间
/// </summary>
public DateTime lastupdatetime { get; set; }
/// <summary>
/// 采购员id
/// </summary>
public int buyuserid { get; set; }
/// <summary>
/// 付款状态,0:未付款,1:部分付款,2:已付款,3无需付款
/// </summary>
public int paystatus { get; set; }
/// <summary>
/// 发货状态,0:未发货,1:部分发货,2:全部发货
/// </summary>
public int sendstatus { get; set; }
/// <summary>
/// 创建人id
/// </summary>
public int createuserid { get; set; }
/// <summary>
/// 创建人名称
/// </summary>
public string createusername { get; set; }
/// <summary>
/// 订单号
/// </summary>
public string orderno { get; set; }
/// <summary>
/// 采购单备注
/// </summary>
public string note { get; set; }
/// <summary>
/// 是否删除,0:未删除,1:已删除
/// </summary>
public int delstatus { get; set; }
/// <summary>
/// 是否紧急,0:常规,1:紧急
/// </summary>
public int isurgency { get; set; }
/// <summary>
/// 采购员名称
/// </summary>
public string buyusername { get; set; }
/// <summary>
/// 附件id
/// </summary>
public int fileid { get; set; }
/// <summary>
/// 附件保存路径
/// </summary>
public string filepath { get; set; }
/// <summary>
/// 部门id
/// </summary>
public int departmentid { get; set; }
/// <summary>
/// 部门名称
/// </summary>
public string departmentname { get; set; }
/// <summary>
/// 审核人id
/// </summary>
public int audituserid { get; set; }
/// <summary>
/// 审核人名称
/// </summary>
public string auditusername { get; set; }
/// <summary>
/// 审核时间
/// </summary>
public DateTime audittime { get; set; }
/// <summary>
/// 审核备注
/// </summary>
public string auditnote { get; set; }
/// <summary>
/// 采购主体
/// </summary>
public string company { get; set; }
/// <summary>
/// 供应商编号
/// </summary>
public string supplier_no { get; set; }
/// <summary>
/// 驳回理由
/// </summary>
public string reject_reason { get; set; }
/// <summary>
/// 出纳系统 detailKey
/// </summary>
public string detail_key { get; set; }
/// <summary>
///
/// </summary>
public string link_lend_cost_no { get; set; }
/// <summary>
/// 供应商银行
/// </summary>
public string supplier_bankname { get; set; }
/// <summary>
/// 供应商银行卡号
/// </summary>
public string supplier_cardno { get; set; }
/// <summary>
/// 供应商持卡人
/// </summary>
public string supplier_cardusername { get; set; }
/// <summary>
/// 付款时间
/// </summary>
public DateTime pay_time { get; set; }
/// <summary>
/// SKU大类名称
/// </summary>
public string sku_type_name { get; set; }
/// <summary>
/// 采购公司主体value
/// </summary>
public int company_value { get; set; }
/// <summary>
/// 统计的数据日期
/// </summary>
public DateTime day { get; set; }
}
}
......@@ -11,12 +11,12 @@ namespace Bailun.DC.Models
/// <summary>
/// 统计日期
/// </summary>
public DateTime day { get; set; }
public DateTime? day { get; set; }
/// <summary>
/// 公司主体value
/// </summary>
public int company_value { get; set; }
public int? company_value { get; set; }
/// <summary>
/// 采购公司
......@@ -26,27 +26,27 @@ namespace Bailun.DC.Models
/// <summary>
/// 期初金额
/// </summary>
public decimal start_amount { get; set; }
public decimal? start_amount { get; set; }
/// <summary>
/// 借方发生额
/// </summary>
public decimal debit_amount { get; set; }
public decimal? debit_amount { get; set; }
/// <summary>
/// 贷方发生额
/// </summary>
public decimal credit_amount { get; set; }
public decimal? credit_amount { get; set; }
/// <summary>
/// 期末金额
/// </summary>
public decimal end_amount { get; set; }
public decimal? end_amount { get; set; }
/// <summary>
/// 取数时间
/// </summary>
public DateTime update_time { get; set; }
public DateTime? update_time { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models
{
public class mFixedAssetsDetail
{
public string buyno { get; set; }
public DateTime? pay_time { get; set; }
public string skuname { get; set; }
public decimal? amount { get; set; }
public decimal? creditamount { get; set; }
public DateTime? day { get; set; }
}
}
......@@ -1064,6 +1064,43 @@ namespace Bailun.DC.Services
}
/// <summary>
/// 固定资产二级明细表
/// </summary>
/// <param name="request">分页信息</param>
/// <param name="date">统计日期</param>
/// <param name="companyvalue">公司主体id</param>
/// <param name="total">符合条件的记录数</param>
/// <returns></returns>
public List<mFixedAssetsDetail> ListFixedAssetsDetails(BtTableParameter request,DateTime date,int? companyvalue,ref int total)
{
var sql = "select buyno,pay_time,skuname,amount,0 'creditamount',day from dc_base_buy where day='" + date.ToString("yyyy-MM-dd")+"'";
if (companyvalue.HasValue)
{
sql += " and company_value="+companyvalue.Value;
}
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{
if (cn.State == ConnectionState.Closed)
{
cn.Open();
}
if (!string.IsNullOrEmpty(request.sort))
{
sql += " order by "+request.sort+" "+request.order;
}
var obj = cn.Query<mFixedAssetsDetail>(sql);
total = obj.Count();
return obj.AsList();
}
}
#endregion
#region 付款主体
......
......@@ -90,7 +90,7 @@ namespace Bailun.DC.Services
}
else
{
sql += " left join dc_base_warehouse t4 on t1.warehouse_code=t4.warehouse_code ";
sql += "join dc_base_warehouse t4 on t1.warehouse_code=t4.warehouse_code ";
}
if (!string.IsNullOrWhiteSpace(warehouse))
......
......@@ -26,6 +26,12 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
return View();
}
public ActionResult Index2()
{
return View();
}
/// <summary>
/// 获取资产负债表数据
/// </summary>
......@@ -1103,18 +1109,87 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
var obj = new Services.FinanceReportServices().ListFixedAssets(request, date, paycompanyid, companyvalue, ref total);
var countM = new dc_fixed_assets_detail();
if (obj.Count > 0)
{
countM = (new dc_fixed_assets_detail
{
company_name = "合计:",
debit_amount = obj.Sum(a => a.debit_amount.Value),
credit_amount = obj.Sum(a => a.credit_amount.Value),
});
}
var list = obj.Select(a => new {
day = a.day.ToString("yyyy-MM-dd"),
day = a.day.HasValue?a.day.Value.ToString("yyyy-MM-dd"):"",
company_value = a.company_value.HasValue?a.company_value.Value+"":"",
a.company_name,
start_amount = a.start_amount.ToString("N2"),
debit_amount = a.debit_amount.ToString("N2"),
credit_amount = a.credit_amount.ToString("N2"),
end_amount = a.end_amount.ToString("N2"),
start_amount = a.start_amount.HasValue?a.start_amount.Value.ToString("N2"):"",
debit_amount = a.debit_amount.HasValue?a.debit_amount.Value.ToString("N2"):"",
credit_amount = a.credit_amount.HasValue ? a.credit_amount.Value.ToString("N2"):"",
end_amount = a.end_amount.HasValue?a.end_amount.Value.ToString("N2"):"",
});
return JsonConvert.SerializeObject(new { total=total,rows = list});
return JsonConvert.SerializeObject(new { total=total,rows = list, count_row = new {
countM.company_name,
debit_amount = countM.debit_amount.HasValue?countM.debit_amount.Value.ToString("N2"):"0",
credit_amount = countM.credit_amount.HasValue?countM.credit_amount.Value.ToString("N2"):"0"
} });
}
/// <summary>
/// 固定资产二级明细
/// </summary>
/// <param name="companyvalue"></param>
/// <returns></returns>
public ActionResult ListFixedAssetsDetails(int companyvalue,DateTime date)
{
ViewBag.date = date;
ViewBag.companyvalue = companyvalue;
return View();
}
/// <summary>
/// 固定资产二级明细
/// </summary>
/// <param name="request"></param>
/// <param name="companyvalue"></param>
/// <param name="date"></param>
/// <returns></returns>
public string ListFixedAssetsDetailsJson(BtTableParameter request, int? companyvalue, DateTime date)
{
var total = 0;
var obj = new Services.FinanceReportServices().ListFixedAssetsDetails(request, date, companyvalue, ref total);
var countM = new mFixedAssetsDetail();
if (obj.Count>0)
{
countM = (new mFixedAssetsDetail {
buyno = "合计:",
amount = obj.Sum(a=>a.amount.Value)
});
}
var list = obj.Select(a => new
{
a.buyno,
pay_time = a.pay_time.HasValue?a.pay_time.Value.ToString("yyyy-MM-dd HH:mm:ss"):"",
a.skuname,
amount = a.amount.HasValue?a.amount.Value.ToString("N2"):"",
creditamount = 0,
day = a.day.HasValue?a.day.Value.ToString("yyyy-MM-dd"):""
}).ToList(); ;
return JsonConvert.SerializeObject(new { total=total,rows=list,count_row=new {
buyno = countM.buyno,
amount = countM.amount.HasValue?countM.amount.Value.ToString("N2"):"0",
}
});
}
#endregion
......
......@@ -148,7 +148,7 @@
<td class="inventory_amount">0</td>
<td class="inventory_amount">0</td>
<td><input id="inventory_amount" class="txtinput" type="number" value="0" style="width:110px;" /></td>
<td><a class="btn btn-primary btn-xs" onclick="UpdateData('inventory_amount');">更新</a></td>
<td></td>
</tr>
<tr>
<td>一年内到期的非流动资产</td>
......
......@@ -49,13 +49,13 @@
function list() {
var columns = [
{
field: 'company_name', title: '采购公司', width: '150', sortable: true, formatter: function (idx, data) {
return '<div class="mules" title="' + data.company_name + '">' + data.company_name + '</div>';
field: 'company_name', title: '采购公司', width: '150', sortable: true, iscount: true, formatter: function (idx, data) {
return '<div style="' + (data.company_value > 0 ?'color:#7092E6;cursor:pointer;':"")+'" class="mules" title="' + data.company_name + '" onclick="showSecondLevel(' + data.company_value + ',\'' + data.company_name+'\',\''+data.day+'\')">' + data.company_name + '</div>';
}
},
{ field: 'start_amount', title: '期初金额', width: '110', sortable: true },
{ field: 'debit_amount', title: '借方发生额', width: '110', sortable: false },
{ field: 'credit_amount', title: '贷方发生额', width: '110', sortable: false },
{ field: 'debit_amount', title: '借方发生额', width: '110', sortable: false, iscount: true },
{ field: 'credit_amount', title: '贷方发生额', width: '110', sortable: false, iscount: true },
{ field: 'end_amount', title: '期末金额', width: '100', sortable: true },
{ field: 'day', title: '统计日期', width: '90', sortable: true }
];
......@@ -65,7 +65,23 @@
var url = '@Url.Content("~/Reports/Finance/ListFixedAssetsJson")' + '?date=@(ViewBag.date)&paycompanyid=@(ViewBag.paycompanyid)&companyvalue=' + pvalue;
if (tb == undefined) {
tb = OnlyTable("roletable", columns, url, "");
tb = OnlyTable("roletable", columns, url, "",{
showfooter: true, loadsuccess: function (d) {
//替换汇总行的相关列值
var tr = $('.fixed-table-footer').find('tr');
for (var c in columns) {
var key = columns[c].field;
if (columns[c].iscount) {
for (var v in d.count_row) {
if (key == v) {
tr.find('td').eq(c).children('div').first().html(d.count_row[v]);
break;
}
}
}
}
}
});
}
else {
tb.bootstrapTable('refresh', { url: url });
......@@ -88,6 +104,14 @@
})
}
function showSecondLevel(value, name, date) {
if (value == 0) {
return false;
}
layer_show(date + ' ' + name + ' 的固定资产二级明细', '@Url.Content("~/Reports/Finance/ListFixedAssetsDetails?companyvalue=")' + value + '&date=' + date,'95%','95%');
}
</script>
}
......

@{
ViewData["Title"] = "固定资产二级明细";
Layout = "~/Pages/Shared/_MainLayout.cshtml";
}
<div class="row">
<div class="col-sm-12">
<div class="ibox-content m-b-sm border-bottom">
</div>
<div class="ibox-content m-b-sm border-bottom">
<table id="roletable" style="table-layout:fixed;"></table>
</div>
</div>
</div>
@section css{
<style>
.mules {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
}
@section scripts{
<script>
var tb;
$(document).ready(function () {
var height = document.body.clientHeight;
$("#roletable").attr("data-height", (height - 100));
list();
})
function list() {
var columns = [
{
field: 'buyno', title: '其他采购单号', width: '150', sortable: true, iscount:true,formatter: function (idx, data) {
return '<div class="mules" title="' + data.buyno + '">' + data.buyno + '</div>';
}
},
{ field: 'pay_time', title: '出纳付款时间', width: '150', sortable: true },
{ field: 'skuname', title: '采购物品', width: '180', sortable: false },
{ field: 'amount', title: '本期借方发生额', width: '110', sortable: false, iscount:true },
{ field: 'creditamount', title: '本期贷方发生额', width: '100', sortable: true, iscount:true },
{ field: 'day', title: '统计日期', width: '90', sortable: true }
];
var pvalue = $('#companyvalue').val();
var url = '@Url.Content("~/Reports/Finance/ListFixedAssetsDetailsJson")' + '?date=@(ViewBag.date)&companyvalue=@(ViewBag.companyvalue)';
if (tb == undefined) {
tb = OnlyTable("roletable", columns, url, "", {
showfooter: true, loadsuccess: function (d) {
//替换汇总行的相关列值
var tr = $('.fixed-table-footer').find('tr');
for (var c in columns) {
var key = columns[c].field;
if (columns[c].iscount) {
for (var v in d.count_row) {
if (key == v) {
tr.find('td').eq(c).children('div').first().html(d.count_row[v]);
break;
}
}
}
}
}
});
}
else {
tb.bootstrapTable('refresh', { url: url });
}
}
</script>
}
......@@ -222,7 +222,7 @@
</a>
<ul class="nav nav-second-level">
<li>
<a class="J_menuItem" href="@Url.Content("~/Reports/Finance/Index")" data-index="0">资产负债表</a>
<a class="J_menuItem" href="@Url.Content("~/Reports/Finance/Index2")" data-index="0">资产负债表</a>
</li>
<li>
<a class="J_menuItem" href="@Url.Content("~/Reports/Finance/ListAccoutBalanceCount")" data-index="0">平台余额</a>
......
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