diff --git a/ChangeLog b/ChangeLog index a3c595c7e5..3b31dbf1c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-05-01 Robert Graham Merkel + + * src/scm/report/transaction-report-2.scm : Added i18n and + optional two-columns printout to the new transaction report. + 2000-04-30 Dave Peticolas * src/engine/Queue.c (xaccQueueGetShares): computation should start @@ -44,6 +49,11 @@ * src/gnome/reconcile-list.c (gnc_reconcile_list_fill): debits are positive, credits are negative. +2000-04-28 Robert Graham Merkel + + * src/scm/html-generator.scm (html-table-do-entry): Bryan Larsen's + fix for null (#f) generators. + 2000-04-28 Dave Peticolas * src/gnome/option-util.c: redid the option database storage as diff --git a/Makefile.in b/Makefile.in index e8d5a43c8b..99eea1ab42 100644 --- a/Makefile.in +++ b/Makefile.in @@ -173,7 +173,7 @@ install: $(INSTALL_DATA) doc/*.txt ${GNC_DOCDIR} $(INSTALL_DATA) doc/INSTALL ${GNC_DOCDIR} $(INSTALL_DATA) TODO ${GNC_DOCDIR} - $(INSTALL_DATA) CHANGES ${GNC_DOCDIR} + $(INSTALL_DATA) NEWS ${GNC_DOCDIR} $(INSTALL_DATA) doc/examples/*.xac ${GNC_DOCDIR}/examples $(INSTALL_DATA) doc/examples/*.qif ${GNC_DOCDIR}/examples diff --git a/CHANGES b/NEWS similarity index 100% rename from CHANGES rename to NEWS diff --git a/src/gnome/dialog-budget.c b/src/gnome/dialog-budget.c index 69ec9acb31..40d3db2d5b 100644 --- a/src/gnome/dialog-budget.c +++ b/src/gnome/dialog-budget.c @@ -596,6 +596,16 @@ budget_name_entry_changed(GtkEditable *editable, BudgetDialog *bd) budget_changed(bd); } +static void +entry_type_menu_changed(GtkButton *button, BudgetDialog *bd) +{ + if (bd->ignore_changes) + return; + + budget_changed(bd); + bd->entry_changed = TRUE; +} + static void allow_edits(BudgetDialog *bd, gboolean allow_edits) { @@ -746,6 +756,13 @@ on_budget_entry_tree_scroll_vertical (GtkCList *clist, select_node(bd, node); } +static void +connect_entry_type_menu_item(GtkWidget *item, gpointer data) +{ + gtk_signal_connect(GTK_OBJECT(item), "activate", + GTK_SIGNAL_FUNC(entry_type_menu_changed), data); +} + BudgetDialog * gnc_ui_budget_dialog_create(SCM budget, SCM apply_func) { @@ -754,6 +771,7 @@ gnc_ui_budget_dialog_create(SCM budget, SCM apply_func) GtkWidget *button; GtkWidget *arrow; GtkWidget *box; + GtkWidget *menu; initialize_getters(); initialize_preds(); @@ -781,6 +799,9 @@ gnc_ui_budget_dialog_create(SCM budget, SCM apply_func) GTK_SIGNAL_FUNC(entry_description_entry_changed), bd); bd->entry_type_menu = gtk_object_get_data(bdo, "entry_type_menu"); + menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(bd->entry_type_menu)); + gtk_container_forall(GTK_CONTAINER(menu), connect_entry_type_menu_item, bd); + bd->entry_frame = gtk_object_get_data(bdo, "entry_frame"); bd->subentry_description_entry = diff --git a/src/scm/html-generator.scm b/src/scm/html-generator.scm index 60b36238d4..246ebcc1db 100644 --- a/src/scm/html-generator.scm +++ b/src/scm/html-generator.scm @@ -311,7 +311,8 @@ (define (html-table-do-entry line specs) (map (lambda (spec) - (cond ((report-spec-get-get-value-proc spec) + (cond ((and (report-spec-get-get-value-proc spec) + (report-spec-get-html-proc spec)) ((report-spec-get-html-proc spec) ((report-spec-get-get-value-proc spec) line))) (else #f))) diff --git a/src/scm/report/transaction-report-2.scm b/src/scm/report/transaction-report-2.scm index 6702585591..4d21d89348 100644 --- a/src/scm/report/transaction-report-2.scm +++ b/src/scm/report/transaction-report-2.scm @@ -10,6 +10,8 @@ (gnc:depend "html-generator.scm") (let () + (define string-db (gnc:make-string-database)) + (define (make-split-report-spec options) (remove-if-not @@ -19,7 +21,7 @@ (gnc:option-value (gnc:lookup-option options "Display" "Date")) (make-report-spec - "Date" + (string-db 'lookup 'date-string) (lambda (split) (gnc:transaction-get-date-posted (gnc:split-get-parent split))) @@ -32,12 +34,12 @@ #f ; subs-list-proc #f) #f) - + (if (gnc:option-value (gnc:lookup-option options "Display" "Num")) (make-report-spec - "Num" + (string-db 'lookup 'num-string) (lambda (split) (gnc:transaction-get-num (gnc:split-get-parent split))) @@ -54,7 +56,7 @@ (gnc:option-value (gnc:lookup-option options "Display" "Description")) (make-report-spec - "Description" + (string-db 'lookup 'desc-string) (lambda (split) (gnc:transaction-get-description (gnc:split-get-parent split))) @@ -71,7 +73,7 @@ (gnc:option-value (gnc:lookup-option options "Display" "Memo")) (make-report-spec - "Memo" + (string-db 'lookup 'memo-string) gnc:split-get-memo (lambda (memo) (html-left-cell (html-string memo))) #f ; total-proc @@ -87,7 +89,7 @@ (gnc:option-value (gnc:lookup-option options "Display" "Account")) (make-report-spec - "Account" + (string-db 'lookup 'acc-string) (lambda (split) (gnc:account-get-full-name (gnc:split-get-account split))) @@ -108,7 +110,7 @@ (gnc:option-value (gnc:lookup-option options "Display" "Other Account")) (make-report-spec - "Other Account" + (string-db 'lookup 'other-acc-string) (lambda (split) (let ((others (gnc:split-get-other-splits split))) (if (null? others) @@ -125,10 +127,10 @@ #f) (if - (gnc:option-value - (gnc:lookup-option options "Display" "Amount")) + (eq? (gnc:option-value + (gnc:lookup-option options "Display" "Amount")) 'single) (make-report-spec - "Amount" + (string-db 'lookup 'amount-string) gnc:split-get-value (lambda (value) (html-right-cell (html-currency value))) + ; total-proc @@ -141,6 +143,69 @@ (map gnc:split-get-value (gnc:split-get-other-splits split))) (lambda (value) (html-right-cell (html-ital (html-currency value))))) + #f) + + (if + (eq? (gnc:option-value + (gnc:lookup-option options "Display" "Amount")) 'double) + (make-report-spec + (string-db 'lookup 'credit-string) + (lambda (split) (max 0 (gnc:split-get-value split))) + (lambda (value) + (if (> value 0) (html-right-cell (html-currency value)) + (html-right-cell (html-string " ")))) + + ; total-proc + (lambda (value) + (html-right-cell (html-strong (html-currency value)))) + (lambda (value) + (html-right-cell (html-strong (html-currency value)))) + #t ; first-last-preference + (lambda (split) + (map gnc:split-get-value (gnc:split-get-other-splits split))) + (lambda (value) + (if (> value 0) (html-right-cell (html-ital (html-currency value))) + (html-right-cell (html-ital (html-string " ")))))) + #f) + + (if + (eq? (gnc:option-value + (gnc:lookup-option options "Display" "Amount")) 'double) + (make-report-spec + (string-db 'lookup -debit-string) + (lambda (split) (min 0 (gnc:split-get-value split))) + (lambda (value) + (if (< value 0) (html-right-cell (html-currency value)) + (html-right-cell (html-string " ")))) + + ; total-proc + (lambda (value) + (html-right-cell (html-strong (html-currency value)))) + (lambda (value) + (html-right-cell (html-strong (html-currency value)))) + #t ; first-last-preference + (lambda (split) + (map gnc:split-get-value (gnc:split-get-other-splits split))) + (lambda (value) + (if (< value 0) (html-right-cell (html-ital (html-currency value))) + (html-right-cell (html-ital (html-string " ")))))) + #f) + + (if + (eq? (gnc:option-value + (gnc:lookup-option options "Display" "Amount")) 'double) + (make-report-spec + (string-db 'lookup 'total-string) + gnc:split-get-value + ;(lambda (value) (html-right-cell (html-currency value))) + ;(lambda (value) (html-right-cell (html-string "hello"))) + #f + + ; total-proc + (lambda (value) + (html-right-cell (html-strong (html-currency value)))) + (lambda (value) + (html-right-cell (html-strong (html-currency value)))) + #t ; first-last-preference + #f ; + #f) #f)))) (define (split-report-get-sort-spec-entry key ascending?) @@ -266,7 +331,7 @@ ((none) #f) (else (gnc:error "invalid sort argument")))) - + (define (make-split-list account split-filter-pred) (let ((num-splits (gnc:account-get-split-count account))) @@ -352,7 +417,7 @@ #(single "Single" "Display 1 line")))) - + (let ((key-choice-list (list #(account @@ -408,7 +473,7 @@ (list #(ascend "Ascending" "smallest to largest, earliest to latest") #(descend "Descending" "largest to smallest, latest to earliest")))) - + (gnc:register-trep-option (gnc:make-multichoice-option "Sorting" "Secondary Key" @@ -454,12 +519,16 @@ (gnc:register-trep-option (gnc:make-simple-boolean-option "Display" "Other Account" - "h" "Display the other account? (if this is a split transaction, this parameter is guessed." #f)) + "h" "Display the other account? (if this is a split transaction, this parameter is guessed)." #f)) (gnc:register-trep-option - (gnc:make-simple-boolean-option + (gnc:make-multichoice-option "Display" "Amount" - "i" "Display the amount?" #t)) + "i" "Display the amount?" + 'single + (list #(none "None" "No amount display") + #(single "Single" "Single Column Display") + #(double "Double" "Two Column Display")))) (gnc:register-trep-option (gnc:make-simple-boolean-option @@ -476,7 +545,7 @@ gnc:*transaction-report-options*) - (define string-db (gnc:make-string-database)) + (define (gnc:trep-renderer options) (let* ((begindate (gnc:lookup-option options "Report Options" "From")) @@ -520,7 +589,6 @@ (list (html-start-document-title (string-db 'lookup 'title)) - (html-para "Transaction report using the new reporting framework in html-generator.scm") (html-start-table) (if (gnc:option-value @@ -548,10 +616,21 @@ (html-end-table) (html-end-document)))) + (string-db 'store 'title "Transaction Report") + (string-db 'store 'date-string "Date") + (string-db 'store 'num-string "Num") + (string-db 'store 'desc-string "Description") + (string-db 'store 'memo-string "Memo") + (string-db 'store 'acc-string "Account") + (string-db 'store 'other-acc-string "Other Account") + (string-db 'store 'amount-string "Amount") + (string-db 'store 'debit-string "Debit") + (string-db 'store 'credit-string "Credit") + (string-db 'store 'total-string "Total") (gnc:define-report 'version 1 - 'name "Transactions 2" + 'name (string-db 'lookup 'title) 'options-generator trep-options-generator 'renderer gnc:trep-renderer))