<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: leren huan</title>
    <description>The latest articles on DEV Community by leren huan (@leren_huan_1faa261d7aca76).</description>
    <link>https://dev.to/leren_huan_1faa261d7aca76</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4267337%2F2c069a5a-6051-4a24-bd98-1c55e9a86782.png</url>
      <title>DEV Community: leren huan</title>
      <link>https://dev.to/leren_huan_1faa261d7aca76</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/leren_huan_1faa261d7aca76"/>
    <language>en</language>
    <item>
      <title>QuickBooks .QBO Import Errors Explained: Fixing OL-221, OL-222, Duplicate FITIDs, and Missing INTU.BID Locally</title>
      <dc:creator>leren huan</dc:creator>
      <pubDate>Sun, 29 Nov 2026 09:29:24 +0000</pubDate>
      <link>https://dev.to/leren_huan_1faa261d7aca76/quickbooks-qbo-import-errors-explained-fixing-ol-221-ol-222-duplicate-fitids-and-missing-n2o</link>
      <guid>https://dev.to/leren_huan_1faa261d7aca76/quickbooks-qbo-import-errors-explained-fixing-ol-221-ol-222-duplicate-fitids-and-missing-n2o</guid>
      <description>&lt;p&gt;When importing a bank or credit card &lt;code&gt;.QBO&lt;/code&gt; (QuickBooks Web Connect / OFX) file into &lt;strong&gt;QuickBooks Online&lt;/strong&gt; or &lt;strong&gt;QuickBooks Desktop&lt;/strong&gt;, failures rarely come from "corrupt bank data." In practice, over 80% of import rejections—and even worse, &lt;strong&gt;silent missing transactions&lt;/strong&gt;—come from four tiny deterministic formatting bugs inside the OFX/SGML payload.&lt;/p&gt;

&lt;p&gt;This guide breaks down the exact specification rules behind &lt;strong&gt;OL-221&lt;/strong&gt;, &lt;strong&gt;OL-222&lt;/strong&gt;, &lt;strong&gt;OL-301 / invalid &lt;code&gt;&amp;lt;INTU.BID&amp;gt;&lt;/code&gt;&lt;/strong&gt;, and &lt;strong&gt;duplicate &lt;code&gt;&amp;lt;FITID&amp;gt;&lt;/code&gt; silent row skipping&lt;/strong&gt;, along with zero-upload local ways to inspect and repair them.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Silent Missing Rows: Duplicate &lt;code&gt;&amp;lt;FITID&amp;gt;&lt;/code&gt; Collisions
&lt;/h2&gt;

&lt;p&gt;Every transaction inside a &lt;code&gt;.QBO&lt;/code&gt; or &lt;code&gt;.OFX&lt;/code&gt; file carries a &lt;code&gt;&amp;lt;FITID&amp;gt;&lt;/code&gt; (Financial Institution Transaction ID) inside its &lt;code&gt;&amp;lt;STMTTRN&amp;gt;&lt;/code&gt; block:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;STMTTRN&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;TRNTYPE&amp;gt;&lt;/span&gt;DEBIT
  &lt;span class="nt"&gt;&amp;lt;DTPOSTED&amp;gt;&lt;/span&gt;20261015120000
  &lt;span class="nt"&gt;&amp;lt;TRNAMT&amp;gt;&lt;/span&gt;-49.00
  &lt;span class="nt"&gt;&amp;lt;FITID&amp;gt;&lt;/span&gt;202610150001
  &lt;span class="nt"&gt;&amp;lt;NAME&amp;gt;&lt;/span&gt;STRIPE PAYOUT FEE
&lt;span class="nt"&gt;&amp;lt;/STMTTRN&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What goes wrong:&lt;/strong&gt;&lt;br&gt;
QuickBooks uses &lt;code&gt;&amp;lt;FITID&amp;gt;&lt;/code&gt; as a strict deduplication primary key per bank account. If a third-party CSV-to-QBO script generates sequential IDs (&lt;code&gt;1, 2, 3...&lt;/code&gt;), reuses date+amount hashes when two identical &lt;code&gt;$15.00&lt;/code&gt; Uber charges occur on the same day, or overlaps two monthly statements, &lt;strong&gt;QuickBooks silently drops the colliding rows without throwing an error dialog.&lt;/strong&gt; Your ending balance then drifts off by the exact sum of the skipped transactions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The deterministic fix:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every transaction in a &lt;code&gt;.QBO&lt;/code&gt; export must have a &lt;strong&gt;strictly unique, stable &lt;code&gt;&amp;lt;FITID&amp;gt;&lt;/code&gt;&lt;/strong&gt; (for example, a deterministic FNV-1a / SHA-based hash incorporating date, signed cents, normalized payee, &lt;strong&gt;and&lt;/strong&gt; same-day occurrence index).&lt;/li&gt;
&lt;li&gt;If you are re-importing a corrected file into an account that already rejected or partially absorbed an earlier batch, regenerate fresh collision-free &lt;code&gt;&amp;lt;FITID&amp;gt;&lt;/code&gt; values across the file before uploading again.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can detect and repair duplicate &lt;code&gt;&amp;lt;FITID&amp;gt;&lt;/code&gt; tags in 2 seconds locally in your browser (pure JavaScript, zero server upload) using the free &lt;strong&gt;&lt;a href="https://stmtverify.com/tools/qbo-fitid-fixer" rel="noopener noreferrer"&gt;StmtVerify .QBO Duplicate FITID Fixer&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  2. Error OL-221 &amp;amp; OL-222: Unescaped &lt;code&gt;&amp;amp;&lt;/code&gt; and Invalid Characters in &lt;code&gt;&amp;lt;NAME&amp;gt;&lt;/code&gt; / &lt;code&gt;&amp;lt;MEMO&amp;gt;&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;QuickBooks Web Connect supports both &lt;strong&gt;OFX 1.x (SGML)&lt;/strong&gt; and &lt;strong&gt;OFX 2.x (XML)&lt;/strong&gt;. In both parsers, raw XML control characters inside merchant descriptions trigger immediate rejection codes such as &lt;strong&gt;OL-221&lt;/strong&gt; or &lt;strong&gt;OL-222&lt;/strong&gt; ("QuickBooks was unable to verify the Financial Institution Information" / "Your file could not be read"):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- BROKEN: raw ampersand breaks strict OFX/XML parsing --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;NAME&amp;gt;&lt;/span&gt;AT&amp;amp;T MOBILITY #4412&lt;span class="nt"&gt;&amp;lt;/NAME&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- FIXED: properly entity-escaped and length-clamped --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;NAME&amp;gt;&lt;/span&gt;AT&lt;span class="ni"&gt;&amp;amp;amp;&lt;/span&gt;T MOBILITY #4412&lt;span class="nt"&gt;&amp;lt;/NAME&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Three hidden traps in &lt;code&gt;&amp;lt;NAME&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;MEMO&amp;gt;&lt;/code&gt;:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Unescaped &lt;code&gt;&amp;amp;&lt;/code&gt;, &lt;code&gt;&amp;lt;&lt;/code&gt;, &lt;code&gt;&amp;gt;&lt;/code&gt;&lt;/strong&gt;: Merchants like &lt;code&gt;AT&amp;amp;T&lt;/code&gt;, &lt;code&gt;H&amp;amp;M&lt;/code&gt;, &lt;code&gt;Barnes &amp;amp; Noble&lt;/code&gt;, or &lt;code&gt;M&amp;amp;S&lt;/code&gt; must encode &lt;code&gt;&amp;amp;&lt;/code&gt; as &lt;code&gt;&amp;amp;amp;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Legacy field length limits&lt;/strong&gt;: Strict QuickBooks Desktop parsers truncate or choke on &lt;code&gt;&amp;lt;NAME&amp;gt;&lt;/code&gt; longer than &lt;strong&gt;32 characters&lt;/strong&gt; or non-ASCII UTF-8 control characters copied out of messy bank CSV exports.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Broken date stamps&lt;/strong&gt;: &lt;code&gt;&amp;lt;DTPOSTED&amp;gt;&lt;/code&gt; must use &lt;code&gt;YYYYMMDD&lt;/code&gt; (or &lt;code&gt;YYYYMMDDHHMMSS&lt;/code&gt;), never &lt;code&gt;MM/DD/YYYY&lt;/code&gt; or &lt;code&gt;DD-MM-YYYY&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  3. Error OL-301 / Unrecognized Financial Institution: Missing &lt;code&gt;&amp;lt;INTU.BID&amp;gt;&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;A valid &lt;code&gt;.OFX&lt;/code&gt; file from a European, Canadian, Australian, or fintech bank (Wise, Revolut, Payoneer, Mercury) often fails in QuickBooks with an institution verification error even though the XML itself is valid.&lt;/p&gt;

&lt;p&gt;Why? QuickBooks requires a proprietary Intuit header tag inside &lt;code&gt;&amp;lt;SONRS&amp;gt;&amp;lt;FI&amp;gt;&lt;/code&gt; (or directly under &lt;code&gt;&amp;lt;SONRS&amp;gt;&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;INTU.BID&amp;gt;&lt;/span&gt;3000&lt;span class="nt"&gt;&amp;lt;/INTU.BID&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If &lt;code&gt;&amp;lt;INTU.BID&amp;gt;&lt;/code&gt; is missing—or contains an inactive bank ID from Intuit's &lt;code&gt;fidir.txt&lt;/code&gt; directory—QuickBooks refuses to open the file. Injecting a valid active &lt;code&gt;&amp;lt;INTU.BID&amp;gt;&lt;/code&gt; (such as &lt;code&gt;3000&lt;/code&gt; for Wells Fargo / generic Web Connect compatibility when importing manually) lets QuickBooks parse the file cleanly while letting you map it to &lt;strong&gt;any&lt;/strong&gt; existing account inside your Chart of Accounts during import.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. When Your Bank Only Gives You PDFs (or More Than 90 Days of History)
&lt;/h2&gt;

&lt;p&gt;QuickBooks Online's automatic bank feed only pulls roughly &lt;strong&gt;90 days&lt;/strong&gt; of historical transactions on initial connection. When catching up 6–12 months of Chase, Bank of America, Amex, PayPal, or Wise PDF statements before tax season, two checks prevent hours of manual cleanup:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Mathematical Balance Continuity Proof (&lt;code&gt;0.00&lt;/code&gt; variance)&lt;/strong&gt;: Verify &lt;code&gt;Opening Balance + Total Credits − Total Debits == Closing Balance&lt;/code&gt; in exact integer cents &lt;em&gt;before&lt;/em&gt; generating the &lt;code&gt;.QBO&lt;/code&gt; file so missing lines or flipped credit-card signs never enter your ledger.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-Month Overlap Deduplication&lt;/strong&gt;: When dropping 12 monthly PDFs together, verify Month &lt;em&gt;N&lt;/em&gt; closing balance equals Month &lt;em&gt;N+1&lt;/em&gt; opening balance and strip overlapping cutoff-day rows.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Free Local Tools &amp;amp; Open-Source Reference
&lt;/h2&gt;

&lt;p&gt;Full disclosure: I am an indie software developer (not a CPA) who maintains an MIT-licensed accounting format spec and free browser-only utilities alongside &lt;strong&gt;StmtVerify&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Free Local QuickBooks Error Code &amp;amp; Bank Charge Decoder&lt;/strong&gt; (instant offline lookup for 40 codes: &lt;code&gt;OL-205&lt;/code&gt;–&lt;code&gt;OLS-0001&lt;/code&gt;, &lt;code&gt;Error 101&lt;/code&gt;–&lt;code&gt;9999&lt;/code&gt;, duplicate &lt;code&gt;&amp;lt;FITID&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;INTU.BID&amp;gt;&lt;/code&gt;, plus cryptic bank/Intuit charge descriptors): &lt;a href="https://stmtverify.com/tools/qbo-error-code-decoder" rel="noopener noreferrer"&gt;https://stmtverify.com/tools/qbo-error-code-decoder&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Free Local Accounting File Validator&lt;/strong&gt; (QBO/OFX, SWIFT MT940, DATEV EXTF, Xero CSV, FEC, Yayoi — 100% in-browser, zero upload): &lt;a href="https://stmtverify.com/tools/accounting-file-validator" rel="noopener noreferrer"&gt;https://stmtverify.com/tools/accounting-file-validator&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Free Local .QBO Duplicate &lt;code&gt;&amp;lt;FITID&amp;gt;&lt;/code&gt; &amp;amp; OL-221 Fixer&lt;/strong&gt;: &lt;a href="https://stmtverify.com/tools/qbo-fitid-fixer" rel="noopener noreferrer"&gt;https://stmtverify.com/tools/qbo-fitid-fixer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Free Local CSV → QuickBooks &lt;code&gt;.QBO/.OFX&lt;/code&gt; Converter&lt;/strong&gt;: &lt;a href="https://stmtverify.com/tools/csv-to-qbo-converter" rel="noopener noreferrer"&gt;https://stmtverify.com/tools/csv-to-qbo-converter&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Embeddable Free Firm Website Widgets &amp;amp; Partner Program&lt;/strong&gt; (1-line &lt;code&gt;&amp;lt;iframe&amp;gt;&lt;/code&gt; embed for WordPress/Webflow + 30% recurring affiliate): &lt;a href="https://stmtverify.com/partners" rel="noopener noreferrer"&gt;https://stmtverify.com/partners&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MIT Open-Source Python Validator &amp;amp; Format Spec&lt;/strong&gt;: &lt;a href="https://github.com/lerenhuan-hash/bank-statement-format-spec" rel="noopener noreferrer"&gt;https://github.com/lerenhuan-hash/bank-statement-format-spec&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Paid Volatile-RAM PDF &amp;amp; Receipt Tools&lt;/strong&gt; (same domain — 12-month QuickBooks bank PDF catch-up at &lt;a href="https://stmtverify.com/lp/quickbooks-12-month-catch-up-bank-pdf" rel="noopener noreferrer"&gt;https://stmtverify.com/lp/quickbooks-12-month-catch-up-bank-pdf&lt;/a&gt; and batch iPhone &lt;code&gt;.HEIC&lt;/code&gt; receipt photos to Excel + 4-Up A4 PDF at &lt;a href="https://stmtverify.com/receipts/" rel="noopener noreferrer"&gt;https://stmtverify.com/receipts/&lt;/a&gt;, with a &lt;code&gt;$9.90&lt;/code&gt; 7-day non-renewing pass and 6 free instant sample downloads to verify output first).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you hit a weird QuickBooks Web Connect error code or bank CSV layout that breaks your import, drop the anonymized header snippet in the comments and I will document the exact parsing rule!&lt;/p&gt;

</description>
      <category>quickbooks</category>
      <category>accounting</category>
      <category>fintech</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Preventing Rounding Drift &amp; Excel Formula Injection in Automated Receipt OCR Pipelines (Python Decimal + Volatile RAM)</title>
      <dc:creator>leren huan</dc:creator>
      <pubDate>Sat, 28 Nov 2026 04:10:07 +0000</pubDate>
      <link>https://dev.to/leren_huan_1faa261d7aca76/preventing-rounding-drift-excel-formula-injection-in-automated-receipt-ocr-pipelines-python-4k4k</link>
      <guid>https://dev.to/leren_huan_1faa261d7aca76/preventing-rounding-drift-excel-formula-injection-in-automated-receipt-ocr-pipelines-python-4k4k</guid>
      <description>&lt;p&gt;Most receipt-scanning scripts fail in production for three boring engineering reasons — none of which have to do with the OCR model itself:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;IEEE-754 floating-point drift&lt;/strong&gt; when checking &lt;code&gt;subtotal + tax + tip == total&lt;/code&gt; across dozens of receipts (&lt;code&gt;18.50 + 1.48 + 2.00&lt;/code&gt; looks harmless until VAT rates and 30-row sums produce a &lt;code&gt;0.01&lt;/code&gt; reconciliation mismatch).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CSV / Excel formula injection (&lt;code&gt;DDE&lt;/code&gt; / &lt;code&gt;=HYPERLINK&lt;/code&gt;)&lt;/strong&gt; when untrusted OCR text from a receipt memo or merchant header starts with &lt;code&gt;=&lt;/code&gt;, &lt;code&gt;+&lt;/code&gt;, &lt;code&gt;-&lt;/code&gt;, or &lt;code&gt;@&lt;/code&gt; and gets written verbatim into an &lt;code&gt;.xlsx&lt;/code&gt; or &lt;code&gt;.csv&lt;/code&gt; cell.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unnecessary cloud retention &amp;amp; broken print layouts&lt;/strong&gt; — finance teams still ask for printable A4 receipt voucher sheets (&lt;code&gt;4-Up&lt;/code&gt; per page) with IDs matching Excel row numbers (&lt;code&gt;R-01&lt;/code&gt; .. &lt;code&gt;R-30&lt;/code&gt;), yet most tools dump 30 loose phone photos into a zip file or persist private receipts in S3 buckets.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is the minimal deterministic pattern we used to build a zero-account, volatile-RAM batch receipt pipeline (and four free local browser accounting utilities).&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Exact Cent Math With &lt;code&gt;Decimal&lt;/code&gt; (Never &lt;code&gt;float&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Every parsed receipt amount should be quantized with &lt;code&gt;ROUND_HALF_UP&lt;/code&gt; to &lt;code&gt;Decimal("0.01")&lt;/code&gt; before running the tax integrity check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;decimal&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;Decimal&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;ROUND_HALF_UP&lt;/span&gt;

&lt;span class="no"&gt;CENT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Decimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"0.01"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;q2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nc"&gt;Decimal&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;Decimal&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Decimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"0.00"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Decimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;quantize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;CENT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rounding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="no"&gt;ROUND_HALF_UP&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;verify_receipt_math&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;subtotal&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Decimal&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tax&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Decimal&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tip&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Decimal&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Decimal&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;expected&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;subtotal&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tax&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tip&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;quantize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;CENT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rounding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="no"&gt;ROUND_HALF_UP&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;diff&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;expected&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;quantize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;CENT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rounding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="no"&gt;ROUND_HALF_UP&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"expected_total"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;expected&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"variance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;diff&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"VERIFIED"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;diff&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="nc"&gt;Decimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"0.00"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="s2"&gt;"DISCREPANCY"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why this matters in practice: when thermal ink fades on a gas-station or hotel receipt, OCR often misreads &lt;code&gt;8&lt;/code&gt; as &lt;code&gt;3&lt;/code&gt; or drops a digit on the tax line. A deterministic &lt;code&gt;Subtotal + Tax + Tip == Total&lt;/code&gt; gate catches 90%+ of silent OCR misreads &lt;em&gt;before&lt;/em&gt; an accountant sees the spreadsheet, and lets the user fix the single flagged cell side-by-side with the original image.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Neutralizing Excel &amp;amp; CSV Formula Injection on Untrusted OCR Strings
&lt;/h2&gt;

&lt;p&gt;OCR text extracted from arbitrary receipts or supplier invoices is &lt;strong&gt;untrusted user input&lt;/strong&gt;. A merchant name or memo string starting with &lt;code&gt;=&lt;/code&gt;, &lt;code&gt;+&lt;/code&gt;, &lt;code&gt;-&lt;/code&gt;, &lt;code&gt;@&lt;/code&gt;, &lt;code&gt;\t&lt;/code&gt;, or &lt;code&gt;\r&lt;/code&gt; will be evaluated as an active formula when opened in Microsoft Excel or LibreOffice Calc.&lt;/p&gt;

&lt;p&gt;Always sanitize non-numeric text cells before exporting to &lt;code&gt;.xlsx&lt;/code&gt; or &lt;code&gt;.csv&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="no"&gt;DANGEROUS_PREFIXES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"="&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"+"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"-"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"@"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"\t"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"\r"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;safe_excel_text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="no"&gt;DANGEROUS_PREFIXES&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"'"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At the same time, keep &lt;strong&gt;real computed formulas&lt;/strong&gt; (&lt;code&gt;=SUM(...)&lt;/code&gt;, &lt;code&gt;=COUNTIF(...)&lt;/code&gt;, &lt;code&gt;=SUMIFS(...)&lt;/code&gt;) strictly generated by your exporter on known coordinate ranges — never interpolated from user text.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Native In-Memory iPhone &lt;code&gt;.HEIC&lt;/code&gt; Decoding, EXIF Auto-Rotation &amp;amp; Zero-Cache PWA Capture
&lt;/h2&gt;

&lt;p&gt;In real-world expense workflows, 60%+ of mobile uploads arrive as native iPhone &lt;code&gt;.HEIC/.HEIF&lt;/code&gt; images carrying sideways EXIF orientation flags (such as EXIF tag &lt;code&gt;6&lt;/code&gt;). Asking users to install a heavy &lt;code&gt;$15/mo&lt;/code&gt; App Store client or convert &lt;code&gt;.HEIC&lt;/code&gt; to &lt;code&gt;.JPG&lt;/code&gt; by hand kills adoption.&lt;/p&gt;

&lt;p&gt;The clean web-native solution keeps everything strictly inside RAM:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;io&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;pillow_heif&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="no"&gt;PIL&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;ImageOps&lt;/span&gt;

&lt;span class="n"&gt;pillow_heif&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;register_heif_opener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;decode_receipt_in_ram&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;raw_bytes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# Decodes JPEG, PNG, WebP, and native iPhone .HEIC/.HEIF straight from RAM&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nc"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;BytesIO&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;raw_bytes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;ImageOps&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exif_transpose&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;convert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"RGB"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pair that with an installable Home-Screen PWA (&lt;code&gt;manifest.webmanifest&lt;/code&gt;) whose Service Worker (&lt;code&gt;sw.js&lt;/code&gt;) is strictly pass-through (zero Cache API storage of financial images or API responses) plus a mobile-only &lt;code&gt;&amp;lt;input type="file" accept="image/*,.heic,.heif,.pdf" capture="environment"&amp;gt;&lt;/code&gt; rear-camera trigger. Users snap paper receipts directly on their phone with zero App Store download and zero cloud retention.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Volatile-RAM Processing + 4-Up A4 Printable Vouchers
&lt;/h2&gt;

&lt;p&gt;Instead of writing uploaded photos to disk or object storage, process every uploaded byte stream inside &lt;code&gt;io.BytesIO&lt;/code&gt;, run OCR in memory, and composite the 4-Up A4 PDF (&lt;code&gt;2 × 2&lt;/code&gt; grid with &lt;code&gt;R-01&lt;/code&gt; .. &lt;code&gt;R-N&lt;/code&gt; numbered headers matching Sheet 1 of the Excel workbook) straight into an in-memory PDF buffer returned over HTTPS. When the request finishes, the Python garbage collector drops the bytes — zero S3 buckets, zero cleanup cron jobs, zero account database to leak.&lt;/p&gt;




&lt;h2&gt;
  
  
  Try It Live (Zero Signup, Instant Sample Downloads + Free Local Tools)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Batch Receipt &amp;amp; Invoice Scanner (Native iPhone HEIC + Camera PWA + Excel &lt;code&gt;=SUM&lt;/code&gt;/&lt;code&gt;=SUMIFS&lt;/code&gt; + 4-Up A4 PDF, with instant sample outputs)&lt;/strong&gt;: &lt;a href="https://stmtverify.com/receipts/" rel="noopener noreferrer"&gt;https://stmtverify.com/receipts/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;StmtVerify — Bank, Credit Card &amp;amp; Wise/PayPal PDF/Photo → Verified Excel / QBO / Xero / DATEV / MT940&lt;/strong&gt;: &lt;a href="https://stmtverify.com/" rel="noopener noreferrer"&gt;https://stmtverify.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;100% Free Browser-Only Zero-Upload Accounting Tools&lt;/strong&gt; (run strictly in local JavaScript):

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://stmtverify.com/tools/accounting-file-validator" rel="noopener noreferrer"&gt;Accounting File Validator (QBO / OFX / MT940 / DATEV / Xero / FEC / Yayoi)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stmtverify.com/tools/csv-to-qbo-converter" rel="noopener noreferrer"&gt;CSV to QuickBooks &lt;code&gt;.QBO&lt;/code&gt; / &lt;code&gt;.OFX&lt;/code&gt; Converter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stmtverify.com/tools/qbo-fitid-fixer" rel="noopener noreferrer"&gt;&lt;code&gt;.QBO&lt;/code&gt; Duplicate &lt;code&gt;FITID&lt;/code&gt; Fixer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stmtverify.com/tools/mt940-to-excel" rel="noopener noreferrer"&gt;SWIFT MT940 (&lt;code&gt;.sta&lt;/code&gt;) Viewer &amp;amp; Excel CSV Exporter&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MIT Open-Source Format Specification &amp;amp; Python CLI&lt;/strong&gt;: &lt;a href="https://github.com/lerenhuan-hash/bank-statement-format-spec" rel="noopener noreferrer"&gt;https://github.com/lerenhuan-hash/bank-statement-format-spec&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>accounting</category>
      <category>security</category>
      <category>fintech</category>
    </item>
    <item>
      <title>Why QuickBooks (.QBO), SWIFT MT940, DATEV &amp; Xero Silently Reject Bank Imports (And a Free Local Validator)</title>
      <dc:creator>leren huan</dc:creator>
      <pubDate>Thu, 26 Nov 2026 16:40:56 +0000</pubDate>
      <link>https://dev.to/leren_huan_1faa261d7aca76/why-quickbooks-qbo-swift-mt940-datev-xero-silently-reject-bank-imports-and-a-free-local-30k0</link>
      <guid>https://dev.to/leren_huan_1faa261d7aca76/why-quickbooks-qbo-swift-mt940-datev-xero-silently-reject-bank-imports-and-a-free-local-30k0</guid>
      <description>&lt;p&gt;If you have ever converted a client's bank statement into a &lt;code&gt;.QBO&lt;/code&gt;, &lt;code&gt;.OFX&lt;/code&gt;, SWIFT &lt;code&gt;MT940&lt;/code&gt; (&lt;code&gt;.sta&lt;/code&gt;), German &lt;code&gt;DATEV EXTF&lt;/code&gt;, or &lt;code&gt;Xero CSV&lt;/code&gt; file and watched the accounting software either reject the upload with a cryptic error—or worse, &lt;strong&gt;silently skip half the transactions&lt;/strong&gt;—you know how brittle regional banking formats really are.&lt;/p&gt;

&lt;p&gt;After building a deterministic bank statement converter across 12 tax regions, I documented the exact failure modes that break imports in production and built two &lt;strong&gt;100% free&lt;/strong&gt; tools so accountants and developers can catch these bugs before touching a live ledger:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;100% Browser-Only Local Validator (zero upload, zero signup):&lt;/strong&gt; &lt;a href="https://stmtverify.com/tools/accounting-file-validator" rel="noopener noreferrer"&gt;stmtverify.com/tools/accounting-file-validator&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero-Dependency MIT Python CLI &amp;amp; Spec:&lt;/strong&gt; &lt;a href="https://github.com/lerenhuan-hash/bank-statement-format-spec" rel="noopener noreferrer"&gt;github.com/lerenhuan-hash/bank-statement-format-spec&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here are the 6 real-world failure modes that cause 90% of broken accounting imports.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. QuickBooks (&lt;code&gt;.QBO&lt;/code&gt;) &amp;amp; &lt;code&gt;.OFX&lt;/code&gt;: Silent Row Drops from Duplicate &lt;code&gt;&amp;lt;FITID&amp;gt;&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;QuickBooks Online rarely throws a helpful error when two transactions share the same &lt;code&gt;&amp;lt;FITID&amp;gt;&lt;/code&gt;. Instead, because QuickBooks treats &lt;code&gt;&amp;lt;FITID&amp;gt;&lt;/code&gt; as a permanent deduplication key, &lt;strong&gt;it silently ignores every subsequent row with a colliding ID&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- Row 1 imports fine --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;STMTTRN&amp;gt;&amp;lt;TRNTYPE&amp;gt;&lt;/span&gt;DEBIT&lt;span class="nt"&gt;&amp;lt;DTPOSTED&amp;gt;&lt;/span&gt;20260302120000&lt;span class="nt"&gt;&amp;lt;TRNAMT&amp;gt;&lt;/span&gt;-149.50&lt;span class="nt"&gt;&amp;lt;FITID&amp;gt;&lt;/span&gt;TXN20260302001&lt;span class="nt"&gt;&amp;lt;NAME&amp;gt;&lt;/span&gt;AWS CLOUD&lt;span class="nt"&gt;&amp;lt;/STMTTRN&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- Row 2 is SILENTLY DROPPED by QuickBooks because FITID collides! --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;STMTTRN&amp;gt;&amp;lt;TRNTYPE&amp;gt;&lt;/span&gt;DEBIT&lt;span class="nt"&gt;&amp;lt;DTPOSTED&amp;gt;&lt;/span&gt;20260305120000&lt;span class="nt"&gt;&amp;lt;TRNAMT&amp;gt;&lt;/span&gt;-42.00&lt;span class="nt"&gt;&amp;lt;FITID&amp;gt;&lt;/span&gt;TXN20260302001&lt;span class="nt"&gt;&amp;lt;NAME&amp;gt;&lt;/span&gt;GITHUB INC&lt;span class="nt"&gt;&amp;lt;/STMTTRN&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Rule of thumb:&lt;/strong&gt; Never generate &lt;code&gt;&amp;lt;FITID&amp;gt;&lt;/code&gt; from date-only or unseeded row counters that reset across pages. Hash &lt;code&gt;(account_id, date, amount_cents, description, occurrence_index)&lt;/code&gt; deterministically so re-importing the same month deduplicates properly while two identical coffee charges on the same day keep distinct IDs.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. SWIFT MT940 (&lt;code&gt;.sta&lt;/code&gt;): Exact Integer-Cent Balance Proof (&lt;code&gt;:60F:&lt;/code&gt; + &lt;code&gt;ΣC&lt;/code&gt; − &lt;code&gt;ΣD&lt;/code&gt; == &lt;code&gt;:62F:&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Across Switzerland (Bexio, Abacus) and the Netherlands/Belgium (Exact Online, Moneybird), SWIFT MT940 files are validated down to the exact cent or rappen:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:60F:C260301CHF12450,50
:61:2603050305C2500,00NTRFNONREF
:61:2603120312D200,00NTRFNONREF
:62F:C260331CHF14750,51   &amp;lt;-- Rejected! Expected 14750,50 (0.01 CHF variance)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three bugs routinely break MT940 imports:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Floating-point drift&lt;/strong&gt; from summing floats instead of exact integer cents (&lt;code&gt;Decimal&lt;/code&gt; or integer minor units).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dot decimals instead of comma decimals&lt;/strong&gt; (&lt;code&gt;12450.50&lt;/code&gt; fails; MT940 strictly expects &lt;code&gt;12450,50&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Swiss apostrophe thousands&lt;/strong&gt; (&lt;code&gt;CHF 12'450.50&lt;/code&gt;) leaking raw into amount parsers.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  3. German DATEV EXTF (&lt;code&gt;.csv&lt;/code&gt;): Semicolons, Comma Decimals &amp;amp; &lt;code&gt;S&lt;/code&gt;/&lt;code&gt;H&lt;/code&gt; Signs
&lt;/h2&gt;

&lt;p&gt;DATEV's &lt;code&gt;EXTF&lt;/code&gt; booking batch format rejects standard English CSV exports immediately:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Line 1 must begin with the &lt;code&gt;EXTF&lt;/code&gt; metadata header (&lt;code&gt;"EXTF";700;21;"Buchungsstapel"...&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Delimiter must be a &lt;strong&gt;semicolon (&lt;code&gt;;&lt;/code&gt;)&lt;/strong&gt;, never a comma.&lt;/li&gt;
&lt;li&gt;Amounts must be &lt;strong&gt;unsigned positive numbers with comma decimals&lt;/strong&gt; (&lt;code&gt;149,50&lt;/code&gt;, not &lt;code&gt;-149.50&lt;/code&gt;), while the debit/credit direction belongs exclusively in the &lt;code&gt;Soll/Haben-Kennzeichen&lt;/code&gt; column (&lt;code&gt;S&lt;/code&gt; or &lt;code&gt;H&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4. Xero Bank CSV: Missing Asterisks (&lt;code&gt;*Date&lt;/code&gt;, &lt;code&gt;*Amount&lt;/code&gt;) &amp;amp; Mixed Date Order
&lt;/h2&gt;

&lt;p&gt;Xero's bank statement CSV importer strictly requires leading asterisks on mandatory columns (&lt;code&gt;*Date&lt;/code&gt;, &lt;code&gt;*Amount&lt;/code&gt;). Even more insidious: mixing &lt;code&gt;DD/MM/YYYY&lt;/code&gt; (UK/AU/NZ/SG) and &lt;code&gt;MM/DD/YYYY&lt;/code&gt; (US) inside the same export silently shifts transaction months when day ≤ 12.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. PayPal &amp;amp; Digital Wallet 4-Column Statements (Gross / Fee / Net)
&lt;/h2&gt;

&lt;p&gt;Unlike traditional bank statements, PayPal statements print &lt;strong&gt;Gross&lt;/strong&gt;, &lt;strong&gt;Fee&lt;/strong&gt;, and &lt;strong&gt;Net&lt;/strong&gt; columns side by side. If a converter only extracts &lt;code&gt;Gross&lt;/code&gt; or only extracts &lt;code&gt;Net&lt;/code&gt;, your ledger either loses merchant fee deductions or fails closing-balance reconciliation. Splitting each non-zero fee into an explicit paired fee row preserves both exact closing-balance reconciliation (&lt;code&gt;0.00&lt;/code&gt; variance) and deductible expense tracking.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Japanese Yayoi (弥生会計) &amp;amp; freee CSV: Stray Full-Width Numerals (&lt;code&gt;０-９&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;OCR and legacy Japanese bank portals frequently emit full-width ASCII digits (&lt;code&gt;１２,５００&lt;/code&gt;) or yen glyphs inside CSV cells, causing immediate import failures unless normalized to half-width ASCII (&lt;code&gt;12500&lt;/code&gt; integer JPY).&lt;/p&gt;




&lt;h2&gt;
  
  
  Test Your Own Files Locally (Zero Upload)
&lt;/h2&gt;

&lt;p&gt;If you are debugging a rejected import right now, you can drop or paste any &lt;code&gt;.qbo&lt;/code&gt;, &lt;code&gt;.ofx&lt;/code&gt;, &lt;code&gt;.sta&lt;/code&gt; (MT940), DATEV EXTF, Xero, French FEC, or Japanese Yayoi CSV into our &lt;strong&gt;100% browser-only validator&lt;/strong&gt;—it runs entirely via &lt;code&gt;FileReader&lt;/code&gt; in client-side JavaScript with zero network requests (you can even disconnect your internet after loading the page):&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://stmtverify.com/tools/accounting-file-validator" rel="noopener noreferrer"&gt;https://stmtverify.com/tools/accounting-file-validator&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are also 4 one-click broken sample buttons (&lt;code&gt;Broken .QBO&lt;/code&gt;, &lt;code&gt;Broken MT940&lt;/code&gt;, &lt;code&gt;Broken DATEV&lt;/code&gt;, &lt;code&gt;Valid Xero&lt;/code&gt;) if you just want to see the diagnostics in action.&lt;/p&gt;

&lt;p&gt;If you prefer validating exports in CI or batch Python scripts, the zero-dependency MIT CLI is here:&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://github.com/lerenhuan-hash/bank-statement-format-spec" rel="noopener noreferrer"&gt;https://github.com/lerenhuan-hash/bank-statement-format-spec&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python validate_statement_export.py --format auto path/to/statement.qbo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;em&gt;Full disclosure: I built both free tools alongside &lt;a href="https://stmtverify.com/" rel="noopener noreferrer"&gt;StmtVerify (stmtverify.com)&lt;/a&gt;, a zero-account, volatile-RAM converter that turns bank, credit card, and Wise/PayPal/Revolut PDFs or phone photos into cent-reconciled Excel and native accounting files. If there is another regional accounting format (e.g., Sage, MYOB, Holded, or FreeAgent) whose strict import rules you'd like added to the open-source validator, let me know in the comments!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>fintech</category>
      <category>python</category>
      <category>opensource</category>
      <category>accounting</category>
    </item>
  </channel>
</rss>
