guile docs for gnucash

2005-05-19 Thread Brian
Is there any documentation of the guile modules?

I have been going nuts trying to figure out some of variables, where
they are originally defined, etc..

To add some business preferences such as company-phone, company-fax,
etc. to be used in printing invoices, etc..

I have found 2 files so far, business-prefs.scm, business-utils.scm

It seems that the variables are first defined in business-utils.scm, and
exported from there (no errors generated from there). The
business-prefs.scm file is used to feed the preferences dialog.  Opening
the Preferences dialog crashes gnucash complaining about an unbound
variable.

I have grepped thru everything but cannot seem to find out any other
clues as to how to proceed.




-- 
Brian [EMAIL PROTECTED]

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: Database abstraction layer?

2005-05-19 Thread Derek Atkins
[EMAIL PROTECTED] writes:

 Thanks for the info Derek. I'm really glad you share my enthusiasm for
 using SQLite :) How likely is that to happen?

In what timeframe?  It'll happen eventually, but I have no idea when,
exactly.

 Do you have Matthew's email address, or could you send it to my email
 address so I can contact him? I'd love to have this feature and help
 maintain it with each release.

Check the archives.

-derek
-- 
   Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
   Member, MIT Student Information Processing Board  (SIPB)
   URL: http://web.mit.edu/warlord/PP-ASEL-IA N1NWH
   [EMAIL PROTECTED]PGP key available
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: guile docs for gnucash

2005-05-19 Thread Derek Atkins
Do you properly (export) your variable?  What is the error you see?

-derek

Brian [EMAIL PROTECTED] writes:

 Is there any documentation of the guile modules?

 I have been going nuts trying to figure out some of variables, where
 they are originally defined, etc..

 To add some business preferences such as company-phone, company-fax,
 etc. to be used in printing invoices, etc..

 I have found 2 files so far, business-prefs.scm, business-utils.scm

 It seems that the variables are first defined in business-utils.scm, and
 exported from there (no errors generated from there). The
 business-prefs.scm file is used to feed the preferences dialog.  Opening
 the Preferences dialog crashes gnucash complaining about an unbound
 variable.

 I have grepped thru everything but cannot seem to find out any other
 clues as to how to proceed.

-- 
   Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
   Member, MIT Student Information Processing Board  (SIPB)
   URL: http://web.mit.edu/warlord/PP-ASEL-IA N1NWH
   [EMAIL PROTECTED]PGP key available
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: guile docs for gnucash

2005-05-19 Thread Brian
On Thu, 2005-19-05 at 12:23 -0400, Derek Atkins wrote:
 Do you properly (export) your variable?  What is the error you see?
 
 -derek
 

gnucash: [D] Running functions on hook ui-post-startup-hook
  #procedure business-ui-started ()
Backtrace:
In unknown file:
   ?:  0* [#procedure #f ()]
In /usr/share/gnucash/scm/main-window.scm:
 205:  1* (let* (# #) (letrec # #))
In unknown file:
   ?:  2  (letrec ((changed_cb #)) (gnc:kvp-option-dialog gnc:id-book slots 
...) )
...
   ?:  3  [gnc:kvp-option-dialog # # Book Options ...]
In /usr/share/gnucash/guile-modules/gnucash/gnome-utils.scm:
  26:  4  (let* (# # #) (define # # #) (define # # #) ...)
  26:  5* [gnc:make-kvp-options #gw:wcp gnc:id-type 0xb76a008a]
In /usr/share/gnucash/scm/kvp-option-registry.scm:
  54:  6  (let ((gen-list #) (options #)) (map (lambda # #) gen-list) options)
  56:  7* [map #procedure #f (generator) (#procedure book-options-generator 
# )]
In unknown file:
   ?:  8  (if (null? rest) (map1 f list1) ...)
...
   ?:  9  (let ((ret (list #))) (letrec ((lp #)) (lp (cdr ls) ret)))
   ?: 10* [list ...
   ?: 11*  [#procedure #f # #procedure book-options-generator #]
In /usr/share/gnucash/scm/kvp-option-registry.scm:
  58: 12   [book-options-generator #procedure dispatch (key)]
In unknown file:
   ?: 13   (letrec (#) (reg-option #) (reg-option #) ...)
In /usr/share/gnucash/scm/business-prefs.scm:
 106: 14*  [reg-option ...
 107: 15*   [gnc:make-string-option Business ...

/usr/share/gnucash/scm/business-prefs.scm:107:4: While evaluating arguments to 
gnc:make-string-option in expression (gnc:make-string-option 
gnc:*business-label*  gnc:*company-phone* ...):
/usr/share/gnucash/scm/business-prefs.scm:107:4: Unbound variable: 
gnc:*company-phone*
bash-2.05b$ 



from business-utils.scm:

(define gnc:*business-label* (N_ Business))
(define gnc:*company-name* (N_ Company Name))
(define gnc:*company-addy* (N_ Company Address))
(define gnc:*company-phone* (N_ Company Phone Number))
(define gnc:*company-fax* (N_ Company Fax Number))
(define gnc:*company-url* (N_ Company Website URL))
(define gnc:*company-email* (N_ Company Email Address))
(define gnc:*company-contact* (N_ Company Contact Person))



(export gnc:*business-label* gnc:*company-name* gnc:*company-addy*)
(export gnc:*company-phone* gnc:*company-fax* gnc:*company-url*)
(export gnc:*company-email* gnc:*company-contact*)


From business-prefs.scm:

  (reg-option
   (gnc:make-text-option
gnc:*business-label* gnc:*company-addy*
b (N_ The address of your business) ))

  (reg-option
   (gnc:make-string-option
gnc:*business-label* gnc:*company-phone*
p (N_ The Phone Number of your business) ))

 
[/snip]  etc,etc.
I just copy and pasted an existing, then edited each addition.

Once I get this working I'll work on the report side.   Also Is there a way
to make the Company Name input field, etc wider? Our company name has to
scroll thru using the cursor to see or edit what does not show. 

 Brian [EMAIL PROTECTED] writes:
 
  Is there any documentation of the guile modules?
 
  I have been going nuts trying to figure out some of variables, where
  they are originally defined, etc..
 
  To add some business preferences such as company-phone, company-fax,
  etc. to be used in printing invoices, etc..
 
  I have found 2 files so far, business-prefs.scm, business-utils.scm
 
  It seems that the variables are first defined in business-utils.scm, and
  exported from there (no errors generated from there). The
  business-prefs.scm file is used to feed the preferences dialog.  Opening
  the Preferences dialog crashes gnucash complaining about an unbound
  variable.
 
  I have grepped thru everything but cannot seem to find out any other
  clues as to how to proceed.
 
-- 
Brian [EMAIL PROTECTED]

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: guile docs for gnucash

2005-05-19 Thread Derek Atkins
Quoting Brian [EMAIL PROTECTED]:

 On Thu, 2005-19-05 at 12:23 -0400, Derek Atkins wrote:
  Do you properly (export) your variable?  What is the error you see?

[snip]
  107: 15*   [gnc:make-string-option Business ...
 
 /usr/share/gnucash/scm/business-prefs.scm:107:4: While evaluating arguments
 to 
 gnc:make-string-option in expression (gnc:make-string-option
 gnc:*business-label*  gnc:*company-phone* ...):
 /usr/share/gnucash/scm/business-prefs.scm:107:4: Unbound variable:
 gnc:*company-phone*
 bash-2.05b$ 

Yep, the symbol isn't available at runtime

 from business-utils.scm:
[snip]
 
 (export gnc:*business-label* gnc:*company-name* gnc:*company-addy*)
 (export gnc:*company-phone* gnc:*company-fax* gnc:*company-url*)
 (export gnc:*company-email* gnc:*company-contact*)

[snip]
 [/snip]  etc,etc.
 I just copy and pasted an existing, then edited each addition.

Are you sure you ran a make install to get your files into the install tree?
The file above is /usr/share/gnucash/scm/business-prefs.scm which would seem to
imply it's from the distro version and not your own version.

 Once I get this working I'll work on the report side.   Also Is there a way
 to make the Company Name input field, etc wider? Our company name has to
 scroll thru using the cursor to see or edit what does not show. 

Unfortunately no, there's no way to make that input field bigger.

-derek

-- 
   Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
   Member, MIT Student Information Processing Board  (SIPB)
   URL: http://web.mit.edu/warlord/PP-ASEL-IA N1NWH
   [EMAIL PROTECTED]PGP key available

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: guile docs for gnucash

2005-05-19 Thread Brian
On Thu, 2005-19-05 at 19:31 -0400, Derek Atkins wrote:

 Are you sure you ran a make install to get your files into the install tree?
 The file above is /usr/share/gnucash/scm/business-prefs.scm which would seem 
 to
 imply it's from the distro version and not your own version.
 -derek
 

I renamed the original 2 files with .orig appended then copied the 2
modified ones there to test.  Do I have to make everything with the
modified files?  I thought one of the points about using guile is not
having to re-compile, but I don't know how the variables are handled
thru the c code for saving in the file etc..

-- 
Brian [EMAIL PROTECTED]

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: guile docs for gnucash

2005-05-19 Thread Derek Atkins
Quoting Brian [EMAIL PROTECTED]:

 On Thu, 2005-19-05 at 19:31 -0400, Derek Atkins wrote:
 
  Are you sure you ran a make install to get your files into the install
 tree?
  The file above is /usr/share/gnucash/scm/business-prefs.scm which would
 seem to
  imply it's from the distro version and not your own version.
  -derek
  
 
 I renamed the original 2 files with .orig appended then copied the 2
 modified ones there to test.  Do I have to make everything with the
 modified files?  I thought one of the points about using guile is not
 having to re-compile, but I don't know how the variables are handled
 thru the c code for saving in the file etc..

No, you do not need to recompile, but you DO need to install the modified SCM
files into the install tree (/usr/...).  Having the .orig files in the install
tree might be a bad idea, so you might want to remove them (or move them into
your homedir or something).

-derek

-- 
   Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
   Member, MIT Student Information Processing Board  (SIPB)
   URL: http://web.mit.edu/warlord/PP-ASEL-IA N1NWH
   [EMAIL PROTECTED]PGP key available

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


New register action: forward the current transaction.

2005-05-19 Thread Edward J. Huff
I am about to implement a Forward Transaction command 
in the split register.  I hope you would incorporate it,
but I'm doing it because I want to have it myself.  

The name comes by analogy to Reverse Transaction:  the
new transaction will reverse the effect on the account
of the original, but the amount is not returned where it
came from.  Instead it is forwarded to a different account.

First, I explain what I need it for.

I have a gross receipts asset account to which I 
debit parking rent checks as they arrive, and a quarterly 
report which (will) calculate a gross receipts tax based 
on debits to that account.  I record the check number, 
date on the check, amount, maker, and memo in the Gross 
Receipts ledger, credited to the customer's accrued
rent income account.  I really don't want to type this
data more than once.

Ok, now I want to mail in the deposit.  I need to debit
checking and credit Gross Receipts with the total amount, 
and I need to print out a deposit slip listing all of the 
checks with all of the details.  This is somewhat painful 
to accomplish with GnuCash now (cvs HEAD), but it does work.

I made a giant split transaction with all the splits 
crediting Gross Receipts except for one which makes a 
balancing debit to checking.  I put the customer's 
check number in the action field, the customer's 
check date and name in the memo field, Gross Receipts 
in the account, and the check amount in the credit field.

In simple ledger mode the account window has what I would
call a bug:  it shows each split as a separate transaction
in the ledger, but when you click on the split toolbar
button, every one of those transactions seems to contain
all of the other splits.  The impression is that there are
N copies of the transaction, each with all the splits in
it.  I think simple ledger should never show any given
transaction more than once.  The debit field should show
the total of all debits to the displayed account, the
credit field should show the total of all credits to the 
displayed account, and the account field should be split
transaction. 

Getting the splits in the order I wanted was not easy since
I didn't notice that planning ahead was essential for that.
Also it is easy to get the split moved to the top if you
forget to put a value in the credit field before clicking
somewhere else to copy data.  So I made a bunch of
splits with the credit field already filled in so they 
wouldn't move.  At the end, I had a bunch of blank splits 
I wanted to delete, so I selected the split, clicked delete, 
answered the dialog, selected the next split, clicked delete, 
answered the dialog, clicked delete, answered the dialog... 
oops!!  I deleted the whole transaction.  So I got to do it 
twice.  (There ought to be a small change which would make
that less likely ... but I don't know what it would be).

I used the single transaction report to print the deposit
slip.  There is something wrong with that report.  It
reports a nonzero net change for which I see no cause.
For today, I fixed it by editing the html and printing it 
from Mozilla, but I plan to investigate.

To make it easier next time, I plan to implement a forward
command which will let me create the deposit transaction with
one or two keystrokes per check (using a menu accelerator key).

It will work like this.  First I create the empty deposit
transaction, with date, description deposit to checking 
acct #..., account a:c:checking, and an amount in the
debit field.  Then I do cut transaction.

Next, I repeatedly select one of the checks (the transaction
from a:c:accrued:customer to a:c:gross receipts), do a
forward transaction command (with one keystroke), and if
necessary, press the down arrow to get to the next check, etc.

At the end, I go to the blank transaction and do paste 
transaction.  The result will be the giant split transaction
described above.

Each forward transaction command results in the addition
of one split to the copied transaction.  The account field
is always the current account of the register.  The amount
is the negative of the amount of the selected transaction.
The action, memo, and reconciled fields are filled in
as specified in the forward transaction preferences tab
of the global preferences, using data from the selected 
transaction.


-
Here is an earlier idea, in which I would be
creating separate deposit transactions for each check.
That has the disadvantage of not matching the bank's
version of the checking account.  

/*
Forward the current transaction, i.e., create a new
transaction which in a sense reverses the current
transaction: the amount debited (credited) to the current
account by the current transaction is credited (debited)
by a new transaction.  However, the amount is not
returned where it came from, but instead is sent on to an
account specified by the last transaction which was
copied using the Copy Transaction command.

There must be a copied transaction, and 

Re: guile docs for gnucash

2005-05-19 Thread Brian
On Thu, 2005-19-05 at 19:57 -0400, Derek Atkins wrote:
 Quoting Brian [EMAIL PROTECTED]:
 
  On Thu, 2005-19-05 at 19:31 -0400, Derek Atkins wrote:
  
   Are you sure you ran a make install to get your files into the install
  tree?
   The file above is /usr/share/gnucash/scm/business-prefs.scm which would
  seem to
   imply it's from the distro version and not your own version.
   -derek
   
  
  I renamed the original 2 files with .orig appended then copied the 2
  modified ones there to test.  Do I have to make everything with the
  modified files?  I thought one of the points about using guile is not
  having to re-compile, but I don't know how the variables are handled
  thru the c code for saving in the file etc..
 
 No, you do not need to recompile, but you DO need to install the modified SCM
 files into the install tree (/usr/...).  Having the .orig files in the install
 tree might be a bad idea, so you might want to remove them (or move them into
 your homedir or something).
 
 -derek
 
That did it, Thanks... I did an install to /opt and that seems to work
fine.  Now to complete some of the changes.

My other question still persists.  Is there any documentation for the
guile portion... logic diagrams... anything?

I know you would like us to make some of the code changes and submit
them for a lot of these little changes, but it would make it a lot
easier if we had something other than the hunt and peck method.

-- 
Brian [EMAIL PROTECTED]

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel