From d7a48101d68321bd20922899f9c2e473ce4a45a2 Mon Sep 17 00:00:00 2001 From: Anantha Kumaran Date: Tue, 29 Aug 2023 21:29:57 +0530 Subject: [PATCH] update import templates --- fixture/import/HDFC Account Statement/statement.ledger | 8 ++++---- .../templates/HDFC Account Statement XLS.handlebars | 10 ++++++++++ .../templates/HDFC Account Statement.handlebars | 4 ++-- .../templates/ICICI Credit Card Statement.handlebars | 6 +++++- src/routes/+page.svelte | 2 +- 5 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 internal/model/template/templates/HDFC Account Statement XLS.handlebars diff --git a/fixture/import/HDFC Account Statement/statement.ledger b/fixture/import/HDFC Account Statement/statement.ledger index 81369cc7..7816b8fc 100644 --- a/fixture/import/HDFC Account Statement/statement.ledger +++ b/fixture/import/HDFC Account Statement/statement.ledger @@ -1,15 +1,15 @@ 2023/05/03 UPI Expenses:Unknown 110.00 INR - Assets:Checking + Assets:Checking:HDFC 2023/05/04 UPI Expenses:Unknown 200.00 INR - Assets:Checking + Assets:Checking:HDFC 2023/05/05 UPI - Assets:Checking 237.00 INR + Assets:Checking:HDFC 237.00 INR Income:Unknown 2023/05/05 UPI Expenses:Unknown 166.00 INR - Assets:Checking + Assets:Checking:HDFC diff --git a/internal/model/template/templates/HDFC Account Statement XLS.handlebars b/internal/model/template/templates/HDFC Account Statement XLS.handlebars new file mode 100644 index 00000000..444a7476 --- /dev/null +++ b/internal/model/template/templates/HDFC Account Statement XLS.handlebars @@ -0,0 +1,10 @@ +{{#if (isDate ROW.A "DD/MM/YY")}} + {{date ROW.A "DD/MM/YY"}} {{ROW.B}} + {{#if (or (eq (trim ROW.F) "0.00") (isBlank (trim ROW.F)))}} + {{predictAccount prefix="Expenses"}} {{trim ROW.E}} INR + Assets:Checking:HDFC + {{else}} + Assets:Checking:HDFC + {{predictAccount prefix="Income"}} -{{trim ROW.F}} INR + {{/if}} +{{/if}} diff --git a/internal/model/template/templates/HDFC Account Statement.handlebars b/internal/model/template/templates/HDFC Account Statement.handlebars index ae094f0b..4ec611e9 100644 --- a/internal/model/template/templates/HDFC Account Statement.handlebars +++ b/internal/model/template/templates/HDFC Account Statement.handlebars @@ -2,9 +2,9 @@ {{date ROW.A "DD/MM/YY"}} {{ROW.B}} {{#if (eq (trim ROW.E) "0.00")}} {{predictAccount prefix="Expenses"}} {{trim ROW.D}} INR - Assets:Checking + Assets:Checking:HDFC {{else}} - Assets:Checking {{trim ROW.E}} INR + Assets:Checking:HDFC {{trim ROW.E}} INR {{predictAccount prefix="Income"}} {{/if}} {{/if}} diff --git a/internal/model/template/templates/ICICI Credit Card Statement.handlebars b/internal/model/template/templates/ICICI Credit Card Statement.handlebars index 6deccd1e..35e3dece 100644 --- a/internal/model/template/templates/ICICI Credit Card Statement.handlebars +++ b/internal/model/template/templates/ICICI Credit Card Statement.handlebars @@ -1,5 +1,9 @@ -{{#if (and (isDate ROW.A "DD/MM/YYYY") (isBlank ROW.G))}} +{{#if (isDate ROW.A "DD/MM/YYYY")}} {{date ROW.A "DD/MM/YYYY"}} {{ROW.C}} + {{#if (regexpTest ROW.G "CR")}} + Income:Refund:CreditCard:ICICI -{{ROW.F}} INR + {{else}} {{predictAccount prefix="Expenses"}} {{ROW.F}} INR + {{/if}} Liabilities:CreditCard:ICICI {{/if}} diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 69e48f50..0fbee754 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -150,7 +150,7 @@
{#each currentBudget.accounts as accountBudget (accountBudget)} - + {/each}