615edaa5 by 周伟奇

amount sum col

1 parent 2a7c1a81
......@@ -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:
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!