Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dwsproject
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dws
dwsproject
Commits
6f8f0893
Commit
6f8f0893
authored
Oct 30, 2025
by
马丽华
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mlh_jzjx_project' into 'master'
财务收支记录 See merge request
!35
parents
cdd07d60
d4d7c7f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
roke_product_income_expense/controller/main.py
+9
-5
No files found.
roke_product_income_expense/controller/main.py
View file @
6f8f0893
...
...
@@ -78,15 +78,19 @@ class ProductIncomeExpenseIframe(http.Controller):
return
{
"code"
:
1
,
"message"
:
"更新失败,没找到对应数据。"
}
else
:
# 创建
# 支出
expenditure
=
float
(
v
.
get
(
"expenditure"
,
0
)
or
0
)
# 收入
income
=
float
(
v
.
get
(
"income"
,
0
)
or
0
)
# # 支出
# expenditure = float(v.get("expenditure", 0) or 0)
# # 收入
# income = float(v.get("income", 0) or 0)
if
v
.
get
(
"expenditure"
)
in
[
''
,
None
,
False
]:
v
.
update
({
"expenditure"
:
0
})
if
v
.
get
(
"income"
)
in
[
''
,
None
,
False
]:
v
.
update
({
"income"
:
0
})
# 最新一条数据
latest_record
=
model
.
search
([],
order
=
"business_date desc,create_date desc"
,
limit
=
1
)
# 计算结余
balance
=
round
(
latest_record
.
balance
+
(
income
-
expenditure
),
2
)
balance
=
round
(
latest_record
.
balance
+
float
(
v
.
get
(
"income"
))
-
float
(
v
.
get
(
"expenditure"
)
),
2
)
cr
.
execute
(
"""
INSERT INTO roke_product_income_expense
...
...
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