Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'Customer's Invoices' to customer list popup #2062

Open
wants to merge 1 commit into
base: stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions gnucash/gnome/gnc-plugin-page-owner-tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ static void gnc_plugin_page_owner_tree_cmd_owners_report (GSimpleAction *simple,
static void gnc_plugin_page_owner_tree_cmd_owner_report (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_owner_tree_cmd_process_payment (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_owner_tree_cmd_edit_tax (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
static void gnc_plugin_page_owner_tree_cmd_search_invoices (GSimpleAction *simple, GVariant *parameter, gpointer user_data);

static guint plugin_page_signals[LAST_SIGNAL] = { 0 };

Expand Down Expand Up @@ -159,6 +160,7 @@ static GActionEntry gnc_plugin_page_owner_tree_actions [] =
{ "OTCustomerReportAction", gnc_plugin_page_owner_tree_cmd_owner_report, NULL, NULL, NULL },
{ "OTEmployeeReportAction", gnc_plugin_page_owner_tree_cmd_owner_report, NULL, NULL, NULL },
{ "OTProcessPaymentAction", gnc_plugin_page_owner_tree_cmd_process_payment, NULL, NULL, NULL },
{ "OTSearchInvoicesAction", gnc_plugin_page_owner_tree_cmd_search_invoices, NULL, NULL, NULL },
};
/** The number of actions provided by this plugin. */
static guint gnc_plugin_page_owner_tree_n_actions = G_N_ELEMENTS(gnc_plugin_page_owner_tree_actions);
Expand Down Expand Up @@ -1008,6 +1010,27 @@ gnc_plugin_page_owner_tree_cmd_edit_owner (GSimpleAction *simple,
LEAVE(" ");
}

static void
gnc_plugin_page_owner_tree_cmd_search_invoices (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)

{
auto page = GNC_PLUGIN_PAGE_OWNER_TREE (user_data);
GtkWindow *parent;
GncOwner *owner = gnc_plugin_page_owner_tree_get_current_owner (page);
if (NULL == owner) return;

ENTER("action %p, page %p", simple, page);

parent = GTK_WINDOW (gnc_plugin_page_get_window (GNC_PLUGIN_PAGE (page)));

gnc_invoice_search (parent, NULL, owner, gnc_get_current_book ());

LEAVE(" ");
}


#if 0 /* Disabled due to crash */
static void
gnc_plugin_page_owner_tree_cmd_delete_owner (GSimpleAction *simple,
Expand Down
7 changes: 6 additions & 1 deletion gnucash/ui/gnc-plugin-page-owner-tree.ui
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<attribute name="temp" translatable="no">yes</attribute>
</item>
</menu>

<menu id="EditPlaceholder2-e">
<item>
<attribute name="label" translatable="yes">E_dit Employee</attribute>
Expand Down Expand Up @@ -170,6 +170,11 @@
<attribute name="action">GncPluginPageOwnerTreeActions.OTProcessPaymentAction</attribute>
<attribute name="tooltip" translatable="yes">Process Payment</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Customer's Invoices</attribute>
<attribute name="action">GncPluginPageOwnerTreeActions.OTSearchInvoicesAction</attribute>
<attribute name="tooltip" translatable="yes">Customer's Invoices</attribute>
</item>
</section>
</menu>

Expand Down