Commit c17b5ba9 by guanzhenshan

1、增加分录明细页面,2、导入paypal收入明细时增加生成分录明细功能

parent cd61e3b2
......@@ -62,4 +62,16 @@ namespace Bailun.DC.Models
public DateTime createtime { get; set; }
}
/// <summary>
/// paypal收入统计模版
/// </summary>
public class mPaypalIncome
{
public string currency { get; set; }
public decimal gross { get; set; }
public string account { get; set; }
}
}
......@@ -4776,11 +4776,25 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
msg = new Services.FinanceReportServices().SaveEbayPayPalInfo(list);
}
//return Json(new
//{
// success = string.IsNullOrEmpty(result),
// msg = result
//});
if (string.IsNullOrEmpty(msg) && list.Count>0)
{
var objPaypal = list.OrderBy(a => a.record_time).FirstOrDefault();
if (objPaypal != null)
{
var firstDay = DateTime.Parse(objPaypal.record_time.ToString("yyyy-MM") + "-01");
var r = new Services.FinanceReportServices().Analyze_PaypalIncoming(accountname, firstDay,firstDay.AddMonths(1).AddDays(-1));
if (!string.IsNullOrEmpty(r))
{
return Json(new
{
success = false,
msg = "保存" + file.FileName + "成功,生成分录信息失败,异常信息:" + r,
});
}
}
}
if (!string.IsNullOrEmpty(msg))
{
......@@ -4809,6 +4823,49 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
});
}
public ActionResult ListPaypalIncomeAnalyze()
{
return View();
}
/// <summary>
/// paypal收入分录记录
/// </summary>
/// <param name="parameter">分页信息</param>
/// <param name="month">月份</param>
/// <param name="account">paypal帐号</param>
/// <returns></returns>
[BailunAuthentication(LoginMode.Enforce)]
public string ListPaypalIncomeAnalyzeJson(BtTableParameter parameter, string month, string account)
{
var companyid = HttpContextHelper.Current?.User?.GetCompanyId().ToInt32();
var total = 0;
var obj = new Services.FinanceReportServices().ListPaypalIncoming(parameter, month, account, ref total);
var list = obj.Select(a => new {
a.account_subject,
amount = a.amount.ToString("N0"),
a.balance_impact,
createtime = a.createtime.ToString("yyyy-MM-dd HH:mm:ss"),
a.currency,
a.note,
a.paypal_account,
a.platform_bank,
a.receive_account,
a.recordtime,
});
return JsonConvert.SerializeObject(new
{
total = total,
rows = list,
companyid
});
}
#region Private
/// <summary>
......

@{
ViewData["Title"] = "Paypal收入流水";
Layout = "~/Pages/Shared/_MainLayout.cshtml";
ViewBag.Nav = new string[] { "财务报表", "Paypal分录信息" };
}
<div class="row">
<div class="col-sm-12">
<div class="alert alert-warning">
说明:1、只支持csv文件格式导入。2、导入csv文件时,文件名需要增加帐号信息,如[download.csv],增加帐号后的文件名:[download==dudios.csv]
</div>
<div class="ibox-content m-b-sm border-bottom">
<form id="toolbar">
<div class="form-inline" style="line-height:40px;">
<div class="form-group">
<label>Paypal帐号:</label>
<select id="account" name="account" class="form-control" style="width:160px;">
<option value="">选择Paypal帐号</option>
</select>
</div>
<div class="form-group">
<label>分录月份</label>
<input id="month" name="month" type="text" class="form-control" style="width:130px;" value="@(DateTime.Now.ToString("yyyy-MM"))" />
</div>
<div class="form-group">
<label>&nbsp;</label>
<button type="button" class="btn btn-primary" onclick="list();"><i class="fa fa-search"></i>&nbsp;查询</button>
</div>
</div>
</form>
</div>
<div class="ibox-content m-b-sm border-bottom">
<table id="roletable" style="table-layout:fixed;"></table>
</div>
</div>
</div>
@section css{
<link href="~/css/bootstrap-table-fixed-columns.css" rel="stylesheet" />
<style>
.mules {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
}
@section scripts{
<script src="~/js/bootstrap-table-fixed-columns.js" type="text/javascript"></script>
<script type="text/javascript">
var tb;
var companyid = 0;
$(document).ready(function () {
laydate.render({ elem: '#month', type: 'month' });
var height = document.body.clientHeight;
$("#roletable").attr("data-height", (height - 170));
list();
listAccount();
})
function list() {
var columns = [
{ field: 'recordtime', title: '月份', width: '100', sortable: true },
{ field: 'paypal_account', title: '帐号', width: '150' },
{ field: 'note', title: '摘要', width: '150'},
{ field: 'account_subject', title: '会计科目', width: '230', iscount: true},
{ field: 'platform_bank', title: '平台|银行', width: '150'},
{ field: 'receive_account', title: '帐号', width: '130' },
{ field: 'currency', title: '币种', width: '80' },
{ field: 'balance_impact', title: '方向', width: '80' },
{ field: 'amount', title: '金额', width: '100' },
{ field: 'createtime', title: '创建时间', width: '130' }
];
var url = '@Url.Content("~/Reports/Finance/ListPaypalIncomeAnalyzeJson")' + '?' + $("#toolbar").serialize();
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;
}
}
}
}
companyid = d.companyid;
}
}, {
fixedcol: true,
fixedcolnum:2
});
}
else {
tb.bootstrapTable('refresh', { url: url });
}
}
function listAccount() {
$.submit({
url: '@Url.Content("~/Reports/Orders/ListPaypalAccount")',
type:'POST',
paramData: '',
func: function (result) {
if (result != null && result != undefined) {
$('#account').html('<option value="">选择Paypal帐号</option>');
for (var i = 0; i < result.length; i++) {
$('#account').append('<option value="' + result[i] + '">' + result[i]+'</option>');
}
}
}
})
}
function exportlist() {
if (confirm("确定要导出吗?")) {
window.open('@Url.Content("~/Reports/Orders/ExportEbayOrders")' + '?' + $("#toolbar").serialize(), '_blank');
}
}
</script>
}
......@@ -375,6 +375,9 @@
<li>
<a class="J_menuItem" href="@Url.Content("~/Reports/Finance/ListEbayIncome")" data-index="0">Paypal收入流水</a>
</li>
<li>
<a class="J_menuItem" href="@Url.Content("~/Reports/Finance/ListPaypalIncomeAnalyze")" data-index="0">Paypal分录信息</a>
</li>
</ul>
</li>
<li>
......
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