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
5adb84b9
Commit
5adb84b9
authored
Nov 09, 2019
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加半成品仓库进销存报表,半成品sku进销存报表
parent
d75c0559
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
500 additions
and
2 deletions
+500
-2
FinanceReportServices.cs
Bailun.DC.Services/FinanceReportServices.cs
+0
-0
WareHouseServices.cs
Bailun.DC.Services/WareHouseServices.cs
+18
-1
FinanceController.cs
Bailun.DC.Web/Areas/Reports/Controllers/FinanceController.cs
+178
-0
WarehouseController.cs
...n.DC.Web/Areas/Reports/Controllers/WarehouseController.cs
+17
-1
SemiSkuPurchaseSellStock.cshtml
...eas/Reports/Views/Finance/SemiSkuPurchaseSellStock.cshtml
+145
-0
SemiWHPurchaseSellStock.cshtml
...reas/Reports/Views/Finance/SemiWHPurchaseSellStock.cshtml
+142
-0
No files found.
Bailun.DC.Services/FinanceReportServices.cs
View file @
5adb84b9
This diff is collapsed.
Click to expand it.
Bailun.DC.Services/WareHouseServices.cs
View file @
5adb84b9
...
...
@@ -1073,7 +1073,24 @@ namespace Bailun.DC.Services
return
obj
;
}
}
/// <summary>
/// 半成品仓库列表
/// </summary>
/// <returns></returns>
public
List
<
Tuple
<
string
,
string
>>
ListSemiWareHouse
()
{
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString
))
{
if
(
cn
.
State
==
System
.
Data
.
ConnectionState
.
Closed
)
{
cn
.
Open
();
}
var
obj
=
cn
.
Query
<
dc_semi_daily_purchase_sell_stock
>(
"select warehouse_code,warehouse_name from dc_semi_daily_purchase_sell_stock group by warehouse_code"
);
return
obj
.
Select
(
a
=>
new
Tuple
<
string
,
string
>(
a
.
warehouse_code
,
a
.
warehouse_name
)).
ToList
();
}
}
}
}
Bailun.DC.Web/Areas/Reports/Controllers/FinanceController.cs
View file @
5adb84b9
...
...
@@ -5189,6 +5189,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
#
region
进销存报表
#
region
成品仓
/// <summary>
/// 仓库进销存报表
/// </summary>
...
...
@@ -5354,6 +5356,182 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
}
#
endregion
#
region
半成品仓
/// <summary>
/// 半成品仓库进销存报表
/// </summary>
/// <returns></returns>
public
ActionResult
SemiWHPurchaseSellStock
()
{
return
View
();
}
/// <summary>
/// 半成品仓库进销存报表
/// </summary>
/// <param name="parameter">分页信息</param>
/// <param name="warehousetype">仓库类型</param>
/// <param name="warehouse">仓库编码</param>
/// <param name="start">期初时间</param>
/// <param name="end">期末时间</param>
/// <returns></returns>
public
string
SemiWHPurchaseSellStockJson
(
BtTableParameter
parameter
,
string
warehousetype
,
string
warehouse
,
DateTime
start
,
DateTime
end
)
{
var
total
=
0
;
var
_services
=
new
Services
.
FinanceReportServices
();
var
obj
=
_services
.
ListSemiWHPurchaseSellStock
(
parameter
,
warehousetype
,
warehouse
,
start
,
end
,
ref
total
);
var
objCount
=
_services
.
ListSemiWHPurchaseSellStockCount
(
warehousetype
,
warehouse
,
start
,
end
);
var
list
=
obj
.
Select
(
a
=>
new
{
a
.
warehouse_code
,
a
.
warehouse_name
,
start_onway_amount
=
a
.
start_onway_amount
.
ToString
(
"N2"
),
start_onway_count
=
a
.
start_onway_count
.
ToString
(
"N0"
),
start_stock_amount
=
a
.
start_stock_amount
.
ToString
(
"N2"
),
start_stock_count
=
a
.
start_stock_count
.
ToString
(
"N0"
),
end_onway_amount
=
a
.
end_onway_amount
.
ToString
(
"N2"
),
end_onway_count
=
a
.
end_onway_count
.
ToString
(
"N0"
),
end_stock_amount
=
a
.
end_stock_amount
.
ToString
(
"N2"
),
end_stock_count
=
a
.
end_stock_count
.
ToString
(
"N0"
),
diff_onway_amount
=
(
a
.
end_onway_amount
-
a
.
start_onway_amount
).
ToString
(
"N2"
),
diff_onway_count
=
(
a
.
end_onway_count
-
a
.
start_onway_count
).
ToString
(
"N0"
),
diff_stock_amount
=
(
a
.
end_stock_amount
-
a
.
start_stock_amount
).
ToString
(
"N2"
),
diff_stock_count
=
(
a
.
end_stock_count
-
a
.
start_stock_count
).
ToString
(
"N0"
),
count
=
a
.
count
.
ToString
(
"N0"
),
amount
=
a
.
amount
.
ToString
(
"N2"
),
});
return
JsonConvert
.
SerializeObject
(
new
{
total
=
total
,
rows
=
list
,
count_row
=
new
{
warehouse_name
=
"总计"
,
start_onway_amount
=
objCount
.
start_onway_amount
.
ToString
(
"N2"
),
start_onway_count
=
objCount
.
start_onway_count
.
ToString
(
"N0"
),
start_stock_amount
=
objCount
.
start_stock_amount
.
ToString
(
"N2"
),
start_stock_count
=
objCount
.
start_stock_count
.
ToString
(
"N0"
),
end_onway_amount
=
objCount
.
end_onway_amount
.
ToString
(
"N2"
),
end_onway_count
=
objCount
.
end_onway_count
.
ToString
(
"N0"
),
end_stock_amount
=
objCount
.
end_stock_amount
.
ToString
(
"N2"
),
end_stock_count
=
objCount
.
end_stock_count
.
ToString
(
"N0"
),
diff_onway_amount
=
(
objCount
.
end_onway_amount
-
objCount
.
start_onway_amount
).
ToString
(
"N2"
),
diff_onway_count
=
(
objCount
.
end_onway_count
-
objCount
.
start_onway_count
).
ToString
(
"N0"
),
diff_stock_amount
=
(
objCount
.
end_stock_amount
-
objCount
.
start_stock_amount
).
ToString
(
"N2"
),
diff_stock_count
=
(
objCount
.
end_stock_count
-
objCount
.
start_stock_count
).
ToString
(
"N0"
),
count
=
objCount
.
count
.
ToString
(
"N0"
),
amount
=
objCount
.
amount
.
ToString
(
"N2"
),
}
});
}
/// <summary>
/// 半成品 Sku进销存报表
/// </summary>
/// <returns></returns>
public
ActionResult
SemiSkuPurchaseSellStock
(
string
warehouse
,
DateTime
?
start
,
DateTime
?
end
)
{
string
warehousetype
=
""
;
if
(!
string
.
IsNullOrEmpty
(
warehouse
))
{
var
objWH
=
new
Services
.
WareHouseServices
().
GetWarehouse
(
warehouse
);
if
(
objWH
!=
null
)
{
warehousetype
=
objWH
.
hq_type
;
}
}
ViewBag
.
warehousetype
=
warehousetype
;
ViewBag
.
warehouse
=
warehouse
;
ViewBag
.
start
=
start
.
HasValue
?
start
.
Value
.
ToString
(
"yyyy-MM-dd"
)
:
DateTime
.
Now
.
AddDays
(-
7
).
ToString
(
"yyyy-MM-dd"
);
ViewBag
.
end
=
end
.
HasValue
?
end
.
Value
.
ToString
(
"yyyy-MM-dd"
)
:
DateTime
.
Now
.
AddDays
(-
1
).
ToString
(
"yyyy-MM-dd"
);
return
View
();
}
/// <summary>
/// 半成品 Sku进销存报表
/// </summary>
/// <param name="parameter">分页信息</param>
/// <param name="warehousetype">仓库类型</param>
/// <param name="warehouse">仓库编码</param>
/// <param name="start">期初日期</param>
/// <param name="end">期末日期</param>
/// <returns></returns>
public
string
SemiSkuPurchaseSellStockJson
(
BtTableParameter
parameter
,
string
sku
,
string
warehousetype
,
string
warehouse
,
DateTime
start
,
DateTime
end
)
{
var
_service
=
new
Services
.
FinanceReportServices
();
var
total
=
0
;
var
obj
=
_service
.
ListSemiSkuPurchaseSellStock
(
parameter
,
sku
,
warehousetype
,
warehouse
,
start
,
end
,
ref
total
);
var
objCount
=
_service
.
ListSemiWHPurchaseSellStockCount
(
warehousetype
,
warehouse
,
start
,
end
,
sku
);
var
list
=
obj
.
Select
(
a
=>
new
{
a
.
bailun_sku
,
a
.
sku_title_cn
,
a
.
warehouse_code
,
a
.
warehouse_name
,
start_onway_amount
=
a
.
start_onway_amount
.
ToString
(
"N2"
),
start_onway_count
=
a
.
start_onway_count
.
ToString
(
"N0"
),
start_stock_amount
=
a
.
start_stock_amount
.
ToString
(
"N2"
),
start_stock_count
=
a
.
start_stock_count
.
ToString
(
"N0"
),
end_onway_amount
=
a
.
end_onway_amount
.
ToString
(
"N2"
),
end_onway_count
=
a
.
end_onway_count
.
ToString
(
"N0"
),
end_stock_amount
=
a
.
end_stock_amount
.
ToString
(
"N2"
),
end_stock_count
=
a
.
end_stock_count
.
ToString
(
"N0"
),
diff_onway_amount
=
(
a
.
end_onway_amount
-
a
.
start_onway_amount
).
ToString
(
"N2"
),
diff_onway_count
=
(
a
.
end_onway_count
-
a
.
start_onway_count
).
ToString
(
"N0"
),
diff_stock_amount
=
(
a
.
end_stock_amount
-
a
.
start_stock_amount
).
ToString
(
"N2"
),
diff_stock_count
=
(
a
.
end_stock_count
-
a
.
start_stock_count
).
ToString
(
"N0"
),
count
=
a
.
count
.
ToString
(
"N0"
),
amount
=
a
.
amount
.
ToString
(
"N2"
),
});
return
JsonConvert
.
SerializeObject
(
new
{
total
=
total
,
rows
=
list
,
count_row
=
new
{
warehouse_name
=
"总计"
,
start_onway_amount
=
objCount
.
start_onway_amount
.
ToString
(
"N2"
),
start_onway_count
=
objCount
.
start_onway_count
.
ToString
(
"N0"
),
start_stock_amount
=
objCount
.
start_stock_amount
.
ToString
(
"N2"
),
start_stock_count
=
objCount
.
start_stock_count
.
ToString
(
"N0"
),
end_onway_amount
=
objCount
.
end_onway_amount
.
ToString
(
"N2"
),
end_onway_count
=
objCount
.
end_onway_count
.
ToString
(
"N0"
),
end_stock_amount
=
objCount
.
end_stock_amount
.
ToString
(
"N2"
),
end_stock_count
=
objCount
.
end_stock_count
.
ToString
(
"N0"
),
diff_onway_amount
=
(
objCount
.
end_onway_amount
-
objCount
.
start_onway_amount
).
ToString
(
"N2"
),
diff_onway_count
=
(
objCount
.
end_onway_count
-
objCount
.
start_onway_count
).
ToString
(
"N0"
),
diff_stock_amount
=
(
objCount
.
end_stock_amount
-
objCount
.
start_stock_amount
).
ToString
(
"N2"
),
diff_stock_count
=
(
objCount
.
end_stock_count
-
objCount
.
start_stock_count
).
ToString
(
"N0"
),
count
=
objCount
.
count
.
ToString
(
"N0"
),
amount
=
objCount
.
amount
.
ToString
(
"N2"
),
}
});
}
#
endregion
#
endregion
...
...
Bailun.DC.Web/Areas/Reports/Controllers/WarehouseController.cs
View file @
5adb84b9
...
...
@@ -1394,8 +1394,24 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
}
#
endregion
/// <summary>
/// 半成品仓库列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
JsonResult
SemiWarehouse
()
{
var
obj
=
new
Services
.
WareHouseServices
().
ListSemiWareHouse
();
var
list
=
obj
.
Select
(
a
=>
new
{
warehouse_code
=
a
.
Item1
,
warehouse_name
=
a
.
Item2
});
return
Json
(
list
);
}
}
class
SkuCategory_Col
...
...
Bailun.DC.Web/Areas/Reports/Views/Finance/SemiSkuPurchaseSellStock.cshtml
0 → 100644
View file @
5adb84b9
@{
ViewData["Title"] = "半成品SKU进销存";
Layout = "~/Pages/Shared/_MainLayout.cshtml";
ViewBag.Nav = new string[] { "财务报表", "半成品SKU进销存" };
}
<div class="row">
<div class="col-sm-12">
<div class="alert alert-warning">
说明:差异=期末-期初
</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" style="display:none;">
<label>仓库类型:</label>
<select id="warehousetype" name="warehousetype" class="form-control">
<option value="">选择仓库类型</option>
<option value="国内仓">国内仓</option>
<option value="海外仓">海外仓</option>
<option value="FBA仓">FBA仓</option>
<option value="第三方仓库">第三方仓库</option>
<option value="半成品仓">半成品仓</option>
<option value="耗材仓">耗材仓</option>
</select>
</div>
<div class="form-group">
<label>仓库:</label>
<select id="warehouse" name="warehouse" class="form-control">
<option value="">请选择仓库</option>
</select>
</div>
<div class="form-group">
<label>日期</label>
<input id="start" name="start" class="form-control" style="width:100px" value="@ViewBag.start" />至
<input id="end" name="end" class="form-control" style="width:100px" value="@ViewBag.end" />
</div>
<div class="form-group">
<label> </label>
<input id="sku" name="sku" class="form-control" style="width:120px" placeholder="sku编码" />
</div>
<div class="form-group">
<label> </label>
<button type="button" class="btn btn-primary" onclick="list();"><i class="fa fa-search"></i> 查询</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{
<style>
.mules {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
}
@section scripts{
<script type="text/javascript">
var first = true;
var tb;
$(document).ready(function () {
var height = document.body.clientHeight;
$("#roletable").attr("data-height", (height - 160));
laydate.render({ elem: '#start' });
laydate.render({ elem: '#end' });
listwarehouse();
})
function list(t,w) {
var columns = [
{ field: 'bailun_sku', title: 'Sku', width: '120' },
{
field: 'sku_title_cn', title: 'sku名称', width: '180', formatter: function (idx, data) {
return '<div class="mules" title="' + data.sku_title_cn + '">' + data.sku_title_cn + '</div>';
}
},
{ field: 'warehouse_name', title: '仓库名称', width: '180', iscount: true },
{ field: 'start_stock_amount', title: '期初-在库金额', width: '130', iscount: true, sortable: true },
{ field: 'start_stock_count', title: '期初-在库数量', width: '130', iscount: true, sortable: true },
{ field: 'start_onway_amount', title: '期初-在途金额', width: '130', iscount: true, sortable: true },
{ field: 'start_onway_count', title: '期初-在途数量', width: '130', iscount: true, sortable: true },
{ field: 'end_stock_amount', title: '期末-在库金额', width: '130', iscount: true, sortable: true },
{ field: 'end_stock_count', title: '期末-在库数量', width: '130', iscount: true, sortable: true },
{ field: 'end_onway_amount', title: '期末-在途金额', width: '130', iscount: true, sortable: true },
{ field: 'end_onway_count', title: '期末-在途数量', width: '130', iscount: true, sortable: true },
{ field: 'diff_stock_amount', title: '差异-在库金额', width: '130', iscount: true, sortable: true },
{ field: 'diff_stock_count', title: '差异-在库数量', width: '130', iscount: true, sortable: true },
{ field: 'diff_onway_amount', title: '差异-在途金额', width: '130', iscount: true, sortable: true },
{ field: 'diff_onway_count', title: '差异-在途数量', width: '130', iscount: true, sortable: true },
{ field: 'amount', title: '总金额(差异)', width: '130', iscount: true, sortable: true },
{ field: 'count', title: '总数量(差异)', width: '130', iscount: true, sortable: true }
];
var url = '@Url.Content("~/Reports/Finance/SemiSkuPurchaseSellStockJson")' + '?' + $("#toolbar").serialize();
if (tb == undefined) {
tb = OnlyTable("roletable", columns, url, "", {
showfooter: true, showCount: true
});
}
else {
tb.bootstrapTable('refresh', { url: url });
}
}
function listwarehouse() {
var type = $('#warehousetype').val();
$.submit({
url: '@Url.Content("~/Reports/Warehouse/SemiWarehouse")',
paramData: 'warehousetype=' + type,
type:'POST',
func: function (result) {
if (result != null && result != undefined) {
$('#warehouse').html('<option value="">仓库不限</option>');
for (var i = 0; i < result.length; i++) {
$('#warehouse').append('<option value="' + result[i].warehouse_code + '">' + result[i].warehouse_name + '</option>');
}
if (first) {
$('#warehouse').val('@ViewBag.warehouse');
list();
first = false;
}
}
}
})
}
</script>
}
Bailun.DC.Web/Areas/Reports/Views/Finance/SemiWHPurchaseSellStock.cshtml
0 → 100644
View file @
5adb84b9
@{
ViewData["Title"] = "半成品仓库进销存";
Layout = "~/Pages/Shared/_MainLayout.cshtml";
ViewBag.Nav = new string[] { "财务报表", "半成品仓库进销存" };
}
<div class="row">
<div class="col-sm-12">
<div class="alert alert-warning">
说明:差异=期末-期初
</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" style="display:none;">
<label>仓库类型:</label>
<select id="warehousetype" name="warehousetype" class="form-control">
<option value="">选择仓库类型</option>
<option value="国内仓">国内仓</option>
<option value="海外仓">海外仓</option>
<option value="FBA仓">FBA仓</option>
<option value="第三方仓库">第三方仓库</option>
<option value="半成品仓">半成品仓</option>
<option value="耗材仓">耗材仓</option>
</select>
</div>
<div class="form-group">
<label>仓库:</label>
<select id="warehouse" name="warehouse" class="form-control">
<option value="">请选择仓库</option>
</select>
</div>
<div class="form-group">
<label>日期</label>
<input id="start" name="start" class="form-control" style="width:100px" value="@(DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd"))" />至
<input id="end" name="end" class="form-control" style="width:100px" value="@(DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"))" />
</div>
<div class="form-group">
<label> </label>
<button type="button" class="btn btn-primary" onclick="list();"><i class="fa fa-search"></i> 查询</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{
<style>
.mules {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
}
@section scripts{
<script type="text/javascript">
var tb;
$(document).ready(function () {
var height = document.body.clientHeight;
$("#roletable").attr("data-height", (height - 160));
laydate.render({ elem: '#start' });
laydate.render({ elem: '#end' });
list();
listwarehouse();
})
function list() {
var columns = [
{
field: 'warehouse_name', title: '仓库名称', width: '180', iscount: true, formatter: function (idx, data) {
return '<a href="javascript:;" onclick="details(\'' + data.warehouse_code + '\',\'' + data.warehouse_name + '\')">' + data.warehouse_name+'</a>';
}
},
{ field: 'start_stock_amount', title: '期初-在库金额', width: '130', iscount: true, sortable: true },
{ field: 'start_stock_count', title: '期初-在库数量', width: '130', iscount: true, sortable: true },
{ field: 'start_onway_amount', title: '期初-在途金额', width: '130', iscount: true, sortable: true },
{ field: 'start_onway_count', title: '期初-在途数量', width: '130', iscount: true, sortable: true },
{ field: 'end_stock_amount', title: '期末-在库金额', width: '130', iscount: true, sortable: true },
{ field: 'end_stock_count', title: '期末-在库数量', width: '130', iscount: true, sortable: true },
{ field: 'end_onway_amount', title: '期末-在途金额', width: '130', iscount: true, sortable: true },
{ field: 'end_onway_count', title: '期末-在途数量', width: '130', iscount: true, sortable: true },
{ field: 'diff_stock_amount', title: '差异-在库金额', width: '130', iscount: true, sortable: true },
{ field: 'diff_stock_count', title: '差异-在库数量', width: '130', iscount: true, sortable: true },
{ field: 'diff_onway_amount', title: '差异-在途金额', width: '130', iscount: true, sortable: true },
{ field: 'diff_onway_count', title: '差异-在途数量', width: '130', iscount: true, sortable: true },
{ field: 'amount', title: '总金额(差异)', width: '130', iscount: true, sortable: true },
{ field: 'count', title: '总数量(差异)', width: '130', iscount: true, sortable: true }
];
var url = '@Url.Content("~/Reports/Finance/SemiWHPurchaseSellStockJson")' + '?' + $("#toolbar").serialize();
if (tb == undefined) {
tb = OnlyTable("roletable", columns, url, "", {
showfooter: true, showCount: true
});
}
else {
tb.bootstrapTable('refresh', { url: url });
}
}
function listwarehouse() {
var type = $('#warehousetype').val();
$.submit({
url: '@Url.Content("~/Reports/Warehouse/SemiWarehouse")',
paramData: 'warehousetype=' + type,
type:'POST',
func: function (result) {
if (result != null && result != undefined) {
$('#warehouse').html('<option value="">仓库不限</option>');
for (var i = 0; i < result.length; i++) {
$('#warehouse').append('<option value="' + result[i].warehouse_code + '">' + result[i].warehouse_name + '</option>');
}
}
}
})
}
function details(code,name) {
var start = $('#start').val();
var end = $('#end').val();
layer_show(name + ' Sku进销存', '@Url.Content("~/Reports/Finance/SemiSkuPurchaseSellStock?warehouse=")' + code + '&start=' + start + '&end=' + end, '90%', '90%');
}
</script>
}
\ No newline at end of file
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