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
927f06c4
Commit
927f06c4
authored
Dec 18, 2019
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成应收账款其他金额的编辑功能
parent
5a5e6124
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
103 additions
and
6 deletions
+103
-6
FinanceReportServices.cs
Bailun.DC.Services/FinanceReportServices.cs
+56
-1
FinanceController.cs
Bailun.DC.Web/Areas/Reports/Controllers/FinanceController.cs
+1
-0
PlatformReceivable.cshtml
...Web/Areas/Reports/Views/Finance/PlatformReceivable.cshtml
+46
-5
No files found.
Bailun.DC.Services/FinanceReportServices.cs
View file @
927f06c4
...
@@ -4710,10 +4710,65 @@ group by currency";
...
@@ -4710,10 +4710,65 @@ group by currency";
obj
.
lastupdateuserid
=
uid
;
obj
.
lastupdateuserid
=
uid
;
obj
.
lastupdateusername
=
username
;
obj
.
lastupdateusername
=
username
;
return
cn
.
Update
(
obj
)>
0
?
""
:
"更新失败,请重试!"
;
var
result
=
cn
.
Update
(
obj
);
if
(
result
>
0
)
{
UpdateReceivableEndAmount
(
obj
,
cn
,
uid
,
username
);
}
return
result
>
0
?
""
:
"更新失败,请重试!"
;
}
}
}
}
/// <summary>
/// 更新应收账款期末金额
/// </summary>
/// <param name="m"></param>
/// <param name="cn"></param>
/// <param name="uid"></param>
/// <param name="username"></param>
private
void
UpdateReceivableEndAmount
(
dc_daily_receivable
m
,
MySqlConnection
cn
,
int
uid
,
string
username
)
{
if
(
cn
.
State
==
ConnectionState
.
Closed
)
{
cn
.
Open
();
}
var
sql
=
$"select * from dc_daily_receivable where day='
{
m
.
day
.
AddDays
(
1
).
ToString
(
"yyyy-MM-dd"
)}
' and platform='
{
m
.
platform
}
'"
;
var
obj
=
cn
.
QueryFirstOrDefault
<
dc_daily_receivable
>(
sql
);
if
(
obj
!=
null
)
{
//Ebay预收账款=期初预收余额+本期收款(订单付款金额)-发货金额-退款(未发货的)
if
(
obj
.
platform
.
ToLower
()
==
"ebay"
)
{
obj
.
amount_start
=
m
.
amount_end
;
obj
.
amount_end
=
obj
.
amount_start
+
obj
.
amount_sale_pay
-
obj
.
amount_shipping
-
obj
.
amount_refund
;
obj
.
lastupdatetime
=
DateTime
.
Now
;
obj
.
lastupdateuserid
=
uid
;
obj
.
lastupdateusername
=
username
;
cn
.
Update
<
dc_daily_receivable
>(
obj
);
}
//非Ebay 应收账款=期初应收余额+本期销售收入-平台扣费-放款金额-退款金额+其他
else
if
(
obj
.
platform
.
ToLower
()
!=
"ebay"
)
{
obj
.
amount_start
=
m
.
amount_end
;
obj
.
amount_end
=
obj
.
amount_start
+
obj
.
amount_sale_shipping
-
obj
.
amount_platformfee
-
obj
.
amount_incoming
-
obj
.
amount_refund
+
obj
.
amount_other
;
obj
.
lastupdatetime
=
DateTime
.
Now
;
obj
.
lastupdateuserid
=
uid
;
obj
.
lastupdateusername
=
username
;
cn
.
Update
<
dc_daily_receivable
>(
obj
);
}
UpdateReceivableEndAmount
(
obj
,
cn
,
uid
,
username
);
}
}
#
endregion
#
endregion
...
...
Bailun.DC.Web/Areas/Reports/Controllers/FinanceController.cs
View file @
927f06c4
...
@@ -6084,6 +6084,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
...
@@ -6084,6 +6084,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
var
obj
=
_service
.
ListReceivable
(
parameter
,
platform
,
start
,
end
,
type
,
ref
total
);
var
obj
=
_service
.
ListReceivable
(
parameter
,
platform
,
start
,
end
,
type
,
ref
total
);
var
list
=
obj
.
Select
(
a
=>
new
{
var
list
=
obj
.
Select
(
a
=>
new
{
a
.
id
,
a
.
platform
,
a
.
platform
,
day
=
a
.
day
.
ToString
(
"yyyy-MM-dd"
),
day
=
a
.
day
.
ToString
(
"yyyy-MM-dd"
),
amount_end
=
a
.
amount_end
.
ToString
(
"N2"
),
amount_end
=
a
.
amount_end
.
ToString
(
"N2"
),
...
...
Bailun.DC.Web/Areas/Reports/Views/Finance/PlatformReceivable.cshtml
View file @
927f06c4
...
@@ -63,6 +63,7 @@
...
@@ -63,6 +63,7 @@
}
}
@section scripts{
@section scripts{
<script src="~/css/Layer-2.1/extend/layer.ext.js"></script>
<script type="text/javascript">
<script type="text/javascript">
var tb;
var tb;
var tb2;
var tb2;
...
@@ -116,11 +117,15 @@
...
@@ -116,11 +117,15 @@
{ field: 'amount_platformfee', title: '平台扣费', width: '110', iscount: true },
{ field: 'amount_platformfee', title: '平台扣费', width: '110', iscount: true },
{ field: 'amount_incoming', title: '放款金额', width: '110', iscount: true },
{ field: 'amount_incoming', title: '放款金额', width: '110', iscount: true },
{ field: 'amount_refund', title: '退款(已发货)', width: '130', iscount: true },
{ field: 'amount_refund', title: '退款(已发货)', width: '130', iscount: true },
{ field: 'amount_other', title: '其他金额', width: '110', iscount: true },
{
field: 'amount_other', title: '其他金额', width: '110', iscount: true, formatter: function (idx, data) {
return '<span>' + data.amount_other + '</span><a href="javascript:;" onclick="showmodel(' + data.id + ',\'' + data.day + '\',\'' + data.platform + '\',\'' + data.amount_other+'\');">编辑</a>';
}
},
{ field: 'amount_end', title: '期末应收账款', width: '130', iscount: true }
{ field: 'amount_end', title: '期末应收账款', width: '130', iscount: true }
];
];
}
}
var url = '@Url.Content("~/Reports/Finance/PlatformReceivableJson")' + '?' + $("#toolbar").serialize();
var url = '@Url.Content("~/Reports/Finance/PlatformReceivableJson")' + '?' + $("#toolbar").serialize();
...
@@ -149,7 +154,7 @@
...
@@ -149,7 +154,7 @@
else {
else {
tb.bootstrapTable('refresh', { url: url });
tb.bootstrapTable('refresh', { url: url });
}
}
}
}
else {
else {
...
@@ -186,7 +191,7 @@
...
@@ -186,7 +191,7 @@
tb2.bootstrapTable('refresh', { url: url });
tb2.bootstrapTable('refresh', { url: url });
}
}
}
}
}
}
function listPlatform() {
function listPlatform() {
...
@@ -207,7 +212,43 @@
...
@@ -207,7 +212,43 @@
})
})
}
}
var _day;
var _platform;
var _amount;
function showmodel(i,d, p, m) {
_day = d;
_platform = p;
_amount = m;
layer.prompt({ title: p+" "+d+" 的其他金额", value: m }, function (text, index) {
layer.close(index);
SaveOther(i,text);
});
}
function SaveOther(id,val) {
$.submit({
url: '@Url.Content("~/Reports/Finance/UpdatePlatformReceivable")',
type:'POST',
paramData: 'id=' + id +'&amount='+val,
func: function (result) {
if (result.success) {
layer.msg('提交成功!');
setTimeout(function () {
list();
}, 2 * 1000);
}
else {
layer.msg(result.msg);
}
}
})
}
</script>
</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