mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Hook payments into invoice search results
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6870 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include "dialog-invoice.h"
|
||||
#include "dialog-job.h"
|
||||
#include "business-utils.h"
|
||||
#include "dialog-payment.h"
|
||||
|
||||
#define DIALOG_NEW_INVOICE_CM_CLASS "dialog-new-invoice"
|
||||
#define DIALOG_VIEW_INVOICE_CM_CLASS "dialog-view-invoice"
|
||||
@@ -1204,6 +1205,22 @@ edit_invoice_cb (gpointer *invoice_p, gpointer user_data)
|
||||
gnc_ui_invoice_edit (invoice);
|
||||
}
|
||||
|
||||
static void
|
||||
pay_invoice_cb (gpointer *invoice_p, gpointer user_data)
|
||||
{
|
||||
struct _invoice_select_window *sw = user_data;
|
||||
GncInvoice *invoice;
|
||||
|
||||
g_return_if_fail (invoice_p && user_data);
|
||||
|
||||
invoice = *invoice_p;
|
||||
|
||||
if (!invoice)
|
||||
return;
|
||||
|
||||
gnc_ui_payment_new (gncInvoiceGetOwner (invoice), sw->book);
|
||||
}
|
||||
|
||||
static gpointer
|
||||
new_invoice_cb (gpointer user_data)
|
||||
{
|
||||
@@ -1237,6 +1254,7 @@ gnc_invoice_search (GncInvoice *start, GncOwner *owner, GNCBook *book)
|
||||
static GList *columns = NULL;
|
||||
static GNCSearchCallbackButton buttons[] = {
|
||||
{ N_("View/Edit Invoice"), edit_invoice_cb},
|
||||
{ N_("Process Payment"), pay_invoice_cb},
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user