From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id MBzPG4wR32OgNwAAbAwnHQ (envelope-from ) for ; Sun, 05 Feb 2023 03:16:44 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id uBi+G4wR32NAyAAAauVa8A (envelope-from ) for ; Sun, 05 Feb 2023 03:16:44 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B77EF27BED for ; Sun, 5 Feb 2023 03:16:43 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOUZP-0003QN-7A; Sat, 04 Feb 2023 21:15:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOUZN-0003Pv-Lk for emacs-orgmode@gnu.org; Sat, 04 Feb 2023 21:15:53 -0500 Received: from mailbackend.panix.com ([166.84.1.89]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOUZL-0001bW-1m for emacs-orgmode@gnu.org; Sat, 04 Feb 2023 21:15:53 -0500 Received: from panix1.panix.com (panix1.panix.com [166.84.1.1]) by mailbackend.panix.com (Postfix) with ESMTP id 4P8Y0536Lfz4JJh; Sat, 4 Feb 2023 21:15:49 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=panix.com; s=panix; t=1675563349; bh=wX5CEO1vTejz+otw+FsAGcrAXFgdvhQU4W7hqJpkMlA=; h=Date:From:To:cc:Subject:In-Reply-To:References; b=qHD3Wmx0EI1EQ0W+khBKEijRfi0PoLZIGbedGnluMuU0gsDO0LF+ufAyn3OwLS8Tm O6/LND3nmGg5RR3Kn32SWfhwZR6U09py0QxCZoteHqmHpEZclBoE5FAKjdwQ1AxM6l cluSQpK7mfcSYnvetQXrdEPQdQRq2HjSXe1gm1nA= Received: by panix1.panix.com (Postfix, from userid 20712) id 4P8Y052xnmzcbc; Sat, 4 Feb 2023 21:15:49 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by panix1.panix.com (Postfix) with ESMTP id 4P8Y052bC6zcbP; Sat, 4 Feb 2023 21:15:49 -0500 (EST) Date: Sat, 4 Feb 2023 21:15:49 -0500 From: Jude DaShiell To: "Dr. Arne Babenhauserheide" cc: emacs-orgmode@gnu.org Subject: Re: netspend table In-Reply-To: <87y1pcdilw.fsf@web.de> Message-ID: <8694d192-fd4a-36f0-3af3-e92b36aa2197@panix.com> References: <87y1pcdilw.fsf@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Received-SPF: pass client-ip=166.84.1.89; envelope-from=jdashiel@panix.com; helo=mailbackend.panix.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1675563404; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=bly6pntg4BhIiMRw5yIAIxjELuOdlflMXg3v/wOJFJw=; b=ZVqqDX2BQZPpz7/wjJTziaf1CfchQ4Hf1H0Sm8tvhOTODmaEJjhgvS9b90/FAancjGhz31 ZrKx9VlxVQwagTyQODbAGPSP6qbGBZ9PvvneRlTHg9gng8pcuFXIZjXGjRZgdzAgMqnrT3 M98UIFALbZNeK1a+AvzubS4BJ8ZcxfZkQ9el0m1wUWJN8WkQ55dD7129+EDk1Xq9TdNsci ASObONF86C4o/qFuNzK+7WpoEc5VElybFVyzpVwDT/qyfp1ikrB3FO6ToDGEKVsWb2duKE lPqto90kczE0mAIBCaRvgItylRzcnvIpg4p6T4Ud+sC57OlJuk+k0PWSGq5dHg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=panix.com header.s=panix header.b=qHD3Wmx0; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=panix.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1675563404; a=rsa-sha256; cv=none; b=Fx9KIqvrypzMlsoD/qISXIRImpPMkKP9xGW33JM6sBCo4k6fHDami5kFbYtPu8bJ+Yqyl0 M8dN1BmJh9kWdu2bHhcm78Yuv64+xZQApRde2EpTev9hSXke/gsS91BRaPgnRxzf44yZ/g LQi5gg+JZtpOdp3vQONww7zUg3cjZ7O3eTB/JtNN4mmxTwjPW43OQR4cFbUXXiEB0DPuYC 6gulFR+VQfLho5MjraU1h6Mg8B5TJpOAsA2mo+voNeyCxxEWC2qlf0Rjbdkw8PlS64oaRd H1QSytShXA2UV1+d1MNr9fP7X0K/ecGFiPCxRIKn8N8SlaDP0OcC4ZCuPLUsXQ== X-Migadu-Spam-Score: -1.79 X-Spam-Score: -1.79 X-Migadu-Queue-Id: B77EF27BED Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=panix.com header.s=panix header.b=qHD3Wmx0; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=panix.com (policy=none) X-Migadu-Scanner: scn1.migadu.com X-TUID: ocf3m36i+PeO Thanks much for your help on this problem. I've never done anything with ledger-cli yet and wasn't aware such a package existed. Jude "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author, 1940) . On Sun, 5 Feb 2023, Dr. Arne Babenhauserheide wrote: > > Jude DaShiell writes: > > > This is a running balance table and I don't know what kind of a #TBLFMT > > line would be useful for that either. > > > > | date | transaction | amount | fee | balance | > > |--------------+------------------+--------+-------+---------| > > | [2023-01-11] | original balance | +0.00 | +0.00 | +423.17 | > > | [2023-01-12] | dunkin | -18.68 | -1.00 | 403.49 | > > | [2023-01-13] | WalMart | -28.68 | -1.00 | 384.88 | > > | [2023-01-16] | Deposit | + | | 634.88 | > > | [2023-01-17] | Capris | - | - | 615.34 | > > | [2023-01-17] | Mcdonalds | -4.74 | -1.00 | 609.60 | > > | [2023-01-18] | verizon | - | - | 543.35 | > > | [2023-01-26] | dunkin | - | - | 542.37 | > > | [2023-02-01] | damgoodcafe | -13.28 | -1.00 | 528.09 | > > | | | | | | > > One thing I could see as useful is a check column to enusre that > > balance - amount - fee actually gives the previous balance: > > | date | transaction | amount | fee | balance | check | > |--------------+------------------+--------+-------+---------+--------| > | [2023-01-11] | original balance | +0.00 | +0.00 | +423.17 | 423.17 | > | [2023-01-12] | dunkin | -18.68 | -1.00 | 403.49 | 423.17 | > | [2023-01-13] | WalMart | -28.68 | -1.00 | 384.88 | 414.56 | > | [2023-01-16] | Deposit | + | | 634.88 | 634.88 | > | [2023-01-17] | Capris | - | - | 615.34 | 615.34 | > | [2023-01-17] | Mcdonalds | -4.74 | -1.00 | 609.60 | 615.34 | > | [2023-01-18] | verizon | - | - | 543.35 | 543.35 | > | [2023-01-26] | dunkin | - | - | 542.37 | 542.37 | > | [2023-02-01] | damgoodcafe | -13.28 | -1.00 | 528.09 | 542.37 | > | | | | | | 0 | > #+TBLFM: $6='(- $5 $4 $3);N > > As you can see, The balance after WalMart does not add up, so I think > this could be a good check to have. > > > Suggestions for any other improvements I could make on this table will be > > appreciated and implemented if possible. > > I use ledger-cli for such tables which can generate suitable output. > > https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ledger.html > https://www.ledger-cli.org/3.0/doc/ledger3.html#Org-mode-with-Babel > > You could do some clever stuff like > > #+name: ledger-to-table > #+begin_src elisp :var data="" > (concat "#+name: ledger-results\n" > data > "#+tblfm: \n")) > #+end_src > > #+begin_src ledger :results raw :post ledger-to-table(*this*) :cmdline --register-format "| %(format_date(date)) | %(payee) | %(display_account) | %(display_amount) | %(display_total) | \n" reg -M --wide --date-format %y-%m-%d > 2022-06-15 * py2guile > ArneBab:Assets:Autorenhonorar:epubli 3.13? > ArneBab:Income:sale:nonrpg:epubli > #+end_src > > > > #+begin_src elisp :exports results > (org-babel-do-load-languages > 'org-babel-load-languages > '((ledger . t) ;this is the important one for this tutorial > )) > nil > #+end_src > > #+RESULTS: > > If you use ledger-cli for accounting, you can do pretty clever > post-processing inside org-mode. Here?s an example that uses > [[https://www.ledger-cli.org/3.0/doc/ledger3.html#Output-customization][--register-format]] to provide the register results directly as an > org-mode table: > > #+begin_src org > ,#+name: ledger-to-table > ,#+begin_src elisp :var data="" > (concat "#+name: ledger-results\n" > data > "#+tblfm: \n")) > ,#+end_src > > ,#+begin_src ledger :results raw :post ledger-to-table(*this*) :cmdline --register-format "| %(format_date(date)) | %(payee) | %(display_account) | %(display_amount) | %(display_total) | \n" reg -D --wide --date-format %Y-%m-%d > 2022-06-15 * py2guile > ArneBab:Assets:Autorenhonorar:epubli 3.13? > ArneBab:Income:sale:nonrpg:epubli > ,#+end_src > > #+end_src > > This results in output like this (evaluated live on every export of this website): > > #+name: ledger-to-table > #+begin_src elisp :var data="" > (concat "#+name: ledger-results\n" > data > "#+tblfm: \n")) > #+end_src > > #+begin_src ledger :results raw :post ledger-to-table(*this*) :cmdline --register-format "| %(format_date(date)) | %(payee) | %(display_account) | %(display_amount) | %(display_total) | \n" reg -D --wide --date-format %Y-%m-%d > 2022-06-15 * py2guile > ArneBab:Assets:Autorenhonorar:epubli 3.13? > ArneBab:Income:sale:nonrpg:epubli > #+end_src > > #+RESULTS: > #+name: ledger-results > | 2022-06-15 | - 2022-06-15 | ArneBab:Assets:Autorenhonorar:epubli | 3.13? | 3.13? | > | 2022-06-15 | - 2022-06-15 | ArneBab:Income:sale:nonrpg:epubli | -3.13? | 0.00? | > #+tblfm: > > > Also see > > - https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ledger.html > - https://www.ledger-cli.org/3.0/doc/ledger3.html#Org-mode-with-Babel > > > > > Best wishes, > Arne >