From 01ac9a55bcc5e38423817fec778055e59a1e24fc Mon Sep 17 00:00:00 2001 From: Derek Atkins Date: Mon, 19 May 2003 22:25:34 +0000 Subject: [PATCH] * src/business/business-gnome/dialog-invoice.[ch]: pass a double instead of an int, because guile-1.6 sucks. Also fix the Query to actually include the Due Date of the invoice. * src/business/business-gnome/gw-business-gnome-spec.scm: change the int to a double on the bills-due api git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8342 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 6 ++++++ src/business/business-gnome/dialog-invoice.c | 9 +++++++-- src/business/business-gnome/dialog-invoice.h | 2 +- src/business/business-gnome/gw-business-gnome-spec.scm | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 17a7c71d2f..4910ea777a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,12 @@ * src/business/businss-gnome/gw-business-gnome-spec.scm: wrap the new due-bills api * src/engine/gnc-book.c: forcibly signal a book destroy event + + * src/business/business-gnome/dialog-invoice.[ch]: pass a double + instead of an int, because guile-1.6 sucks. Also fix the Query + to actually include the Due Date of the invoice. + * src/business/business-gnome/gw-business-gnome-spec.scm: + change the int to a double on the bills-due api 2003-05-18 Derek Atkins diff --git a/src/business/business-gnome/dialog-invoice.c b/src/business/business-gnome/dialog-invoice.c index 9aa06b6a89..596353a333 100644 --- a/src/business/business-gnome/dialog-invoice.c +++ b/src/business/business-gnome/dialog-invoice.c @@ -2398,7 +2398,7 @@ gnc_invoice_search_edit (gpointer start, gpointer book) } DialogQueryList * -gnc_invoice_show_bills_due (GNCBook *book, int days_in_advance) +gnc_invoice_show_bills_due (GNCBook *book, double days_in_advance) { GNCIdType type = GNC_INVOICE_MODULE_NAME; Query *q; @@ -2406,6 +2406,7 @@ gnc_invoice_show_bills_due (GNCBook *book, int days_in_advance) time_t end_date; GList *res; gint len; + Timespec ts; static GList *param_list = NULL; static GNCDisplayListButton buttons[] = { { N_("View/Edit Bill"), edit_invoice_direct }, @@ -2449,7 +2450,11 @@ gnc_invoice_show_bills_due (GNCBook *book, int days_in_advance) if (days_in_advance < 0) days_in_advance = 0; end_date += days_in_advance*60*60*24; - xaccQueryAddDateMatchTT(q, FALSE, 0, TRUE, end_date, QUERY_AND); + + ts.tv_sec = (gint64) end_date; + ts.tv_nsec = 0; + pred_data = gncQueryDatePredicate (COMPARE_LTE, DATE_MATCH_NORMAL, ts); + gncQueryAddTerm (q, g_slist_prepend(NULL, INVOICE_DUE), pred_data, QUERY_AND); res = gncQueryRun(q); len = g_list_length (res); diff --git a/src/business/business-gnome/dialog-invoice.h b/src/business/business-gnome/dialog-invoice.h index 84308b11ac..3d5960ec14 100644 --- a/src/business/business-gnome/dialog-invoice.h +++ b/src/business/business-gnome/dialog-invoice.h @@ -33,6 +33,6 @@ GNCSearchWindow * gnc_invoice_search_edit (gpointer start, gpointer book); void gnc_business_call_owner_report (GncOwner *owner, Account *acc); -DialogQueryList *gnc_invoice_show_bills_due (GNCBook *book, int days_in_advance); +DialogQueryList *gnc_invoice_show_bills_due (GNCBook *book, double days_in_advance); #endif /* GNC_DIALOG_INVOICE_H_ */ diff --git a/src/business/business-gnome/gw-business-gnome-spec.scm b/src/business/business-gnome/gw-business-gnome-spec.scm index e16b740dc1..e350a708be 100644 --- a/src/business/business-gnome/gw-business-gnome-spec.scm +++ b/src/business/business-gnome/gw-business-gnome-spec.scm @@ -168,7 +168,7 @@ 'gnc:invoice-show-bills-due ' "gnc_invoice_show_bills_due" - '(( book) ( days_in_advance)) + '(( book) ( days_in_advance)) "Dialog: display the bills due within the next \"days\"") ;;