gnucash maint: Bug 797605 - RFE: Customer/Vendor/Employee Overview should also have "Process Payment" toolbar
Christopher Lam
clam at code.gnucash.org
Tue Apr 14 07:26:44 EDT 2020
Updated via https://github.com/Gnucash/gnucash/commit/695d8b82 (commit)
from https://github.com/Gnucash/gnucash/commit/e01a2a64 (commit)
commit 695d8b820e63e9e55675c87c31a5f4620d0fdfd2
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Mon Apr 13 15:35:35 2020 +0800
Bug 797605 - RFE: Customer/Vendor/Employee Overview should also have "Process Payment" toolbar
diff --git a/gnucash/gnome/gnc-plugin-page-owner-tree.c b/gnucash/gnome/gnc-plugin-page-owner-tree.c
index 83c87186b..76496a989 100644
--- a/gnucash/gnome/gnc-plugin-page-owner-tree.c
+++ b/gnucash/gnome/gnc-plugin-page-owner-tree.c
@@ -46,6 +46,7 @@
#include "dialog-employee.h"
#include "dialog-invoice.h"
#include "dialog-job.h"
+#include "dialog-payment.h"
#include "gncOwner.h"
#include "dialog-utils.h"
@@ -128,6 +129,7 @@ static void gnc_plugin_page_owner_tree_cmd_refresh (GtkAction *action, GncPlugin
static void gnc_plugin_page_owner_tree_cmd_new_invoice (GtkAction *action, GncPluginPageOwnerTree *page);
static void gnc_plugin_page_owner_tree_cmd_owners_report (GtkAction *action, GncPluginPageOwnerTree *plugin_page);
static void gnc_plugin_page_owner_tree_cmd_owner_report (GtkAction *action, GncPluginPageOwnerTree *plugin_page);
+static void gnc_plugin_page_owner_tree_cmd_process_payment (GtkAction *action, GncPluginPageOwnerTree *plugin_page);
static guint plugin_page_signals[LAST_SIGNAL] = { 0 };
@@ -230,6 +232,11 @@ static GtkActionEntry gnc_plugin_page_owner_tree_actions [] =
N_("Show employee report"),
G_CALLBACK (gnc_plugin_page_owner_tree_cmd_owner_report)
},
+ {
+ "OTProcessPaymentAction", GNC_ICON_INVOICE_PAY,
+ N_("Process Payment"), NULL, N_("Process Payment"),
+ G_CALLBACK (gnc_plugin_page_owner_tree_cmd_process_payment)
+ },
};
/** 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);
@@ -242,6 +249,7 @@ static const gchar *actions_requiring_owner_rw[] =
"OTEditVendorAction",
"OTEditCustomerAction",
"OTEditEmployeeAction",
+ "OTProcessPaymentAction",
/* FIXME disabled due to crash "EditDeleteOwnerAction", */
NULL
};
@@ -253,6 +261,7 @@ static const gchar *actions_requiring_owner_always[] =
"OTVendorReportAction",
"OTCustomerReportAction",
"OTEmployeeReportAction",
+ "OTProcessPaymentAction",
NULL
};
@@ -265,6 +274,7 @@ static const gchar* readonly_inactive_actions[] =
"OTNewBillAction",
"OTNewInvoiceAction",
"OTNewVoucherAction",
+ "OTProcessPaymentAction",
NULL
};
@@ -283,6 +293,7 @@ static action_toolbar_labels toolbar_labels[] =
{ "OTNewVoucherAction", N_("New Voucher") },
{ "OTVendorListingReportAction", N_("Vendor Listing") },
{ "OTCustomerListingReportAction", N_("Customer Listing") },
+ { "OTProcessPaymentAction", N_("Process Payment") },
/* FIXME disable due to crash { "EditDeleteOwnerAction", N_("Delete") },*/
{ NULL, NULL },
};
@@ -1244,5 +1255,20 @@ gnc_plugin_page_owner_tree_cmd_owner_report (GtkAction *action,
LEAVE(" ");
}
+
+static void
+gnc_plugin_page_owner_tree_cmd_process_payment (GtkAction *action,
+ GncPluginPageOwnerTree *plugin_page)
+{
+ ENTER("(action %p, plugin_page %p)", action, plugin_page);
+
+ g_return_if_fail(GNC_IS_PLUGIN_PAGE_OWNER_TREE(plugin_page));
+
+ gnc_ui_payment_new (GTK_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window),
+ gnc_plugin_page_owner_tree_get_current_owner (plugin_page),
+ gnc_get_current_book ());
+
+ LEAVE(" ");
+}
/** @} */
/** @} */
diff --git a/gnucash/ui/gnc-plugin-page-owner-tree-ui.xml b/gnucash/ui/gnc-plugin-page-owner-tree-ui.xml
index 64d08d90c..5a577a80f 100644
--- a/gnucash/ui/gnc-plugin-page-owner-tree-ui.xml
+++ b/gnucash/ui/gnc-plugin-page-owner-tree-ui.xml
@@ -38,6 +38,7 @@
<toolitem name="ToolbarNewVoucher" action="OTNewVoucherAction"/>
<toolitem name="ToolbarVendorListing" action="OTVendorListingReportAction"/>
<toolitem name="ToolbarCustomerListing" action="OTCustomerListingReportAction"/>
+ <toolitem name="ToolbarProcessPayment" action="OTProcessPaymentAction"/>
</placeholder>
</toolbar>
@@ -54,6 +55,7 @@
<menuitem name="OTVendorReport" action="OTVendorReportAction"/>
<menuitem name="OTCustomerReport" action="OTCustomerReportAction"/>
<menuitem name="OTEmployeeReport" action="OTEmployeeReportAction"/>
+ <menuitem name="ProcessPayment" action="OTProcessPaymentAction"/>
</placeholder>
</popup>
</ui>
Summary of changes:
gnucash/gnome/gnc-plugin-page-owner-tree.c | 26 ++++++++++++++++++++++++++
gnucash/ui/gnc-plugin-page-owner-tree-ui.xml | 2 ++
2 files changed, 28 insertions(+)
More information about the gnucash-changes
mailing list