d2a39b3f by 周伟奇

fix bug

1 parent fe25f273
......@@ -656,24 +656,33 @@ class BSWorkbook(Workbook):
count_list.append((field_str, count))
def simple_license_rebuild(self, license_summary, document_scheme):
for ic_license_dict in license_summary.get(consts.IC_CLASSIFY, []):
if ic_license_dict.get('类别') == '1':
license_summary.setdefault(consts.RP_CLASSIFY, []).append(ic_license_dict)
continue
for vat_license_dict in license_summary.get(consts.VAT_CLASSIFY, []):
if vat_license_dict.get('发票类型') == 'special':
license_summary.setdefault(consts.VATS_CLASSIFY, []).append(vat_license_dict)
continue
# for ic_license_dict in license_summary.get(consts.IC_CLASSIFY, []):
# if ic_license_dict.get('类别') == '1':
# license_summary.setdefault(consts.RP_CLASSIFY, []).append(ic_license_dict)
# continue
#
# for vat_license_dict in license_summary.get(consts.VAT_CLASSIFY, []):
# if vat_license_dict.get('发票类型') == 'special':
# license_summary.setdefault(consts.VATS_CLASSIFY, []).append(vat_license_dict)
# continue
for classify, (_, name, field_order, side_diff, scheme_diff, _) in consts.FOLDER_LICENSE_ORDER:
license_list = license_summary.get(classify)
if not license_list:
continue
ws = self.create_sheet(name)
# if scheme_diff and document_scheme == consts.DOC_SCHEME_LIST[1]:
# classify = consts.MVC_CLASSIFY_SE
for license_dict in license_list:
if classify == consts.IC_CLASSIFY and license_dict.get('类别') == '1': # 居住证处理
license_summary.setdefault(consts.RP_CLASSIFY, []).append(license_dict)
continue
if classify == consts.VAT_CLASSIFY and license_dict.get('发票类型') == 'special':
license_summary.setdefault(consts.VATS_CLASSIFY, []).append(license_dict)
continue
if name in self.sheetnames:
ws = self.get_sheet_by_name(name)
else:
ws = self.create_sheet(name)
if side_diff:
key, field_order_yes, field_order_no = consts.FIELD_ORDER_MAP.get(classify)
field_order = field_order_yes if key in license_dict else field_order_no
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!