Add hook to print invoice. Still need to write the invoice print

routine (in scheme), but the hook curently exists to do so.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6736 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Derek Atkins
2002-02-25 03:20:45 +00:00
parent dc3c3c75ca
commit 4e436926a3
2 changed files with 19 additions and 2 deletions
@@ -222,3 +222,9 @@
)
(gnc:hook-add-dangler gnc:*add-extension-hook* add-business-extensions)
(define (gnc:invoice-make-printable invoice)
(display "I would be printing out an invoice right now...\n")
)
(export gnc:invoice-make-printable)
+13 -2
View File
@@ -7,6 +7,8 @@
#include "config.h"
#include <gnome.h>
#include <g-wrap-wct.h>
#include <libguile.h>
#include "dialog-utils.h"
#include "global-options.h"
@@ -196,9 +198,18 @@ gnc_invoice_window_help_cb (GtkWidget *widget, gpointer data)
static void
gnc_invoice_window_print_invoice_cb (GtkWidget *widget, gpointer data)
{
/* XXX: print this invoice (TBD) */
InvoiceWindow *iw = data;
GncInvoice *invoice = iw_get_invoice (iw);
SCM func, inv;
fprintf (stderr, "I would print an invoice now... \n");
g_return_if_fail (invoice);
func = gh_eval_str ("gnc:invoice-make-printable");
inv = gw_wcp_assimilate_ptr (invoice, gh_eval_str("<gnc:GncInvoice*>"));
/* scm_protect_object(func); */
gh_call1 (func, inv);
/* scm_unprotect_object(func); */
}
static void