[PATCH] Re: Fancy Invoice
On Mon, 2006-06-02 at 18:59 -0800, Brian wrote: > > There is one more change I would like to make. Add a parameter to set > the minimum number of entries in the body rather than it be hard coded > in the scheme file. > I've finished making the changes. I don't think I've missed any of the important hard coded items in the fancy-invoice. You may want to clean up a few of the old statements I've commented out in favour of my changes. You might also want to check that I have all the translation markings correct. I followed the code that was there, but some of that may be wrong since he states that it might be in his oli-custom comments. I also think these changes could be applied to the 1.8.12 as well since I started them there quite a while ago. Side note: the gnc:make-number-range-option also does not render on the screen the best. It seems to have a display box slightly shorter than the number text it is displaying. I had to compensate by making the minimum display number width wider. -- Brian <[EMAIL PROTECTED]> Index: src/business/business-reports/fancy-invoice.scm === --- src/business/business-reports/fancy-invoice.scm (revision 13138) +++ src/business/business-reports/fancy-invoice.scm (working copy) @@ -43,6 +43,9 @@ ;; template. The most common used templates will be distributed with ;; gnucash. +;; Modifed to use settable options instead of the hard coded ones. +;; modified by Brian Dolbec Feb. 6, 2006 + (define-module (gnucash report fancy-invoice)) (use-modules (srfi srfi-1)) @@ -242,7 +245,7 @@ (define (options-generator) (define gnc:*report-options* (gnc:new-options)) - + (define (gnc:register-inv-option new-option) (gnc:register-option gnc:*report-options* new-option)) @@ -331,14 +334,31 @@ "tc" (N_ "Display the payments applied to this invoice?") #f)) (gnc:register-inv-option + (gnc:make-number-range-option +(N_ "Display") (N_ "Minimum # of entries") +"u" (N_ "The minimum number of invoice entries to display. (-1)") 23 +4 23 3 1)) + + (gnc:register-inv-option (gnc:make-text-option (N_ "Display") (N_ "Extra Notes") "u" (N_ "Extra notes to put on the invoice") ;; oli-custom - Extra notes to add on each invoice, invoice-independent - ;; yes, I was too lazy to (get-company-name) ;) - "Make all cheques payable to: Company Name Inc.\nDirect all inquiries to: Mr. Accounting Contact")) + ;; yes, I was too lazy to (get-company-name) ;) + ;;"Make all cheques payable to: Company Name Inc.\nDirect all inquiries to: Mr. Accounting Contact")) + "")) (gnc:register-inv-option + (gnc:make-simple-boolean-option +(N_ "Display") (N_ "Payable to:") + "ua" (N_ "Display the Payable to: information") #t)) + + (gnc:register-inv-option + (gnc:make-simple-boolean-option +(N_ "Display") (N_ "Company contact") + "ub" (N_ "Display the Company contact information") #t)) + + (gnc:register-inv-option (gnc:make-string-option (N_ "Display") (N_ "Today Date Format") "v" (N_ "The format for the date->string conversion for today's date.") @@ -440,7 +460,7 @@ (do ((entries-added entries-added (+ entries-added 1)) (odd-row? odd-row? (not odd-row?))) ;; oli-custom - here you put the minimum number of rows minus one - ((> entries-added 23)) + ((> entries-added (opt-val "Display" "Minimum # of entries" ))) (gnc:html-table-append-row/markup! table (if odd-row? "normal-row" "alternate-row") (string->list (make-string (num-columns-required used-columns) #\space))) ) (add-subtotal-row table used-columns value-collector @@ -616,15 +636,34 @@ 'attribute (list "valign" "top")) table)) +;; define a couple variables used in various places +;;(define c-name gnc:*company-name* ) +;;(define c-contact gnc:*company-contact*) + (define (make-myname-table book date-format) (let* ((table (gnc:make-html-table)) (slots (gnc:book-get-slots book)) (name (gnc:kvp-frame-get-slot-path slots (append gnc:*kvp-option-path* (list gnc:*business-label* gnc:*company-name* +;; (contact (gnc:kvp-frame-get-slot-path +;; slots (append gnc:*kvp-option-path* +;; (list gnc:*business-label* gnc:*company-contact* (addy (gnc:kvp-frame-get-slot-path slots (append gnc:*kvp-option-path* (list gnc:*business-label* gnc:*company-addy* + (id (gnc:kvp-frame-get-slot-path + slots (append gnc:*kvp-option-path* + (list gnc:*business-label* gnc:*company-id* + (phone (gnc:kvp-frame-get-slot-path + slots (append gnc:*kvp-option-path* + (list gnc:*business-label* gnc:*company-phone* + (fax (gnc:kvp-frame-get-slot-path + slots (append gnc:*kvp-option-path* + (list gnc:*business-label* gnc:*company-fax* + (url (gnc:kvp-frame-get-slot-path + slots (append gnc:*kvp-option-path* + (list gnc:*business-label* gnc:*company-url*
Re: [PATCH] Re: Fancy Invoice
Quoting Brian <[EMAIL PROTECTED]>: I've finished making the changes. I don't think I've missed any of the important hard coded items in the fancy-invoice. You may want to clean up a few of the old statements I've commented out in favour of my changes. You might also want to check that I have all the translation markings correct. I followed the code that was there, but some of that may be wrong since he states that it might be in his oli-custom comments. Thanks.. I'll take a look. Ideally you should create a bug report and then (after you submit the report) attach this patch, just in case I forget about it ;) I also think these changes could be applied to the 1.8.12 as well since I started them there quite a while ago. That wont happen. The 1.8 source tree is EOL'd -- 1.9.x alpha releases are imminent to get us on the road to 2.0. There will be no more 1.8 releases so applying patches to 1.8 is just a waste of time. Side note: the gnc:make-number-range-option also does not render on the screen the best. It seems to have a display box slightly shorter than the number text it is displaying. I had to compensate by making the minimum display number width wider. Is this true in SVN? Or only 1.8? Brian <[EMAIL PROTECTED]> -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: [PATCH] Re: Fancy Invoice
On Tue, 2006-07-02 at 10:10 -0500, Derek Atkins wrote: > Quoting Brian <[EMAIL PROTECTED]>: > > That wont happen. The 1.8 source tree is EOL'd -- 1.9.x alpha releases > are imminent to get us on the road to 2.0. There will be no more 1.8 releases > so applying patches to 1.8 is just a waste of time. > I know a release won't happen. I think since the changes are only in scheme, simply changing out the 3 files changed will do it. > > Side note: the gnc:make-number-range-option also does not render on the > > screen the best. It seems to have a display box slightly shorter than > > the number text it is displaying. I had to compensate by making the > > minimum display number width wider. > > Is this true in SVN? Or only 1.8? > > -derek > This was an older SVN. I had not updated and rebuilt it while I was working on the fancy-invoice. I have just done an svn update, but not built and tested it yet. Checking just now the welcome sample report in both 1.8.12 and svn show the number of columns option fine without any decimals. However the gnc:make-number-range-option I used in the fancy-invoice doesn't. Which is why I set it for some decimals to show. I started looking but have not found how it is done in the welcome sample report. Too many imports to look thru. Looks like I'll have to grep it out. -- Brian <[EMAIL PROTECTED]> ___ gnucash-devel mailing list gnucash-devel@gnucash.org https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Re: [PATCH] Re: Fancy Invoice
Hi, Brian <[EMAIL PROTECTED]> writes: > I also think these changes could be applied to the 1.8.12 as well since > I started them there quite a while ago. > > Side note: the gnc:make-number-range-option also does not render on the > screen the best. It seems to have a display box slightly shorter than > the number text it is displaying. I had to compensate by making the > minimum display number width wider. I've applied these changes to SVN (r13237). I made a bunch of changes to your changes so it's likely that you'll need to "svn revert" after you update or you'll probably get svn merge conflicts in your tree. I've verified that these changes work. Enjoy! -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: [PATCH] Re: Fancy Invoice
On Sun, 2006-12-02 at 13:32 -0500, Derek Atkins wrote: > Hi, > > Brian <[EMAIL PROTECTED]> writes: > > > I also think these changes could be applied to the 1.8.12 as well since > > I started them there quite a while ago. > > > > Side note: the gnc:make-number-range-option also does not render on the > > screen the best. It seems to have a display box slightly shorter than > > the number text it is displaying. I had to compensate by making the > > minimum display number width wider. > > I've applied these changes to SVN (r13237). I made a bunch of changes > to your changes so it's likely that you'll need to "svn revert" after > you update or you'll probably get svn merge conflicts in your tree. > I've verified that these changes work. > > Enjoy! > > -derek Thank you. I wanted to do what you changed, but did not have a clue about how to go about it in gnucash. Now I have an example :) It seems that we both missed the company-id actually being put into the report. I've added it to the bottom of the address as I did not know of a better place for it. Ideas are welcome. Most bills I get from suppliers seem to have it as the last line of their name & address, probably because it was easier and cheaper than reprinting, etc.. I had also added it to the actual address in 1.8 so it would show on invoices, etc. since it was not a separate entity. attached is a one line patch adding the company-id. -- Brian <[EMAIL PROTECTED]> Index: src/business/business-reports/fancy-invoice.scm === --- src/business/business-reports/fancy-invoice.scm (revision 13293) +++ src/business/business-reports/fancy-invoice.scm (working copy) @@ -722,7 +722,7 @@ 'attribute (list "align" "right") 'attribute (list "width" "33%")) (gnc:html-table-append-row! - table (list (string-expand (if addy addy "") #\newline "") + table (list (string-expand (string-append (if addy addy "") (if id (string-append "\n" id) "")) #\newline "") (string-expand (string-append (if phone (string-append (_ "Phone:") " " phone) ___ gnucash-devel mailing list gnucash-devel@gnucash.org https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Re: [PATCH] Re: Fancy Invoice
Quoting Brian <[EMAIL PROTECTED]>: Thank you. I wanted to do what you changed, but did not have a clue about how to go about it in gnucash. Now I have an example :) It seems that we both missed the company-id actually being put into the report. I've added it to the bottom of the address as I did not know of a better place for it. Ideas are welcome. Most bills I get from suppliers seem to have it as the last line of their name & address, probably because it was easier and cheaper than reprinting, etc.. I had also added it to the actual address in 1.8 so it would show on invoices, etc. since it was not a separate entity. attached is a one line patch adding the company-id. Applied. -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