Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
bmw-ocr
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
615edaa5
authored
2021-06-14 01:39:05 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
amount sum col
1 parent
2a7c1a81
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
src/apps/doc/ocr/wb.py
src/apps/doc/ocr/wb.py
View file @
615edaa
...
...
@@ -417,13 +417,14 @@ class BSWorkbook(Workbook):
for
i
in
range
(
max_column
-
src_header_len
):
header
.
append
(
None
)
add_col
=
[
'核对结果'
]
add_col
=
[
'核对结果'
,
'合计'
]
if
amount_cell_idx
is
None
:
if
income_cell_idx
is
not
None
or
outlay_cell_idx
is
not
None
:
add_col
=
[
'金额'
,
'核对结果'
]
add_col
=
[
'金额'
,
'核对结果'
,
'合计'
]
amount_cell_idx
=
len
(
header
)
header
.
extend
(
add_col
)
result_idx
=
len
(
header
)
-
1
result_idx
=
len
(
header
)
-
2
amount_sum_idx
=
len
(
header
)
-
1
tmp_ws
=
self
.
create_sheet
(
'tmp_ws'
)
tmp2_ws
=
self
.
create_sheet
(
'tmp2_ws'
)
...
...
@@ -478,7 +479,9 @@ class BSWorkbook(Workbook):
fill_row
.
add
(
summary_cell
.
row
)
# 户名高亮
row_num
=
2
for
cell
in
rows
:
row_num
=
cell
.
row
if
cell
.
value
==
role_name
:
fill_row
.
add
(
summary_cell
.
row
)
break
...
...
@@ -529,8 +532,8 @@ class BSWorkbook(Workbook):
amount_cell
.
value
,
set
())
.
add
(
amount_cell
.
row
)
# 3.5.核对结果
amount_col_letter
=
get_column_letter
(
amount_cell_idx
+
1
)
if
amount_success
and
over_success
and
amount_cell
.
row
>
2
:
amount_col_letter
=
get_column_letter
(
amount_cell_idx
+
1
)
over_col_letter
=
get_column_letter
(
over_cell_idx
+
1
)
if
is_reverse
:
rows
[
result_idx
]
.
value
=
'=IF({2}{0}=ROUND(SUM({2}{1},{3}{0}),4), "{4}", "{5}")'
.
format
(
...
...
@@ -539,6 +542,11 @@ class BSWorkbook(Workbook):
rows
[
result_idx
]
.
value
=
'=IF({2}{0}=ROUND(SUM({2}{1},{3}{0}),4), "{4}", "{5}")'
.
format
(
amount_cell
.
row
,
amount_cell
.
row
-
1
,
over_col_letter
,
amount_col_letter
,
*
self
.
proof_res
)
# 3.6 金额合计列
amount_sum_letter
=
get_column_letter
(
amount_sum_idx
+
1
)
rows
[
amount_sum_idx
]
.
value
=
'=SUM({0}{1},{2}{3})'
.
format
(
amount_sum_letter
,
row_num
-
1
,
amount_col_letter
,
row_num
)
# 3.2.提取信息、高亮
# row = summary_cell.row
if
summary_cell
is
not
None
:
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment