diff --git a/modules/EcommerceFinance/Services/AccountLedgerRemarkMap.php b/modules/EcommerceFinance/Services/AccountLedgerRemarkMap.php index 8179a0ff..fd33d349 100644 --- a/modules/EcommerceFinance/Services/AccountLedgerRemarkMap.php +++ b/modules/EcommerceFinance/Services/AccountLedgerRemarkMap.php @@ -162,6 +162,7 @@ class AccountLedgerRemarkMap { $map = $this->map(); $remarks = []; + $rulesByPlatform = $this->accountMappingRulesByPlatform(); foreach ($this->platformsForTab($tab) as $platform) { foreach (array_values($map[$platform] ?? []) as $remark) { $remark = trim((string) $remark); @@ -169,6 +170,16 @@ class AccountLedgerRemarkMap $remarks[$remark] = true; } } + // 「财务规则 › 科目映射表」里的财务备注同样作为候选, + // 否则新加的备注要等总账备注映射表同步后才能在下拉里选到。 + foreach ($rulesByPlatform[$this->normalizeKey($platform)] ?? [] as $rules) { + foreach ($rules as $rule) { + $memo = trim((string) ($rule['memo'] ?? '')); + if ($memo !== '') { + $remarks[$memo] = true; + } + } + } } $list = array_keys($remarks);