Commit d39a6719 by guanzhenshan

修改财务会计流水

parent f2930b2a
......@@ -92,5 +92,16 @@ namespace Bailun.DC.Models.DataWareHouse
public decimal amountval { get; set; }
public order_fee_config fee_config { get; set; }
/// <summary>
/// 汇率
/// </summary>
public decimal? exchange_rate { get; set; }
/// <summary>
/// 人民币金额
/// </summary>
public decimal? amountval_rmb { get; set; }
}
}
......@@ -117,7 +117,7 @@ namespace Bailun.DC.Services.DataWareHouse
public List<order_fee_value_amazon> ListOrderFeeValue(int page, int pagesize, string platform, string website, DateTime? start, DateTime? end, string orderno,ref int total)
{
var sql = $@"select t1.* from order_fee_value_amazon t1
where 1=1 ";
where amountval!=0 ";
var sqlparam = new DynamicParameters();
if (!string.IsNullOrEmpty(platform))
......
......@@ -439,6 +439,8 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
datacenter_col = a.fee_config?.datacenter_col??"",
currency = a.fee_config.currency,
exchange_rate = a.exchange_rate.HasValue?a.exchange_rate.Value+"":"",
amountval_rmb = a.amountval_rmb.HasValue?a.amountval_rmb.Value+"":"",
});
return Newtonsoft.Json.JsonConvert.SerializeObject(new {
......@@ -447,11 +449,47 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
});
}
/// <summary>
/// 导出财务会计流水
/// </summary>
/// <param name="platform"></param>
/// <param name="website"></param>
/// <param name="account"></param>
/// <param name="start"></param>
/// <param name="end"></param>
/// <param name="orderno"></param>
/// <returns></returns>
public ActionResult ExportFinanceAccount_OrderBilling(string platform, string website, string account, DateTime? start, DateTime? end, string orderno)
{
var total = 0;
var obj = new Services.DataWareHouse.PlatformOrderFeeServices().ListOrderFeeValue(0, 0, platform, website, start, end, orderno, ref total);
var colnames = new List<string> {
"主体","平台","站点","账单时间","单号","费用字段说明","财务分类归集说明","数据中心费用类型","会计科目编码","项目编码","币种","原币金额","汇率","RMB金额"
};
var list = new List<string>();
foreach (var item in obj)
{
list.Add("公司主体|"+item.platform+"|"+item.website+"|"+(item.datatime.HasValue?item.datatime.Value.ToString("yyyy-MM-dd HH:mm:ss"):"")+"|"+item.orderno+"|"+(item.fee_config?.feetype ?? "") +"|"+(item.fee_config?.financecategory ?? "")+"|"+(item.fee_config?.datacenter_col ?? "")+"|"+(item.fee_config?.subjectcode ?? "")+"|"+(item.fee_config?.projectcode ?? "")+"|"+ item.fee_config.currency+"|"+(item.amountval)+"|"+(item.exchange_rate.HasValue ? item.exchange_rate.Value + "" : "")+"|"+(item.amountval_rmb.HasValue ? item.amountval_rmb.Value + "" : ""));
}
var guid = Guid.NewGuid().ToString();
var filename = "财务会计流水" + DateTime.Now.ToString("yyyyMMddHHmmss");
var filepath = _hostingEnvironment.WebRootPath + "\\Files\\Report\\" + DateTime.Now.ToString("yyyy-MM-dd") + "\\";
ToCSV(list, colnames, guid, filepath);
var ms = new System.IO.MemoryStream();
using (var f = new System.IO.FileStream(filepath + guid + ".csv", System.IO.FileMode.Open))
{
f.CopyTo(ms);
}
ms.Position = 0;
return File(ms, "text/csv", filename + ".csv");
return View();
}
#endregion
......
......@@ -8,7 +8,7 @@
<div class="row">
<div class="col-sm-12">
<div class="alert alert-warning">
提示:1、没有会计科目编码和项目编码的是不参与会计统计的
提示:1、没有会计科目编码和项目编码的是不参与会计统计的;2、数据中心费用类型缺失的是不参与
</div>
<div class="ibox-content m-b-sm border-bottom">
<form id="toolbar">
......@@ -48,6 +48,7 @@
<div class="form-group">
<label>&nbsp;</label>
<button type="button" class="btn btn-primary" onclick="list();"><i class="fa fa-search"></i>&nbsp;查询</button>
<button type="button" class="btn btn-success" onclick="exportxls();">导出</button>
</div>
</div>
</form>
......@@ -112,7 +113,9 @@
{
field: 'datatime', title: '账单时间', width: '160'
},
{ field: 'orderno', title: '单号', width: '160'},
{ field: 'orderno', title: '单号', width: '160' },
{ field: 'feetype', title: '费用字段说明', width: '160' },
{ field: 'financecategory', title: '财务分类归集说明', width: '180' },
{ field: 'datacenter_col', title: '数据中心费用类型', width: '180'},
/*{ field: 'financecategory', title: '会计科目分类', width: '130' },*/
{ field: 'subjectcode', title: '会计科目编码', width: '130' },
......@@ -124,7 +127,7 @@
field: 'amountval', title: '原币金额', width: '120'
},
{
field: 'exchangerate', title: '汇率', width: '100'
field: 'exchange_rate', title: '汇率', width: '100'
},
{ field: 'amountval_rmb', title: 'RMB金额', width: '120' },
{ field: 'note', title: '备注', width: '160' },
......@@ -157,5 +160,11 @@
}
}
function exportxls() {
if (confirm('确定要导出吗?')) {
window.open('@Url.Content("~/DataWareHouse/PlatformOrder/ExportFinanceAccount_OrderBilling")', '_blank');
}
}
</script>
}
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