Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date formatting incorrect for Bank Feeds and BankAccountTransactionRecords (?) #131

Open
simon-holm opened this issue May 16, 2024 · 0 comments

Comments

@simon-holm
Copy link

I'm new to Sage API and attempting to setup a bank feed.

The errors: [
"BL03000113 The Date 'Array' is not valid [Support ID: ....]",
'BL03000018 Format for Bank account transaction feed: Date added ${FLD_REF} is not valid.',
'BL01001973 Unable to validate bankaccttxnfeed record',
'BL01001973 Could not create bankaccttxnfeed record'
]

I printed the XML the SDK generates.

<FEEDDATE> <year>2024</year> <month>05</month> <day>15</day> </FEEDDATE>

According to the XML API docs the feed date should be formatted like this.

<FEEDDATE>05/15/2020</FEEDDATE>

In IaXmlWriter.ts

 public writeDateSplitElements(date: Date, writeNull?: boolean) {
        if (writeNull === null) {
            writeNull = true;
        }

        this.writeElement("year", dateFormat(date, "yyyy"), writeNull);
        this.writeElement("month", dateFormat(date, "mm"), writeNull);
        this.writeElement("day", dateFormat(date, "dd"), writeNull);
    }

This method is used for Feed date in BankFeedsCreate and posting date in BankAccountTransactionRecord.ts. Should perhaps writeElementDate be used instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant