[PR #3086] [MERGED] CAMT.053: Handle missing ValDt on entries with Sts Book #102367

Closed
opened 2026-05-30 01:06:42 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/3086
Author: @simonschmidt
Created: 7/17/2024
Status: ✅ Merged
Merged: 7/17/2024
Merged by: @youngcw

Base: master ← Head: xml-missing-valdt


📝 Commits (3)

📊 Changes

3 files changed (+10 additions, -3 deletions)

View changed files

📝 packages/loot-core/src/mocks/files/camt/camt.053.xml (+1 -3)
📝 packages/loot-core/src/server/accounts/xmlcamt2json.ts (+3 -0)
➕ upcoming-release-notes/3086.md (+6 -0)

📄 Description

In the XML export from LHV entries only have date information in BookgDt but there is no ValDt.

For reference, this is the schema declared in the export I get:

<Document
  xmlns="urn:iso:std:iso:20022:tech:xsd:camt.053.001.02"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:camt.053.001.02 camt.053.001.02.xsd"
  >

The error I got was in getDtOrDtTm:

TypeError: right-hand side of 'in' should be an object, got undefined

This handles that by explicitly checking for falsy input. The code seems to have already been expecting
this situation as it already falls back to BookgDt in:

const date = getDtOrDtTm(entry.ValDt) || getDtOrDtTm(entry.BookgDt);

Glancing over the xsd spec this seems to make sense as both ValDt and BookgDt have minOccurs="0" maxOccurs="1"


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/3086 **Author:** [@simonschmidt](https://github.com/simonschmidt) **Created:** 7/17/2024 **Status:** ✅ Merged **Merged:** 7/17/2024 **Merged by:** [@youngcw](https://github.com/youngcw) **Base:** `master` ← **Head:** `xml-missing-valdt` --- ### 📝 Commits (3) - [`a3a6ae8`](https://github.com/actualbudget/actual/commit/a3a6ae81e195af7466f6049aa96fdb314ab49c02) Replicate seen-in-the-wild camt.053 example - [`a9df7d0`](https://github.com/actualbudget/actual/commit/a9df7d013a9f04a3f31352723070e09252d23eb3) Handle missing ValDt in camt - [`f44aa3b`](https://github.com/actualbudget/actual/commit/f44aa3b8c92ec462d5f7b070b495ab0b190a037f) Release notes for #3086 ### 📊 Changes **3 files changed** (+10 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/loot-core/src/mocks/files/camt/camt.053.xml` (+1 -3) 📝 `packages/loot-core/src/server/accounts/xmlcamt2json.ts` (+3 -0) ➕ `upcoming-release-notes/3086.md` (+6 -0) </details> ### 📄 Description In the XML export from [LHV](https://lhv.ee) entries only have date information in `BookgDt` but there is no `ValDt`. For reference, this is the schema declared in the export I get: ``` <Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.053.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:camt.053.001.02 camt.053.001.02.xsd" > ``` --- The error I got was in `getDtOrDtTm`: > TypeError: right-hand side of 'in' should be an object, got undefined This handles that by explicitly checking for falsy input. The code seems to have already been expecting this situation as it already falls back to `BookgDt` in: ```javascript const date = getDtOrDtTm(entry.ValDt) || getDtOrDtTm(entry.BookgDt); ``` Glancing over the xsd spec this seems to make sense as both `ValDt` and `BookgDt` have `minOccurs="0" maxOccurs="1"` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-30 01:06:42 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#102367