Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DataCenter_Core2.1_20190520
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bltdc
DataCenter_Core2.1_20190520
Commits
94084277
Commit
94084277
authored
Mar 14, 2019
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加应付账款
parent
5d9083f4
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
508 additions
and
3 deletions
+508
-3
dc_logistics_supplier_transaction.cs
Bailun.DC.Models/dc_logistics_supplier_transaction.cs
+69
-0
FinanceReportServices.cs
Bailun.DC.Services/FinanceReportServices.cs
+105
-0
FinanceController.cs
Bailun.DC.Web/Areas/Reports/Controllers/FinanceController.cs
+104
-1
CopeWithCount.cshtml
...n.DC.Web/Areas/Reports/Views/Finance/CopeWithCount.cshtml
+49
-0
CopeWithLogistics.cshtml
....Web/Areas/Reports/Views/Finance/CopeWithLogistics.cshtml
+65
-0
Index.cshtml
Bailun.DC.Web/Areas/Reports/Views/Finance/Index.cshtml
+2
-2
PrePayCount.cshtml
Bailun.DC.Web/Areas/Reports/Views/Finance/PrePayCount.cshtml
+49
-0
PrePayLogistics.cshtml
...DC.Web/Areas/Reports/Views/Finance/PrePayLogistics.cshtml
+65
-0
No files found.
Bailun.DC.Models/dc_logistics_supplier_transaction.cs
0 → 100644
View file @
94084277
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Bailun.DC.Models
{
/// <summary>
/// 物流供应商往来数据表
/// </summary>
public
class
dc_logistics_supplier_transaction
{
public
int
id
{
get
;
set
;
}
/// <summary>
/// 统计日期
/// </summary>
public
DateTime
?
day
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
string
type
{
get
;
set
;
}
/// <summary>
/// 公司主体value
/// </summary>
public
int
pay_company_value
{
get
;
set
;
}
/// <summary>
/// 公司主体名称
/// </summary>
public
string
pay_company_name
{
get
;
set
;
}
/// <summary>
/// 供应商ID
/// </summary>
public
int
supplier_id
{
get
;
set
;
}
/// <summary>
/// 供应商名称
/// </summary>
public
string
supplier_name
{
get
;
set
;
}
/// <summary>
/// 期初金额
/// </summary>
public
decimal
start_amount
{
get
;
set
;
}
/// <summary>
/// 借方发生额
/// </summary>
public
decimal
borrow_amount
{
get
;
set
;
}
/// <summary>
/// 贷方发生额
/// </summary>
public
decimal
loan_amount
{
get
;
set
;
}
/// <summary>
/// 期末金额
/// </summary>
public
decimal
end_amount
{
get
;
set
;
}
/// <summary>
/// 取数时间
/// </summary>
public
DateTime
update_time
{
get
;
set
;
}
}
}
Bailun.DC.Services/FinanceReportServices.cs
View file @
94084277
...
...
@@ -817,6 +817,62 @@ namespace Bailun.DC.Services
}
/// <summary>
/// 预付款总计(分商品供应商和物流供应商)
/// </summary>
/// <param name="day"></param>
/// <param name="payid"></param>
/// <param name="repay">是否预付款,1:预付款,0:应付款</param>
/// <returns></returns>
public
List
<
decimal
>
ListPrePayCount
(
DateTime
day
,
int
payid
,
int
prepay
)
{
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString
))
{
if
(
cn
.
State
==
ConnectionState
.
Closed
)
{
cn
.
Open
();
}
var
sql
=
"select sum(end_amount) from dc_supplier_transaction where day='"
+
day
.
ToString
(
"yyyy-MM-dd"
)
+
"' "
;
// and pay_company_value=" + payid;
var
logissql
=
"select sum(end_amount) from dc_logistics_supplier_transaction where day='"
+
day
.
ToString
(
"yyyy-MM-dd"
)
+
"' "
;
if
(
prepay
==
1
)
{
sql
+=
" and end_amount<0"
;
logissql
+=
" and end_amount<0"
;
}
else
if
(
prepay
==
0
)
{
sql
+=
" and end_amount>0"
;
logissql
+=
" and end_amount>0"
;
}
if
(
payid
==
2
)
//香港百伦的取一级供应商数据
{
sql
+=
" and types=1"
;
//logissql += " and type=1";
}
else
{
sql
+=
" and types=2"
;
//logissql += " and type=2";
}
var
list
=
new
List
<
decimal
>();
var
obj1
=
cn
.
QueryFirstOrDefault
<
decimal
?>(
sql
);
var
obj2
=
cn
.
QueryFirstOrDefault
<
decimal
?>(
logissql
);
list
.
Add
((
prepay
==
1
?-
1
:
1
)*(
obj1
??
0
));
list
.
Add
((
prepay
==
1
?
-
1
:
1
)
*
(
obj2
??
0
));
return
list
;
}
}
/// <summary>
/// 预付款明细||应付账款明细
/// </summary>
/// <param name="day"></param>
...
...
@@ -863,6 +919,55 @@ namespace Bailun.DC.Services
}
/// <summary>
/// 物流供应商 预付款明细||应付账款明细
/// </summary>
/// <param name="request"></param>
/// <param name="day"></param>
/// <param name="payid"></param>
/// <param name="prepay">是否预付款,1:预付款,0:应付款</param>
/// <param name="total"></param>
/// <returns></returns>
public
List
<
dc_logistics_supplier_transaction
>
ListPrePayLogistics
(
BtTableParameter
request
,
DateTime
day
,
int
payid
,
int
prepay
,
ref
int
total
)
{
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString
))
{
if
(
cn
.
State
==
ConnectionState
.
Closed
)
{
cn
.
Open
();
}
var
sql
=
"select * from dc_logistics_supplier_transaction where day='"
+
day
.
ToString
(
"yyyy-MM-dd"
)
+
"' "
;
// and pay_company_value=" + payid;
if
(
prepay
==
1
)
{
sql
+=
" and end_amount<0"
;
}
else
if
(
prepay
==
0
)
{
sql
+=
" and end_amount>0"
;
}
if
(!
string
.
IsNullOrEmpty
(
request
.
sort
))
{
sql
+=
" order by "
+
request
.
sort
+
" "
+
request
.
order
;
}
try
{
var
list
=
cn
.
Page
<
dc_logistics_supplier_transaction
>(
request
.
pageIndex
,
request
.
limit
,
sql
,
ref
total
);
return
list
.
ToList
();
}
catch
(
Exception
ex
)
{
throw
;
}
}
}
/// <summary>
/// 其他费用,应收和应付费用明细
/// </summary>
/// <param name="day">统计日期</param>
...
...
Bailun.DC.Web/Areas/Reports/Controllers/FinanceController.cs
View file @
94084277
...
...
@@ -792,8 +792,19 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
return
JsonConvert
.
SerializeObject
(
new
{
total
=
total
,
rows
=
list
});
}
public
ActionResult
PrePayCount
(
DateTime
date
,
int
paycompanyid
)
{
var
_services
=
new
Services
.
FinanceReportServices
();
var
list
=
_services
.
ListPrePayCount
(
date
,
paycompanyid
,
1
);
ViewBag
.
date
=
date
;
ViewBag
.
paycompanyid
=
paycompanyid
;
ViewBag
.
list
=
list
;
return
View
();
}
/// <summary>
/// 预付款明细
///
商品供应商
预付款明细
/// </summary>
/// <param name="date"></param>
/// <param name="paycompanyid"></param>
...
...
@@ -828,6 +839,57 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
}
/// <summary>
/// 物流供应商 预付款明细
/// </summary>
/// <param name="date"></param>
/// <param name="paycompanyid"></param>
/// <returns></returns>
public
ActionResult
PrePayLogistics
(
DateTime
date
,
int
paycompanyid
)
{
ViewBag
.
date
=
date
;
ViewBag
.
paycompanyid
=
paycompanyid
;
return
View
();
}
public
string
PrePayLogisticsJson
(
BtTableParameter
request
,
DateTime
date
,
int
paycompanyid
)
{
var
total
=
0
;
var
_services
=
new
Services
.
FinanceReportServices
();
//var paycompany = _services.GetPayCompany(paycompanyid);
var
obj
=
_services
.
ListPrePayLogistics
(
request
,
date
,
paycompanyid
,
1
,
ref
total
);
var
list
=
obj
.
Select
(
a
=>
new
{
a
.
supplier_name
,
a
.
pay_company_name
,
start_amount
=
a
.
start_amount
.
ToString
(
"N2"
),
borrow_amount
=
a
.
borrow_amount
.
ToString
(
"N2"
),
loan_amount
=
a
.
loan_amount
.
ToString
(
"N2"
),
end_amount
=
a
.
end_amount
.
ToString
(
"N2"
),
day
=
a
.
day
.
Value
.
ToString
(
"yyyy-MM-dd"
),
});
return
JsonConvert
.
SerializeObject
(
new
{
total
=
total
,
rows
=
list
});
}
/// <summary>
/// 应付款统计
/// </summary>
/// <param name="date"></param>
/// <param name="paycompanyid"></param>
/// <returns></returns>
public
ActionResult
CopeWithCount
(
DateTime
date
,
int
paycompanyid
)
{
var
_services
=
new
Services
.
FinanceReportServices
();
var
list
=
_services
.
ListPrePayCount
(
date
,
paycompanyid
,
0
);
ViewBag
.
date
=
date
;
ViewBag
.
paycompanyid
=
paycompanyid
;
ViewBag
.
list
=
list
;
return
View
();
}
/// <summary>
/// 应付款明细
/// </summary>
/// <param name="date"></param>
...
...
@@ -862,6 +924,47 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
return
JsonConvert
.
SerializeObject
(
new
{
total
=
total
,
rows
=
list
});
}
/// <summary>
/// 物流供应商应付款明细
/// </summary>
/// <param name="date"></param>
/// <param name="paycompanyid"></param>
/// <returns></returns>
public
ActionResult
CopeWithLogistics
(
DateTime
date
,
int
paycompanyid
)
{
ViewBag
.
date
=
date
;
ViewBag
.
paycompanyid
=
paycompanyid
;
return
View
();
}
/// <summary>
/// 物流供应商应付账款
/// </summary>
/// <param name="request"></param>
/// <param name="date"></param>
/// <param name="paycompanyid"></param>
/// <returns></returns>
public
string
CopeWithLogisticsJson
(
BtTableParameter
request
,
DateTime
date
,
int
paycompanyid
)
{
var
total
=
0
;
var
_services
=
new
Services
.
FinanceReportServices
();
var
paycompany
=
_services
.
GetPayCompany
(
paycompanyid
);
var
obj
=
_services
.
ListPrePayLogistics
(
request
,
date
,
paycompanyid
,
0
,
ref
total
);
var
list
=
obj
.
Select
(
a
=>
new
{
a
.
supplier_name
,
a
.
pay_company_name
,
start_amount
=
a
.
start_amount
.
ToString
(
"N2"
),
borrow_amount
=
a
.
borrow_amount
.
ToString
(
"N2"
),
loan_amount
=
a
.
loan_amount
.
ToString
(
"N2"
),
end_amount
=
a
.
end_amount
.
ToString
(
"N2"
),
day
=
a
.
day
.
Value
.
ToString
(
"yyyy-MM-dd"
),
});
return
JsonConvert
.
SerializeObject
(
new
{
total
=
total
,
rows
=
list
});
}
/// <summary>
/// 其他应收款明细
...
...
Bailun.DC.Web/Areas/Reports/Views/Finance/CopeWithCount.cshtml
0 → 100644
View file @
94084277
@{
ViewData["Title"] = "应付账款统计";
Layout = "~/Pages/Shared/_MainLayout.cshtml";
}
<div class="ibox-content m-b-sm border-bottom">
<table id="tb" class="table table-hover table-bordered" style="width:100%;">
<thead>
<tr>
<th>序号</th>
<th>类型</th>
<th>金额</th>
<th>操作</th>
</tr>
</thead>
<tr>
<td>1</td>
<td>商品供应商</td>
<td>@(ViewBag.list[0].ToString("N2"))</td>
<td><a class="btn btn-xs btn-primary" onclick="showdetail('@ViewBag.date.ToString("yyyy-MM-dd") 商品供应商应付款','@Url.Content("~/Reports/Finance/CopeWith?date="+ViewBag.date+"&paycompanyid="+ViewBag.paycompanyid)')">查看明细</a></td>
</tr>
<tr>
<td>2</td>
<td>物流供应商</td>
<td>@(ViewBag.list[1].ToString("N2"))</td>
<td><a class="btn btn-xs btn-primary" onclick="showdetail('@ViewBag.date.ToString("yyyy-MM-dd") 物流供应商应付款','@Url.Content("~/Reports/Finance/CopeWithLogistics?date="+ViewBag.date+"&paycompanyid="+ViewBag.paycompanyid)')">查看明细</a></td>
</tr>
</table>
</div>
<script>
function ShowDetails(title, url) {
dialogApply({
id: 'Form',
title: title,
url: url,
width: '1300px',
height: '650px',
callBack: function (iframeId) {
//top.frames[iframeId].AcceptClick();
}
});
}
</script>
Bailun.DC.Web/Areas/Reports/Views/Finance/CopeWithLogistics.cshtml
0 → 100644
View file @
94084277
@{
ViewData["Title"] = "物流供应商应付账款";
Layout = "~/Pages/Shared/_MainLayout.cshtml";
}
<div class="row">
<div class="col-sm-12">
<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: 'supplier_name', title: '供应商名称', width: '180', sortable: true, formatter: function (idx, data) {
return '<div class="mules" title="' + data.supplier_name + '">' + data.supplier_name + '</div>';
}
},
{
field: 'pay_company_name', title: '公司主体', width: '180', sortable: false, formatter: function (idx, data) {
return '<div class="mules" title="' + data.pay_company_name + '">' + data.pay_company_name + '</div>';
}
},
{ field: 'start_amount', title: '期初金额', width: '100', sortable: true },
{ field: 'borrow_amount', title: '借方发生额', width: '110', sortable: false },
{ field: 'loan_amount', title: '贷方发生额', width: '110', sortable: false },
{ field: 'end_amount', title: '期末金额', width: '100', sortable: true },
{ field: 'day', title: '日期', width: '90', sortable: true }
];
var url = '@Url.Content("~/Reports/Finance/PrePayLogisticsJson")' + '?date=@(ViewBag.date)&paycompanyid=@(ViewBag.paycompanyid)';
if (tb == undefined) {
tb = OnlyTable("roletable", columns, url, "");
}
else {
tb.bootstrapTable('refresh', { url: url });
}
}
</script>
}
Bailun.DC.Web/Areas/Reports/Views/Finance/Index.cshtml
View file @
94084277
...
...
@@ -963,10 +963,10 @@
showdetail(title + ' 短期借款明细', '@Url.Content("~/Reports/Finance/ShortBorrow?date=")' + title + '&paycompanyid=' + paycompany); //ShortBorrow
return false;
case 'prepayment':
showdetail(title + ' 预付帐款明细', '@Url.Content("~/Reports/Finance/PrePay?date=")' + title + '&paycompanyid=' + paycompany);
showdetail(title + ' 预付帐款明细', '@Url.Content("~/Reports/Finance/PrePay
Count
?date=")' + title + '&paycompanyid=' + paycompany);
return false;
case 'accounts_payable':
showdetail(title + ' 应付帐款明细', '@Url.Content("~/Reports/Finance/CopeWith?date=")' + title + '&paycompanyid=' + paycompany);
showdetail(title + ' 应付帐款明细', '@Url.Content("~/Reports/Finance/CopeWith
Count
?date=")' + title + '&paycompanyid=' + paycompany);
return false;
case 'other_accounts_receivable':
showdetail(title + ' 其他应收款明细', '@Url.Content("~/Reports/Finance/OtherReceivable?date=")' + title + '&paycompanyid=' + paycompany);
...
...
Bailun.DC.Web/Areas/Reports/Views/Finance/PrePayCount.cshtml
0 → 100644
View file @
94084277
@{
ViewData["Title"] = "预付款项明细";
Layout = "~/Pages/Shared/_MainLayout.cshtml";
}
<div class="ibox-content m-b-sm border-bottom">
<table id="tb" class="table table-hover table-bordered" style="width:100%;">
<thead>
<tr>
<th>序号</th>
<th>类型</th>
<th>金额</th>
<th>操作</th>
</tr>
</thead>
<tr>
<td>1</td>
<td>商品供应商</td>
<td>@(ViewBag.list[0].ToString("N2"))</td>
<td><a class="btn btn-xs btn-primary" onclick="showdetail('@ViewBag.date.ToString("yyyy-MM-dd") 商品供应商预付款','@Url.Content("~/Reports/Finance/PrePay?date="+ViewBag.date+"&paycompanyid="+ViewBag.paycompanyid)')">查看明细</a></td>
</tr>
<tr>
<td>2</td>
<td>物流供应商</td>
<td>@(ViewBag.list[1].ToString("N2"))</td>
<td><a class="btn btn-xs btn-primary" onclick="showdetail('@ViewBag.date.ToString("yyyy-MM-dd") 物流供应商预付款','@Url.Content("~/Reports/Finance/PrePayLogistics?date="+ViewBag.date+"&paycompanyid="+ViewBag.paycompanyid)')">查看明细</a></td>
</tr>
</table>
</div>
<script>
function ShowDetails(title, url) {
dialogApply({
id: 'Form',
title: title,
url: url,
width: '1300px',
height: '650px',
callBack: function (iframeId) {
//top.frames[iframeId].AcceptClick();
}
});
}
</script>
Bailun.DC.Web/Areas/Reports/Views/Finance/PrePayLogistics.cshtml
0 → 100644
View file @
94084277
@{
ViewData["Title"] = "物流供应商预付款";
Layout = "~/Pages/Shared/_MainLayout.cshtml";
}
<div class="row">
<div class="col-sm-12">
<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: 'supplier_name', title: '供应商名称', width: '180', sortable: true, formatter: function (idx, data) {
return '<div class="mules" title="' + data.supplier_name + '">' + data.supplier_name + '</div>';
}
},
{
field: 'pay_company_name', title: '公司主体', width: '180', sortable: false, formatter: function (idx, data) {
return '<div class="mules" title="' + data.pay_company_name + '">' + data.pay_company_name + '</div>';
}
},
{ field: 'start_amount', title: '期初金额', width: '100', sortable: true },
{ field: 'borrow_amount', title: '借方发生额', width: '110', sortable: false },
{ field: 'loan_amount', title: '贷方发生额', width: '110', sortable: false },
{ field: 'end_amount', title: '期末金额', width: '100', sortable: true },
{ field: 'day', title: '日期', width: '90', sortable: true }
];
var url = '@Url.Content("~/Reports/Finance/PrePayLogisticsJson")' + '?date=@(ViewBag.date)&paycompanyid=@(ViewBag.paycompanyid)';
if (tb == undefined) {
tb = OnlyTable("roletable", columns, url, "");
}
else {
tb.bootstrapTable('refresh', { url: url });
}
}
</script>
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment