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
98f86df0
Commit
98f86df0
authored
Nov 04, 2019
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
每日进销存报表增加子分析报表
parent
17fc0992
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
221 additions
and
11 deletions
+221
-11
FinanceReportServices.cs
Bailun.DC.Services/FinanceReportServices.cs
+7
-1
WareHouseServices.cs
Bailun.DC.Services/WareHouseServices.cs
+28
-0
FinanceController.cs
Bailun.DC.Web/Areas/Reports/Controllers/FinanceController.cs
+41
-2
WarehouseController.cs
...n.DC.Web/Areas/Reports/Controllers/WarehouseController.cs
+97
-3
MonthSaleProfit.cshtml
...DC.Web/Areas/Reports/Views/Finance/MonthSaleProfit.cshtml
+14
-5
DailyPurchaseSalesCount.cshtml
...as/Reports/Views/Warehouse/DailyPurchaseSalesCount.cshtml
+34
-0
No files found.
Bailun.DC.Services/FinanceReportServices.cs
View file @
98f86df0
...
...
@@ -3551,7 +3551,13 @@ group by currency";
/// <returns></returns>
public
List
<
dc_month_sale_profit
>
ListMonthSaleProfit
(
string
start
,
string
end
)
{
var
sql
=
$"select * from dc_month_sale_profit where month>='
{
start
}
' and month<='
{
end
}
' order by month desc"
;
var
sql
=
$"select * from dc_month_sale_profit where month>='
{
start
}
' "
;
if
(!
string
.
IsNullOrEmpty
(
end
))
{
sql
+=
(
" and month<='"
+
end
+
"' order by month desc limit 6"
);
}
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString
))
{
...
...
Bailun.DC.Services/WareHouseServices.cs
View file @
98f86df0
...
...
@@ -1046,5 +1046,33 @@ namespace Bailun.DC.Services
}
/// <summary>
/// 按车间获取半成品的每日销售进销比
/// </summary>
/// <param name="start">开始时间</param>
/// <param name="end">结束时间</param>
/// <returns></returns>
public
List
<
dc_daily_purchase_sales
>
DailyPurchaseSaleByWH_Semi
(
DateTime
start
,
DateTime
end
)
{
var
sqlparam
=
new
DynamicParameters
();
var
sql
=
$@"select t1.day,t1.warehouse_name as category_simple_name,sum(t1.amount_purchase) amount_purchase,sum(t1.count_purchase) count_purchase,sum(t1.amount_shipping) amount_shipping,sum(t1.count_shipping) count_shipping from dc_daily_purchase_sales t1
where t1.isfinish=0 and warehouse_code>0 and t1.day>='
{
start
.
ToString
(
"yyyy-MM-dd"
)}
' and t1.day<'
{
end
.
AddDays
(
1
).
ToString
()}
'
"
;
sql
+=
" group by t1.day,t1.warehouse_code"
;
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString
))
{
if
(
cn
.
State
==
System
.
Data
.
ConnectionState
.
Closed
)
{
cn
.
Open
();
}
var
obj
=
cn
.
Query
<
dc_daily_purchase_sales
>(
sql
,
sqlparam
,
null
,
true
,
2
*
60
).
AsList
();
return
obj
;
}
}
}
}
Bailun.DC.Web/Areas/Reports/Controllers/FinanceController.cs
View file @
98f86df0
...
...
@@ -5537,7 +5537,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
{
try
{
var
obj
=
new
Services
.
FinanceReportServices
().
ListMonthSaleProfit
(
month
,
month
);
var
obj
=
new
Services
.
FinanceReportServices
().
ListMonthSaleProfit
(
month
,
""
);
var
list
=
obj
.
Select
(
a
=>
new
{
...
...
@@ -5592,10 +5592,49 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
a
.
month
});
var
head
=
new
List
<
Tuple
<
string
,
string
>>();
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td style=\"font-weight:bold;text-align:center;\">销售额</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td style=\"font-weight:bold;text-align:center;\">成本</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td style=\"font-weight:bold;text-align:center;\">平台扣费及退款</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td>平台费</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td>ebay刊登费</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td>paypal费用</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td>平台的物流费</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td>广告及宣传费-订阅费</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td>平台的仓储费</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td>退款</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td style=\"font-weight:bold;\">回款</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td style=\"font-weight:bold;text-align:center;\">物流仓储费用</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td>头程运输</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td>尾程物流</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td>海外仓的仓储费</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td>平台操作费</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td style=\"font-weight:bold;text-align:center;\">销售费用合计</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td style=\"font-weight:bold;text-align:center;\">销售利润</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td style=\"font-weight:bold;text-align:center;\">销售毛利率</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td style=\"font-weight:bold;text-align:center;\">销售相关的管理成本</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td>处理费</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td>直接支付的与销售平台相关费用</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td style=\"font-weight:bold;text-align:center;\">直接管理成本</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td>管理成本-香港百伦(不含直接支付的与销售平台相关的费用)</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td>管理成本-广州百伦</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td>管理成本-成品仓(不含直接支付的与销售平台相关的费用)</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td>财务费用</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td style=\"font-weight:bold;text-align:center;\">管理成本合计</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td style=\"font-weight:bold;text-align:center;\">营业利润</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td style=\"font-weight:bold;text-align:center;\">营业毛利率</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td>加:其他收入</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td>加:营业外收入</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td>减:营业外支出</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td style=\"font-weight:bold;text-align:center;\">实际利润</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td>减:分红</td>"
));
head
.
Add
(
new
Tuple
<
string
,
string
>(
""
,
"<td style=\"font-weight:bold;text-align:center;\">利润结余</td>"
));
return
Json
(
new
{
success
=
true
,
msg
=
""
,
data
=
list
data
=
list
,
head
=
head
});
}
catch
(
Exception
ex
)
...
...
Bailun.DC.Web/Areas/Reports/Controllers/WarehouseController.cs
View file @
98f86df0
...
...
@@ -727,17 +727,21 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="t">1:按采购下单,2:按入库</param>
/// <returns></returns>
[
HttpPost
]
public
JsonResult
DailyPurchaseSalesCountJson
(
int
dateWay
,
DateTime
start
,
DateTime
end
,
string
warehousetype
,
string
warehousecode
,
int
t
)
public
JsonResult
DailyPurchaseSalesCountJson
(
int
dateWay
,
DateTime
start
,
DateTime
end
,
string
warehousetype
,
string
warehousecode
,
int
t
)
{
var
list
=
new
List
<
mDailyPurchaseSales
>();
var
_service
=
new
Services
.
WareHouseServices
();
var
obj
=
_service
.
DailyPurchaseSaleBySkuCategory
(
warehousetype
,
warehousecode
,
start
,
end
).
OrderBy
(
a
=>
a
.
day
).
ToList
();
var
obj
=
_service
.
DailyPurchaseSaleBySkuCategory
(
warehousetype
,
warehousecode
,
start
,
end
).
OrderBy
(
a
=>
a
.
day
).
ToList
();
//Add by Allan at 201908261750 for 增加原料的统计
var
objSemi
=
_service
.
DailyPurchaseSaleBySkuCategory_Semi
(
warehousetype
,
warehousecode
,
start
,
end
).
OrderBy
(
a
=>
a
.
day
).
ToList
();
obj
.
AddRange
(
objSemi
);
//End Add
//Add by Allan at 201911041434 for 把原料再分类
var
objSemiCategory
=
_service
.
DailyPurchaseSaleByWH_Semi
(
start
,
end
);
//End Add
if
(
obj
.
Count
==
0
)
{
return
Json
(
new
...
...
@@ -748,6 +752,95 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
});
}
#
region
采购和发货情况
Add
by
Allan
at
20191104
var
listSubCount
=
new
List
<
Tuple
<
string
,
decimal
,
decimal
,
decimal
,
decimal
>>();
var
semi_E_Oil
=
objSemiCategory
.
Where
(
a
=>
a
.
category_simple_name
==
"精油灌装车间"
||
a
.
category_simple_name
==
"精油灌装车间"
);
//精油原料
var
semi_Hairdressing
=
objSemiCategory
.
Where
(
a
=>
a
.
category_simple_name
==
"美容组装车间"
||
a
.
category_simple_name
==
"美容生产车间"
);
//美容原料
var
semi_Manicure
=
objSemiCategory
.
Where
(
a
=>
a
.
category_simple_name
==
"阳山美甲灌装车间"
||
a
.
category_simple_name
==
"嘉禾美甲灌装车间"
||
a
.
category_simple_name
==
"哈倪蔓美甲灌装车间"
);
//美甲原料
var
semi_HNM
=
objSemiCategory
.
Where
(
a
=>
a
.
category_simple_name
==
"甲油胶生产车间"
);
//哈倪曼基料
var
finish_Gen
=
obj
.
Where
(
a
=>
a
.
category_simple_name
==
"普货"
);
//普货
var
finish_Manicure
=
obj
.
Where
(
a
=>
a
.
category_simple_name
==
"美甲"
);
//美甲生产
var
finish_E_Oil
=
obj
.
Where
(
a
=>
a
.
category_simple_name
==
"精油"
);
//精油生产
var
finish_Hairdressing
=
obj
.
Where
(
a
=>
a
.
category_simple_name
==
"美容"
);
//美容生产
if
(
semi_E_Oil
.
Count
()
>
0
)
{
listSubCount
.
Add
(
new
Tuple
<
string
,
decimal
,
decimal
,
decimal
,
decimal
>(
"精油原料"
,
semi_E_Oil
.
Sum
(
a
=>
a
.
amount_purchase
),
semi_E_Oil
.
Sum
(
a
=>
a
.
count_purchase
),
semi_E_Oil
.
Sum
(
a
=>
a
.
amount_shipping
),
semi_E_Oil
.
Sum
(
a
=>
a
.
count_shipping
)));
}
else
{
listSubCount
.
Add
(
new
Tuple
<
string
,
decimal
,
decimal
,
decimal
,
decimal
>(
"精油原料"
,
0
,
0
,
0
,
0
));
}
if
(
semi_Hairdressing
.
Count
()
>
0
)
{
listSubCount
.
Add
(
new
Tuple
<
string
,
decimal
,
decimal
,
decimal
,
decimal
>(
"美容原料"
,
semi_Hairdressing
.
Sum
(
a
=>
a
.
amount_purchase
),
semi_Hairdressing
.
Sum
(
a
=>
a
.
count_purchase
),
semi_Hairdressing
.
Sum
(
a
=>
a
.
amount_shipping
),
semi_Hairdressing
.
Sum
(
a
=>
a
.
count_shipping
)));
}
else
{
listSubCount
.
Add
(
new
Tuple
<
string
,
decimal
,
decimal
,
decimal
,
decimal
>(
"美容原料"
,
0
,
0
,
0
,
0
));
}
if
(
semi_Manicure
.
Count
()
>
0
)
{
listSubCount
.
Add
(
new
Tuple
<
string
,
decimal
,
decimal
,
decimal
,
decimal
>(
"美甲原料"
,
semi_Manicure
.
Sum
(
a
=>
a
.
amount_purchase
),
semi_Manicure
.
Sum
(
a
=>
a
.
count_purchase
),
semi_Manicure
.
Sum
(
a
=>
a
.
amount_shipping
),
semi_Manicure
.
Sum
(
a
=>
a
.
count_shipping
)));
}
else
{
listSubCount
.
Add
(
new
Tuple
<
string
,
decimal
,
decimal
,
decimal
,
decimal
>(
"美甲原料"
,
0
,
0
,
0
,
0
));
}
if
(
semi_HNM
.
Count
()
>
0
)
{
listSubCount
.
Add
(
new
Tuple
<
string
,
decimal
,
decimal
,
decimal
,
decimal
>(
"哈倪蔓基料"
,
semi_HNM
.
Sum
(
a
=>
a
.
amount_purchase
),
semi_HNM
.
Sum
(
a
=>
a
.
count_purchase
),
semi_HNM
.
Sum
(
a
=>
a
.
amount_shipping
),
semi_HNM
.
Sum
(
a
=>
a
.
count_shipping
)));
}
else
{
listSubCount
.
Add
(
new
Tuple
<
string
,
decimal
,
decimal
,
decimal
,
decimal
>(
"哈倪蔓基料"
,
0
,
0
,
0
,
0
));
}
if
(
finish_Gen
.
Count
()
>
0
)
{
listSubCount
.
Add
(
new
Tuple
<
string
,
decimal
,
decimal
,
decimal
,
decimal
>(
"普货"
,
finish_Gen
.
Sum
(
a
=>
a
.
amount_purchase
),
finish_Gen
.
Sum
(
a
=>
a
.
count_purchase
),
finish_Gen
.
Sum
(
a
=>
a
.
amount_shipping
),
finish_Gen
.
Sum
(
a
=>
a
.
count_shipping
)));
}
else
{
listSubCount
.
Add
(
new
Tuple
<
string
,
decimal
,
decimal
,
decimal
,
decimal
>(
"普货"
,
0
,
0
,
0
,
0
));
}
if
(
finish_Manicure
.
Count
()
>
0
)
{
listSubCount
.
Add
(
new
Tuple
<
string
,
decimal
,
decimal
,
decimal
,
decimal
>(
"美甲生产"
,
finish_Manicure
.
Sum
(
a
=>
a
.
amount_purchase
),
finish_Manicure
.
Sum
(
a
=>
a
.
count_purchase
),
finish_Manicure
.
Sum
(
a
=>
a
.
amount_shipping
),
finish_Manicure
.
Sum
(
a
=>
a
.
count_shipping
)));
}
else
{
listSubCount
.
Add
(
new
Tuple
<
string
,
decimal
,
decimal
,
decimal
,
decimal
>(
"美甲生产"
,
0
,
0
,
0
,
0
));
}
if
(
finish_E_Oil
.
Count
()
>
0
)
{
listSubCount
.
Add
(
new
Tuple
<
string
,
decimal
,
decimal
,
decimal
,
decimal
>(
"精油生产"
,
finish_E_Oil
.
Sum
(
a
=>
a
.
amount_purchase
),
finish_E_Oil
.
Sum
(
a
=>
a
.
count_purchase
),
finish_E_Oil
.
Sum
(
a
=>
a
.
amount_shipping
),
finish_E_Oil
.
Sum
(
a
=>
a
.
count_shipping
)));
}
else
{
listSubCount
.
Add
(
new
Tuple
<
string
,
decimal
,
decimal
,
decimal
,
decimal
>(
"精油生产"
,
0
,
0
,
0
,
0
));
}
if
(
finish_Hairdressing
.
Count
()
>
0
)
{
listSubCount
.
Add
(
new
Tuple
<
string
,
decimal
,
decimal
,
decimal
,
decimal
>(
"美容生产"
,
finish_Hairdressing
.
Sum
(
a
=>
a
.
amount_purchase
),
finish_Hairdressing
.
Sum
(
a
=>
a
.
count_purchase
),
finish_Hairdressing
.
Sum
(
a
=>
a
.
amount_shipping
),
finish_Hairdressing
.
Sum
(
a
=>
a
.
count_shipping
)));
}
else
{
listSubCount
.
Add
(
new
Tuple
<
string
,
decimal
,
decimal
,
decimal
,
decimal
>(
"美容生产"
,
0
,
0
,
0
,
0
));
}
#
endregion
if
(
dateWay
==
2
)
//按周
{
var
first
=
obj
.
FirstOrDefault
();
...
...
@@ -1082,7 +1175,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
head
=
head
,
data
=
data
,
counthead
=
countHead
,
countdata
=
countData
countdata
=
countData
,
subcount
=
listSubCount
});
}
...
...
Bailun.DC.Web/Areas/Reports/Views/Finance/MonthSaleProfit.cshtml
View file @
98f86df0
...
...
@@ -11,7 +11,7 @@
<form id="toolbar">
<div class="form-inline" style="line-height:40px;">
<div class="form-group">
<label>请选择月份</label>
<label>请选择
开始
月份</label>
<input id="month" name="month" class="form-control" style="width:130px;" placeholder="年.月" value="@(DateTime.Now.AddMonths(-1).ToString("yyyy-MM"))" />
</div>
<div class="form-group">
...
...
@@ -28,6 +28,12 @@
<div class="fixed-table-container">
<div class="fixed-table-body">
<table style="table-layout: fixed;" class="table table-border table-bordered table-hover table-bg table-sort form-inline">
<thead>
<tr>
<td>月份</td>
<td id="lbl_title" style="font-size:1.1em;font-weight:bold;">X月份销售利润表</td>
</tr>
</thead>
<tbody>
<tr>
<td style="width:420px;">项目</td>
...
...
@@ -307,12 +313,14 @@
var _temp = i.substr(i.length - 1, 1);
if (_temp == '_') {
$('.' + i).attr('val', obj[i]);
$('.' + i).attr('mon', obj['month']);
}
else {
$('.lbl_' + i).html(obj[i]);
$('.lbl_' + i).attr('mon', obj['month']);
try {
$('.' + i).attr('val', obj[i]);
$('.' + i).attr('mon', obj['month']);
} catch (e) {
}
...
...
@@ -335,16 +343,17 @@
function Edit(col, name) {
var v = $('.' + col).attr('val');
var mon = $('.' + col).attr('mon');
layer.prompt({ title: '编辑' + name, value:v}, function (text, index) {
layer.close(index);
Save(col, text);
Save(col, text
, mon
);
});
}
function Save(col, val) {
function Save(col, val
,mon
) {
$.submit({
url: '@Url.Content("~/Reports/Finance/SaveMonthSaleProfit")',
paramData: 'month=' +
$('#month').val()
+'&'+col+'='+val,
paramData: 'month=' +
mon
+'&'+col+'='+val,
type:'POST',
func: function (result) {
if (result.success) {
...
...
Bailun.DC.Web/Areas/Reports/Views/Warehouse/DailyPurchaseSalesCount.cshtml
View file @
98f86df0
...
...
@@ -59,6 +59,24 @@
<tbody></tbody>
</table>
</div>
<hr />
<label>子分析报表</label>
<div class="ibox-content m-b-sm border-bottom">
<table id="subcounttb" class="table table-hover table-bordered table-condensed table-striped">
<thead>
<tr>
<td>Sku分类</td>
<td>总采购下单金额</td>
<td>总采购下单数</td>
<td>总发货金额</td>
<td>总发货数量</td>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
@section css{
...
...
@@ -176,6 +194,22 @@
$('#counttb').find('tbody').append(s);
}
//subcounttb
$('#subcounttb').find('tbody').html('');
if (result.subcount.length > 0) {
for (var i = 0; i < result.subcount.length; i++) {
var s = '<tr>';
var obj = result.subcount[i];
for (var c in obj) {
s += ('<td>'+obj[c]+'</td>');
}
s += "</tr>";
$('#subcounttb').find('tbody').append(s);
}
}
}
else {
layer.msg('出现异常。');
...
...
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