Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 89267 invoked from network); 15 Apr 2009 03:30:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Apr 2009 03:30:15 -0000 Received: (qmail 43591 invoked by uid 500); 15 Apr 2009 03:30:14 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 43433 invoked by uid 500); 15 Apr 2009 03:30:13 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 43423 invoked by uid 99); 15 Apr 2009 03:30:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Apr 2009 03:30:13 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dundeemt@gmail.com designates 209.85.217.162 as permitted sender) Received: from [209.85.217.162] (HELO mail-gx0-f162.google.com) (209.85.217.162) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Apr 2009 03:30:06 +0000 Received: by gxk6 with SMTP id 6so6128842gxk.11 for ; Tue, 14 Apr 2009 20:29:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=9cxxDU2Z4+yUvn44zv3k49b46J4rd21MaY9VQrV5lCY=; b=YEqKyamZehocABsw6vrNNE77uvuzFSGkFndBXWk5MpcPq2OQ7dVRvOE+0zd2B6hRxW zZ0T0I5wvOufmpKB6KD8TpN4q2Swod0Ukc5iy4LI2vnmAwXGlIU2IsABd24mR5fhwIPd zl6BjkxbXjpIclcHZSOgXeDfdiU5T3xuXZ8Wo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; b=D1U16ttQqsLy5p+oR+93Vzdi1cY2eNe0KKokfJEtHzJyjrxnLa+gOxqJ4B963N31Ea 4bQOBUDfoJxqEv1jlamfA+HYLc/OK1WOrQD1/ME76hVm8GpcA1xzAgdgES7Q1wgne6CG VPhOoiXEG2h0Q6fPBiCBlTEsTesNzWxQuIhBk= MIME-Version: 1.0 Received: by 10.150.218.10 with SMTP id q10mr16288994ybg.15.1239766185572; Tue, 14 Apr 2009 20:29:45 -0700 (PDT) Reply-To: tech@dundeemt.com In-Reply-To: References: <1A8CEBA7-32CF-4D47-BE52-6D31DB79B385@mac.com> <55047b710904130929g451af4abw62e6ccd7281fbd77@mail.gmail.com> Date: Tue, 14 Apr 2009 22:29:45 -0500 Message-ID: <5aaed53f0904142029v38576fadlbcfabf1f574b54ec@mail.gmail.com> Subject: Re: using CouchDB for a finance manager? From: "Jeff Hinrichs - DM&T" To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Tue, Apr 14, 2009 at 8:52 PM, Li Zhengji wrote: > Thanks for your information that makes me confident to use CouchDB for > this task. > > Before getting start, I think to calculate the balance seems > difficult, no matter it is schema-less or not. > > For example, if I delete a older transaction, then all balance in > following transactions must be updated one after another. For CouchDB, > maybe some views need to be rebuilt, too. It seems to be time > consuming. (Suppose there is a balance field in each transation --- > CouchDB doc.) > > Any idears for this? Yes -- Accountants do not use erasers. google "accountants don't use erasers" No financial system should allow deleting entries -- posted entries. The application should allow for user errors, etc and create a way to correct wrong things but only by appending additional information on how that entry was corrected. i.e. If I incorrectly transfer 10000 from accountA -> accountB but only wanted to transfer 100, you should not delete the original transaction but instead either transfer the entire amount back with a notation for the reason and then initiate the correct transfer amount or transfer back 9900 from accountB -> accountA with a proper notation. (I prefer the former as it more accurately represents the problem and solution instead of mixing them together into a single correcting transaction.) Your balances in previous transactions would not need to be "updated" and should not be and really a balance is a report of status at a point in time. Which means, you should calculate balances on demand. Once you close a period, you can create a summary balance for the period end to avoid calculating over years and years of transactions. Closing a period means that it can not be modified by transactions posted after it is closed. > 2009/4/14 Nicholas Orr : >> I've looked into doing my own accounting app as well. Sitting with an >> accountant the main thing she had an issue with, in regard to all the >> products currently available, is tracking what the amount is for on each >> side of the transaction. >> >> Example, say I as an individual transfer $10K into a company I'm a director >> of. On the individual side (withdraw) of the transaction info needs to be >> recorded as one thing, then on the other side (deposit) different >> information needs to be recorded. This whole transaction needs to exist in >> both places so come tax time the account doing the work for tax can follow >> everything simply. >> >> The concept of schema-less documents now starts to shine as ideal. I have a >> few other projects on the go right now and will not be getting to this one >> anytime soon. Interested in what you guys come up with :) >> >> Nick >> >> >> > -- > Li Zhengji > ------------------------------------------------------------- > If all you have is a hammer, everything is a nail. > ------------------------------------------------------------- > Regards, Jeff Hinrichs