It would be nice to see tax modules added to ERP systems like SQL
Ledger. You already enter all your financial data into the ERP
system. Why enter it again somewhere else?
I like Common Lisp for any accounting software because it stores
numbers to arbitrary precision.
Most often, you will find that accounting system math involves storing
numbers as strings at some stage. The old concept of binary coded
decimal is not far removed from the string storage concept. Both
systems preserve all the decimal digits of the number. Some handy
Common Lisp functions for converting between strings and numbers:
(defun string-to-real (string-rep)
"Converts a string representation of a number to a rational
representation. For some reason, the lisp community calls rational
numbers `real'."
(let* ((string-parts (ppcre:split "\\." (string-trim '(#\Space #\Tab)
string-rep)))
(integer-portion (parse-integer (car string-parts) :junk-allowed t))
(fractional-portion (if (= (length string-parts) 1)
0
(parse-integer (cadr string-parts)
:junk-allowed t)))
(fractional-divisor (if (= (length string-parts) 1)
1
(expt 10 (length (cadr string-parts))))))
(+ integer-portion (/ fractional-portion fractional-divisor))))
(defun real-to-string (real-rep &key (places 2))
"Converts a rational representaion of a number into a string
representation, rounded to `places' decimal places."
(if real-rep
(if (= places 0)
(format nil "~a" (parse-integer (format nil "~,2f" real-rep)
:junk-allowed t))
(format nil
(format nil "~~,~af" places)
(coerce real-rep 'long-float)))
nil))
(defun double-to-real (double-rep &key (places 2))
"Converts a double to a real. It does this by converting the double
to a string, and then the string to a real. Decimal place truncation
happens when converting to a string."
(string-to-real (real-to-string double-rep :places places)))
(defun pad-with-zeros (string-rep places)
"Left-pads a string representaion of a number with leading zeros to
make it the specified length."
(loop for i from (+ (length string-rep) 1) to places do
(setf string-rep (format nil "0~a" string-rep)))
string-rep)
Carlos
On Wed, 15 Apr 2009, Michael Robinson wrote:
> Date: Wed, 15 Apr 2009 21:10:50 -0700
> From: Michael Robinson <[email protected]>
> Reply-To: "General Linux/UNIX discussion and help; civil and on-topic"
> <[email protected]>
> To: [email protected]
> Subject: [PLUG] Make some tax software...
>
> Tax software that is good needs to ask intelligent questions and using
> the answers to them fill out the appropriate forms. To achieve that,
> you need a programmer obviously to write the software and a certified
> public accountant specializing in tax to come up with both the
> questions, the calculations, and the proper forms.
>
> What would be involved if hypothetically someone on this list started
> a successful tax software company that focused on Linux as the platform?
> What language would be most appropriate to write the tax software in?
> What tool sets are most likely to be the same across all versions of
> Linux that are out there in the wild? I wonder what people who have
> a background in tax and/or writing financial software think.
>
> There are a lot of choices as far as programming languages. There is:
> C, C++, Perl, Python, Ruby on Rails, Cobol, Java, Lisp, etcetera. The
> list could probably be arbitrarily long and some languages probably
> make sense where others don't. Here are at least my thoughts on
> a language making sense:
>
> 1) It is relatively stable, the portions of the language I use today
> will be implemented equally across all Linux distributions and for
> some time out into the future.
>
> 2) It is particularly well suited to database applications, after all
> a tax preparation program is a sort of database program.
>
> 3) A language that allows easy access to external databases and
> spreadsheets. I don't know what the equivalent to Quicken is,
> but it would be nice to be able to import the ol checkbook,
> etcetera.
>
> Please feel free to discuss what it will take to make a Linux based tax
> preparation package. Hopefully, a lively discussion that brings out
> some good ideas will inspire someone someday soon to address the
> shortage of Linux based tax preparation software.
>
> _______________________________________________
> PLUG mailing list
> [email protected]
> http://lists.pdxlinux.org/mailman/listinfo/plug
>
Carlos Konstanski
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug