Skip to content

Commit b779751

Browse files
committed
Fix handling of 余额宝-转出到余额
1 parent cb66c7a commit b779751

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

china_bean_importers/alipay_mobile/__init__.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,12 @@ def extract(self, file, existing_entries=None):
8383
expense = False
8484
if payee == "余额宝" and "转入" in narration:
8585
expense = True
86-
if method == "花呗":
87-
if "还款" in narration:
88-
expense = True
86+
if method == "花呗" and "还款" in narration:
87+
expense = True
8988
if payee == "花呗" and "还款" in narration:
9089
expense = True
90+
if narration == "余额宝-转出到余额":
91+
expense = False
9192
if expense is None:
9293
# if '交易关闭' in status or '解冻成功' in status:
9394
my_warn(
@@ -110,7 +111,7 @@ def extract(self, file, existing_entries=None):
110111
account1 = source_config["account"] # 支付宝余额
111112
if "花呗" in method: # Handle discount transactions like "花呗&红包"
112113
account1 = source_config["huabei_account"]
113-
if method == "余额宝":
114+
elif method == "余额宝":
114115
account1 = source_config["yuebao_account"]
115116
elif tail := match_card_tail(method):
116117
account1 = find_account_by_card_number(self.config, tail)
@@ -120,6 +121,8 @@ def extract(self, file, existing_entries=None):
120121
account2 = None
121122
if payee == "余额宝" and "自动转入" in narration:
122123
account2 = source_config["yuebao_account"]
124+
elif method == "余额" and narration == "余额宝-转出到余额":
125+
account2 = source_config["yuebao_account"]
123126
elif category == "转账红包":
124127
account2 = (
125128
source_config["red_packet_income_account"]

0 commit comments

Comments
 (0)