From 2014ede39a4835a290ae64c2460e9fa9172b2620 Mon Sep 17 00:00:00 2001 From: Anantha Kumaran Date: Mon, 15 Jan 2024 20:18:09 +0530 Subject: [PATCH] [import] add Paytm import template --- fixture/import/Paytm/statement.csv | 75 +++++ fixture/import/Paytm/statement.ledger | 295 ++++++++++++++++++ .../model/template/templates/Paytm.handlebars | 10 + 3 files changed, 380 insertions(+) create mode 100644 fixture/import/Paytm/statement.csv create mode 100644 fixture/import/Paytm/statement.ledger create mode 100644 internal/model/template/templates/Paytm.handlebars diff --git a/fixture/import/Paytm/statement.csv b/fixture/import/Paytm/statement.csv new file mode 100644 index 00000000..bdd8319e --- /dev/null +++ b/fixture/import/Paytm/statement.csv @@ -0,0 +1,75 @@ +Date,Activity,Source/Destination,Wallet Txn ID,Comment,Debit,Credit,Transaction Breakup,Status +6/1/2024 17:42,Paid for order,Main Wallet,56789632564,,30,,,SUCCESS +6/1/2024 13:25,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +6/1/2024 12:22,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +1/1/2024 14:41,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +30/12/2023 23:38:11,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +30/12/2023 20:35:47,Paid for order,Main Wallet,56789632564,,35,,,SUCCESS +30/12/2023 19:34:03,Paid for order,Main Wallet,56789632564,,70,,,SUCCESS +28/12/2023 18:05:20,Paid for order,Main Wallet,56789632564,,1,,,SUCCESS +27/12/2023 17:02:32,Paid for order,Main Wallet,56789632564,,35,,,SUCCESS +27/12/2023 16:00:47,Money moved across user toll wallet,Main Wallet,56789632564,,,29,Wallet: 29,SUCCESS +27/12/2023 16:00:47,Added to wallet,Main Wallet,56789632564,,,500,,SUCCESS +27/12/2023 10:10:49,Paid for order,Main Wallet,56789632564,,65,,"Wallet: 36, Fastag: 29",SUCCESS +26/12/2023 15:24:52,Paid for order,Main Wallet,56789632564,,35,,,SUCCESS +26/12/2023 10:57:39,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +24/12/2023 22:45:34,Paid for order,Main Wallet,56789632564,,35,,,SUCCESS +24/12/2023 15:15:51,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +23/12/2023 20:16:28,Paid for order,Main Wallet,56789632564,,30,,,SUCCESS +23/12/2023 18:23:41,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +22/12/2023 18:40:17,Paid for order,Main Wallet,56789632564,,45,,,SUCCESS +22/12/2023 18:28:16,Paid for order,Main Wallet,56789632564,,45,,,SUCCESS +22/12/2023 16:31:47,Paid for order,Main Wallet,56789632564,,20,,,SUCCESS +22/12/2023 16:01:28,Paid for order,Main Wallet,56789632564,,20,,,SUCCESS +22/12/2023 12:10:56,Paid for order,Main Wallet,56789632564,,40,,,SUCCESS +22/12/2023 11:48:50,Added to wallet,Main Wallet,56789632564,,,500,,SUCCESS +22/12/2023 11:44:12,Paid for order,Main Wallet,56789632564,,50,,,SUCCESS +22/12/2023 10:50:28,Paid for order,Main Wallet,56789632564,,60,,,SUCCESS +20/12/2023 20:13:57,Paid for order,Main Wallet,56789632564,,29,,,SUCCESS +16/12/2023 13:02:50,Paid for order,Main Wallet,56789632564,,40,,,SUCCESS +14/12/2023 20:49:02,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +14/12/2023 18:54:32,Added to wallet,Main Wallet,56789632564,,,200,,SUCCESS +14/12/2023 18:50:30,Paid for order,Main Wallet,56789632564,,35,,,SUCCESS +14/12/2023 17:09:16,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +6/12/2023 13:53,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +30/11/2023 20:37:11,Paid for order,Main Wallet,56789632564,,35,,,SUCCESS +30/11/2023 17:03:37,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +24/11/2023 17:42:18,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +23/11/2023 15:34:10,Paid for order,Main Wallet,56789632564,,35,,,SUCCESS +23/11/2023 10:09:16,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +19/11/2023 16:18:55,Paid for order,Main Wallet,56789632564,,35,,,SUCCESS +19/11/2023 09:57:09,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +8/11/2023 17:32,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +6/11/2023 15:33,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +4/11/2023 14:19,Paid for order,Main Wallet,56789632564,,25,,,SUCCESS +4/11/2023 10:34,Added to wallet,Main Wallet,56789632564,,,500,,SUCCESS +4/11/2023 10:13,Paid for order,Main Wallet,56789632564,,55,,,SUCCESS +28/10/2023 14:24:34,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +27/10/2023 12:29:00,Paid for order,Main Wallet,56789632564,,35,,,SUCCESS +27/10/2023 11:26:53,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +26/10/2023 21:09:15,Paid for order,Main Wallet,56789632564,,35,,,SUCCESS +26/10/2023 16:32:07,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +25/10/2023 12:38:01,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +24/10/2023 17:56:47,Added to wallet,Main Wallet,56789632564,,,500,,SUCCESS +24/10/2023 10:10:33,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +21/10/2023 15:25:44,Paid for order,Main Wallet,56789632564,,30,,,SUCCESS +21/10/2023 15:24:37,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +21/10/2023 15:18:25,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +20/10/2023 19:37:43,Paid for order,Main Wallet,56789632564,,35,,,SUCCESS +20/10/2023 11:16:52,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +18/10/2023 20:22:06,Paid for order,Main Wallet,56789632564,,35,,,SUCCESS +18/10/2023 06:37:52,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +16/10/2023 20:19:15,Paid for order,Main Wallet,56789632564,,35,,,SUCCESS +16/10/2023 19:46:07,Paid for order,Main Wallet,56789632564,,30,,,SUCCESS +16/10/2023 17:32:43,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +15/10/2023 13:39:25,Paid for order,Main Wallet,56789632564,,35,,,SUCCESS +15/10/2023 11:06:52,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +11/10/2023 19:08,Paid for order,Main Wallet,56789632564,,150,,,SUCCESS +10/10/2023 22:11,Paid for order,Main Wallet,56789632564,,35,,,SUCCESS +10/10/2023 14:19,Money moved across user toll wallet,Main Wallet,56789632564,,,45,Wallet: 45,SUCCESS +10/10/2023 14:19,Added to wallet,Main Wallet,56789632564,,,1000,,SUCCESS +10/10/2023 14:17,Paid for order,Main Wallet,56789632564,,65,,"Wallet: 20, Fastag: 45",SUCCESS +9/10/2023 12:47,Paid for order,Main Wallet,56789632564,,35,,,SUCCESS +9/10/2023 10:27,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS +6/10/2023 12:47,Paid for order,Main Wallet,56789632564,,35,,,SUCCESS +6/10/2023 11:02,Paid for order,Main Wallet,56789632564,,65,,,SUCCESS diff --git a/fixture/import/Paytm/statement.ledger b/fixture/import/Paytm/statement.ledger new file mode 100644 index 00000000..293f8a60 --- /dev/null +++ b/fixture/import/Paytm/statement.ledger @@ -0,0 +1,295 @@ +2024/01/06 Paid for order + Expenses:Unknown 30 INR + Assets:Checking:Paytm + +2024/01/06 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2024/01/06 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2024/01/01 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/12/30 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/12/30 Paid for order + Expenses:Unknown 35 INR + Assets:Checking:Paytm + +2023/12/30 Paid for order + Expenses:Unknown 70 INR + Assets:Checking:Paytm + +2023/12/28 Paid for order + Expenses:Unknown 1 INR + Assets:Checking:Paytm + +2023/12/27 Paid for order + Expenses:Unknown 35 INR + Assets:Checking:Paytm + +2023/12/27 Money moved across user toll wallet + Assets:Checking:Paytm 29 INR + Assets:Checking:Unknown + +2023/12/27 Added to wallet + Assets:Checking:Paytm 500 INR + Assets:Checking:Unknown + +2023/12/27 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/12/26 Paid for order + Expenses:Unknown 35 INR + Assets:Checking:Paytm + +2023/12/26 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/12/24 Paid for order + Expenses:Unknown 35 INR + Assets:Checking:Paytm + +2023/12/24 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/12/23 Paid for order + Expenses:Unknown 30 INR + Assets:Checking:Paytm + +2023/12/23 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/12/22 Paid for order + Expenses:Unknown 45 INR + Assets:Checking:Paytm + +2023/12/22 Paid for order + Expenses:Unknown 45 INR + Assets:Checking:Paytm + +2023/12/22 Paid for order + Expenses:Unknown 20 INR + Assets:Checking:Paytm + +2023/12/22 Paid for order + Expenses:Unknown 20 INR + Assets:Checking:Paytm + +2023/12/22 Paid for order + Expenses:Unknown 40 INR + Assets:Checking:Paytm + +2023/12/22 Added to wallet + Assets:Checking:Paytm 500 INR + Assets:Checking:Unknown + +2023/12/22 Paid for order + Expenses:Unknown 50 INR + Assets:Checking:Paytm + +2023/12/22 Paid for order + Expenses:Unknown 60 INR + Assets:Checking:Paytm + +2023/12/20 Paid for order + Expenses:Unknown 29 INR + Assets:Checking:Paytm + +2023/12/16 Paid for order + Expenses:Unknown 40 INR + Assets:Checking:Paytm + +2023/12/14 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/12/14 Added to wallet + Assets:Checking:Paytm 200 INR + Assets:Checking:Unknown + +2023/12/14 Paid for order + Expenses:Unknown 35 INR + Assets:Checking:Paytm + +2023/12/14 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/12/06 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/11/30 Paid for order + Expenses:Unknown 35 INR + Assets:Checking:Paytm + +2023/11/30 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/11/24 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/11/23 Paid for order + Expenses:Unknown 35 INR + Assets:Checking:Paytm + +2023/11/23 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/11/19 Paid for order + Expenses:Unknown 35 INR + Assets:Checking:Paytm + +2023/11/19 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/11/08 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/11/06 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/11/04 Paid for order + Expenses:Unknown 25 INR + Assets:Checking:Paytm + +2023/11/04 Added to wallet + Assets:Checking:Paytm 500 INR + Assets:Checking:Unknown + +2023/11/04 Paid for order + Expenses:Unknown 55 INR + Assets:Checking:Paytm + +2023/10/28 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/10/27 Paid for order + Expenses:Unknown 35 INR + Assets:Checking:Paytm + +2023/10/27 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/10/26 Paid for order + Expenses:Unknown 35 INR + Assets:Checking:Paytm + +2023/10/26 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/10/25 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/10/24 Added to wallet + Assets:Checking:Paytm 500 INR + Assets:Checking:Unknown + +2023/10/24 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/10/21 Paid for order + Expenses:Unknown 30 INR + Assets:Checking:Paytm + +2023/10/21 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/10/21 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/10/20 Paid for order + Expenses:Unknown 35 INR + Assets:Checking:Paytm + +2023/10/20 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/10/18 Paid for order + Expenses:Unknown 35 INR + Assets:Checking:Paytm + +2023/10/18 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/10/16 Paid for order + Expenses:Unknown 35 INR + Assets:Checking:Paytm + +2023/10/16 Paid for order + Expenses:Unknown 30 INR + Assets:Checking:Paytm + +2023/10/16 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/10/15 Paid for order + Expenses:Unknown 35 INR + Assets:Checking:Paytm + +2023/10/15 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/10/11 Paid for order + Expenses:Unknown 150 INR + Assets:Checking:Paytm + +2023/10/10 Paid for order + Expenses:Unknown 35 INR + Assets:Checking:Paytm + +2023/10/10 Money moved across user toll wallet + Assets:Checking:Paytm 45 INR + Assets:Checking:Unknown + +2023/10/10 Added to wallet + Assets:Checking:Paytm 1000 INR + Assets:Checking:Unknown + +2023/10/10 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/10/09 Paid for order + Expenses:Unknown 35 INR + Assets:Checking:Paytm + +2023/10/09 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm + +2023/10/06 Paid for order + Expenses:Unknown 35 INR + Assets:Checking:Paytm + +2023/10/06 Paid for order + Expenses:Unknown 65 INR + Assets:Checking:Paytm diff --git a/internal/model/template/templates/Paytm.handlebars b/internal/model/template/templates/Paytm.handlebars new file mode 100644 index 00000000..19fe320c --- /dev/null +++ b/internal/model/template/templates/Paytm.handlebars @@ -0,0 +1,10 @@ +{{#if (isDate (regexpMatch ROW.A "(\d{1,2}/\d{1,2}/\d{4}).*" group=1) "D/M/YYYY")}} + {{date (regexpMatch ROW.A "(\d{1,2}/\d{1,2}/\d{4}).*" group=1) "D/M/YYYY"}} {{ROW.B}} + {{#if (isBlank ROW.G)}} + {{predictAccount ROW.B prefix="Expenses"}} {{amount ROW.F}} INR + Assets:Checking:Paytm + {{else}} + Assets:Checking:Paytm {{amount ROW.G}} INR + {{predictAccount ROW.B prefix="Assets:Checking"}} + {{/if}} +{{/if}}