mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
* fill out the Invoice Window Menu, based upon the Register
Window. Fill in the callbacks required to get the menu to work. * Create a hook into the "owner-report" and link that into the Invoice Window, so you can print the report from any Invoice. * add a hook in the entry ledger to obtain the current Query (to set the sort order). git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7075 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -9,6 +9,15 @@
|
||||
menu in glade.
|
||||
|
||||
* add a menubar to the Invoice Window in glade
|
||||
|
||||
* fill out the Invoice Window Menu, based upon the Register
|
||||
Window. Fill in the callbacks required to get the menu to work.
|
||||
|
||||
* Create a hook into the "owner-report" and link that into the
|
||||
Invoice Window, so you can print the report from any Invoice.
|
||||
|
||||
* add a hook in the entry ledger to obtain the current Query (to
|
||||
set the sort order).
|
||||
|
||||
2002-07-01 Derek Atkins <derek@ihtfp.com>
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ AM_CFLAGS = \
|
||||
-I${top_srcdir}/src/report/report-gnome \
|
||||
-I${top_srcdir}/src/business/business-core \
|
||||
-I${top_srcdir}/src/business/business-ledger \
|
||||
-I${top_srcdir}/src/business/dialog-tax-table \
|
||||
${GNOME_PRINT_CFLAGS} \
|
||||
${GNOME_INCLUDEDIR} \
|
||||
${GLADE_CFLAGS} \
|
||||
|
||||
@@ -36,6 +36,9 @@
|
||||
#include "dialog-job.h"
|
||||
#include "business-utils.h"
|
||||
#include "dialog-payment.h"
|
||||
#include "dialog-tax-table.h"
|
||||
#include "dialog-billterms.h"
|
||||
#include "AccWindow.h"
|
||||
|
||||
#define DIALOG_NEW_INVOICE_CM_CLASS "dialog-new-invoice"
|
||||
#define DIALOG_VIEW_INVOICE_CM_CLASS "dialog-view-invoice"
|
||||
@@ -48,6 +51,16 @@ typedef enum
|
||||
VIEW_INVOICE
|
||||
} InvoiceDialogType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
BY_STANDARD = 0,
|
||||
BY_DATE,
|
||||
BY_DATE_ENTERED,
|
||||
BY_DESC,
|
||||
BY_QTY,
|
||||
BY_PRICE
|
||||
} sort_type_t;
|
||||
|
||||
struct _invoice_select_window {
|
||||
GNCBook * book;
|
||||
GncOwner * owner;
|
||||
@@ -60,8 +73,6 @@ struct _invoice_window {
|
||||
|
||||
GtkWidget * dialog;
|
||||
|
||||
GtkWidget * menubar_dock;
|
||||
GtkWidget * menubar;
|
||||
GtkWidget * statusbar;
|
||||
|
||||
/* Popup Menu */
|
||||
@@ -78,6 +89,13 @@ struct _invoice_window {
|
||||
GtkWidget * print_button;
|
||||
GtkWidget * post_button;
|
||||
|
||||
/* Menu Widgets */
|
||||
GtkWidget * menu_print;
|
||||
GtkWidget * menu_cut;
|
||||
GtkWidget * menu_paste;
|
||||
GtkWidget * menu_edit_invoice;
|
||||
GtkWidget * menu_actions;
|
||||
|
||||
/* Data Widgets */
|
||||
GtkWidget * id_entry;
|
||||
GtkWidget * notes_text;
|
||||
@@ -100,6 +118,8 @@ struct _invoice_window {
|
||||
GnucashRegister * reg;
|
||||
GncEntryLedger * ledger;
|
||||
|
||||
sort_type_t last_sort;
|
||||
|
||||
InvoiceDialogType dialog_type;
|
||||
GUID invoice_guid;
|
||||
gint component_id;
|
||||
@@ -121,6 +141,27 @@ void gnc_invoice_window_blankCB (GtkWidget *widget, gpointer data);
|
||||
void gnc_invoice_window_printCB (GtkWidget *widget, gpointer data);
|
||||
void gnc_invoice_window_postCB (GtkWidget *widget, gpointer data);
|
||||
|
||||
void gnc_invoice_window_cut_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_invoice_window_copy_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_invoice_window_paste_cb (GtkWidget *widget, gpointer data);
|
||||
|
||||
void gnc_invoice_window_new_account_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_invoice_window_new_invoice_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_invoice_window_report_owner_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_invoice_window_taxtable_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_invoice_window_billterm_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_invoice_window_payment_cb (GtkWidget *widget, gpointer data);
|
||||
|
||||
void gnc_invoice_window_sort_standard_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_invoice_window_sort_date_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_invoice_window_sort_date_entered_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_invoice_window_sort_description_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_invoice_window_sort_quantity_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_invoice_window_sort_price_cb (GtkWidget *widget, gpointer data);
|
||||
|
||||
void gnc_invoice_window_toolbar_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_invoice_window_statusbar_cb (GtkWidget *widget, gpointer data);
|
||||
|
||||
#define WIDTH_PREFIX "invoice_reg"
|
||||
static int last_width = 0;
|
||||
|
||||
@@ -503,6 +544,210 @@ gnc_invoice_window_postCB (GtkWidget *widget, gpointer data)
|
||||
gnc_table_refresh_gui (gnc_entry_ledger_get_table (iw->ledger), TRUE);
|
||||
}
|
||||
|
||||
void gnc_invoice_window_cut_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
InvoiceWindow *iw = data;
|
||||
gnucash_register_cut_clipboard (iw->reg);
|
||||
}
|
||||
|
||||
void gnc_invoice_window_copy_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
InvoiceWindow *iw = data;
|
||||
gnucash_register_copy_clipboard (iw->reg);
|
||||
}
|
||||
|
||||
void gnc_invoice_window_paste_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
InvoiceWindow *iw = data;
|
||||
gnucash_register_paste_clipboard (iw->reg);
|
||||
}
|
||||
|
||||
void gnc_invoice_window_new_account_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
gnc_ui_new_account_window (NULL);
|
||||
}
|
||||
|
||||
void gnc_invoice_window_new_invoice_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
InvoiceWindow *iw = data;
|
||||
if (gncOwnerGetJob (&iw->job)) {
|
||||
gnc_ui_invoice_new (&iw->job, iw->book);
|
||||
} else {
|
||||
gnc_ui_invoice_new (&iw->owner, iw->book);
|
||||
}
|
||||
}
|
||||
|
||||
void gnc_invoice_window_report_owner_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
InvoiceWindow *iw = data;
|
||||
int id;
|
||||
SCM qtype;
|
||||
SCM args;
|
||||
SCM func;
|
||||
SCM arg;
|
||||
|
||||
args = SCM_EOL;
|
||||
|
||||
func = gh_eval_str ("gnc:owner-report-create");
|
||||
g_return_if_fail (gh_procedure_p (func));
|
||||
|
||||
qtype = gh_eval_str("<gnc:GncOwner*>");
|
||||
g_return_if_fail (qtype != SCM_UNDEFINED);
|
||||
|
||||
arg = gw_wcp_assimilate_ptr (&iw->owner, qtype);
|
||||
g_return_if_fail (arg != SCM_UNDEFINED);
|
||||
|
||||
args = gh_cons (SCM_BOOL_F, args);
|
||||
args = gh_cons (arg, args);
|
||||
|
||||
/* Apply the function to the args */
|
||||
arg = gh_apply (func, args);
|
||||
g_return_if_fail (gh_exact_p (arg));
|
||||
id = gh_scm2int (arg);
|
||||
|
||||
if (id >= 0)
|
||||
reportWindow (id);
|
||||
}
|
||||
|
||||
void gnc_invoice_window_taxtable_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
InvoiceWindow *iw = data;
|
||||
gnc_ui_tax_table_window_new (iw->book);
|
||||
}
|
||||
|
||||
void gnc_invoice_window_billterm_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
InvoiceWindow *iw = data;
|
||||
gnc_ui_billterms_window_new (iw->book);
|
||||
}
|
||||
|
||||
void gnc_invoice_window_payment_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
InvoiceWindow *iw = data;
|
||||
if (gncOwnerGetJob (&iw->job))
|
||||
gnc_ui_payment_new (&iw->job, iw->book);
|
||||
else
|
||||
gnc_ui_payment_new (&iw->owner, iw->book);
|
||||
}
|
||||
|
||||
/* Sorting callbacks */
|
||||
|
||||
static void
|
||||
gnc_invoice_window_sort (InvoiceWindow *iw, sort_type_t sort_code)
|
||||
{
|
||||
QueryNew *query = gnc_entry_ledger_get_query (iw->ledger);
|
||||
GSList *p1 = NULL, *p2 = NULL, *p3 = NULL, *standard;
|
||||
|
||||
if (iw->last_sort == sort_code)
|
||||
return;
|
||||
|
||||
standard = g_slist_prepend (NULL, QUERY_DEFAULT_SORT);
|
||||
|
||||
switch (sort_code)
|
||||
{
|
||||
case BY_STANDARD:
|
||||
p1 = standard;
|
||||
break;
|
||||
case BY_DATE:
|
||||
p1 = g_slist_prepend (p1, ENTRY_DATE);
|
||||
p2 = standard;
|
||||
break;
|
||||
case BY_DATE_ENTERED:
|
||||
p1 = g_slist_prepend (p1, ENTRY_DATE_ENTERED);
|
||||
p2 = standard;
|
||||
break;
|
||||
case BY_DESC:
|
||||
p1 = g_slist_prepend (p1, ENTRY_DESC);
|
||||
p2 = standard;
|
||||
break;
|
||||
case BY_QTY:
|
||||
p1 = g_slist_prepend (p1, ENTRY_QTY);
|
||||
p2 = standard;
|
||||
break;
|
||||
case BY_PRICE:
|
||||
p1 = g_slist_prepend (p1, ENTRY_PRICE);
|
||||
p2 = standard;
|
||||
break;
|
||||
default:
|
||||
g_slist_free (standard);
|
||||
g_return_if_fail (FALSE);
|
||||
}
|
||||
|
||||
gncQuerySetSortOrder (query, p1, p2, p3);
|
||||
iw->last_sort = sort_code;
|
||||
gnc_entry_ledger_display_refresh (iw->ledger);
|
||||
}
|
||||
|
||||
void
|
||||
gnc_invoice_window_sort_standard_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
InvoiceWindow *iw = data;
|
||||
gnc_invoice_window_sort (iw, BY_STANDARD);
|
||||
}
|
||||
|
||||
void
|
||||
gnc_invoice_window_sort_date_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
InvoiceWindow *iw = data;
|
||||
gnc_invoice_window_sort (iw, BY_DATE);
|
||||
}
|
||||
|
||||
void
|
||||
gnc_invoice_window_sort_date_entered_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
InvoiceWindow *iw = data;
|
||||
gnc_invoice_window_sort (iw, BY_DATE_ENTERED);
|
||||
}
|
||||
|
||||
void
|
||||
gnc_invoice_window_sort_description_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
InvoiceWindow *iw = data;
|
||||
gnc_invoice_window_sort (iw, BY_DESC);
|
||||
}
|
||||
|
||||
void
|
||||
gnc_invoice_window_sort_quantity_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
InvoiceWindow *iw = data;
|
||||
gnc_invoice_window_sort (iw, BY_QTY);
|
||||
}
|
||||
|
||||
void
|
||||
gnc_invoice_window_sort_price_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
InvoiceWindow *iw = data;
|
||||
gnc_invoice_window_sort (iw, BY_PRICE);
|
||||
}
|
||||
|
||||
/* Window configuration callbacks */
|
||||
|
||||
void gnc_invoice_window_toolbar_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
InvoiceWindow *iw = data;
|
||||
GtkCheckMenuItem *checkmenu = GTK_CHECK_MENU_ITEM(widget);
|
||||
|
||||
if (checkmenu->active) {
|
||||
gtk_widget_show(iw->toolbar_dock);
|
||||
} else {
|
||||
gtk_widget_hide(iw->toolbar_dock);
|
||||
gtk_widget_queue_resize(iw->toolbar_dock);
|
||||
}
|
||||
}
|
||||
|
||||
void gnc_invoice_window_statusbar_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
InvoiceWindow *iw = data;
|
||||
GtkCheckMenuItem *checkmenu = GTK_CHECK_MENU_ITEM(widget);
|
||||
|
||||
if (checkmenu->active) {
|
||||
gtk_widget_show(iw->statusbar);
|
||||
} else {
|
||||
gtk_widget_hide(iw->statusbar);
|
||||
gtk_widget_queue_resize(iw->statusbar);
|
||||
}
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
gnc_invoice_window_create_popup_menu (InvoiceWindow *iw)
|
||||
{
|
||||
@@ -959,6 +1204,7 @@ gnc_invoice_update_window (InvoiceWindow *iw)
|
||||
}
|
||||
}
|
||||
|
||||
/* Set the toolbar widgets sensitivity */
|
||||
gtk_widget_set_sensitive (iw->edit_button, !is_posted);
|
||||
gtk_widget_set_sensitive (iw->enter_button, !is_posted);
|
||||
gtk_widget_set_sensitive (iw->cancel_button, !is_posted);
|
||||
@@ -968,6 +1214,13 @@ gnc_invoice_update_window (InvoiceWindow *iw)
|
||||
gtk_widget_set_sensitive (iw->print_button, is_posted);
|
||||
gtk_widget_set_sensitive (iw->post_button, !is_posted);
|
||||
|
||||
/* Set the menubar widgets sensitivity */
|
||||
gtk_widget_set_sensitive (iw->menu_print, is_posted);
|
||||
gtk_widget_set_sensitive (iw->menu_cut, !is_posted);
|
||||
gtk_widget_set_sensitive (iw->menu_paste, !is_posted);
|
||||
gtk_widget_set_sensitive (iw->menu_edit_invoice, !is_posted);
|
||||
gtk_widget_set_sensitive (iw->menu_actions, !is_posted);
|
||||
|
||||
if (is_posted) {
|
||||
// GtkWidget *hide;
|
||||
|
||||
@@ -1098,9 +1351,12 @@ gnc_invoice_new_window (GNCBook *bookp, InvoiceDialogType type,
|
||||
iw->print_button = glade_xml_get_widget (xml, "print_button");
|
||||
iw->post_button = glade_xml_get_widget (xml, "post_button");
|
||||
|
||||
/* grab the menubar widgets */
|
||||
iw->menubar_dock = glade_xml_get_widget (xml, "menu_dock");
|
||||
iw->menubar = glade_xml_get_widget (xml, "menubar1");
|
||||
/* grab the menu widgets */
|
||||
iw->menu_print = glade_xml_get_widget (xml, "menu_print");
|
||||
iw->menu_cut = glade_xml_get_widget (xml, "menu_cut");
|
||||
iw->menu_paste = glade_xml_get_widget (xml, "menu_paste");
|
||||
iw->menu_edit_invoice = glade_xml_get_widget (xml, "menu_edit_invoice");
|
||||
iw->menu_actions = glade_xml_get_widget (xml, "menu_actions");
|
||||
|
||||
/* grab the statusbar */
|
||||
iw->statusbar = glade_xml_get_widget (xml, "status_bar");
|
||||
|
||||
@@ -427,7 +427,7 @@
|
||||
<modal>False</modal>
|
||||
<allow_shrink>True</allow_shrink>
|
||||
<allow_grow>True</allow_grow>
|
||||
<auto_shrink>False</auto_shrink>
|
||||
<auto_shrink>True</auto_shrink>
|
||||
<enable_layout_config>False</enable_layout_config>
|
||||
|
||||
<widget>
|
||||
@@ -459,13 +459,603 @@
|
||||
<widget>
|
||||
<class>GtkMenuBar</class>
|
||||
<name>menubar1</name>
|
||||
<shadow_type>GTK_SHADOW_OUT</shadow_type>
|
||||
<shadow_type>GTK_SHADOW_NONE</shadow_type>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>placeholder1</name>
|
||||
<label>PlaceHolder</label>
|
||||
<name>menu_file</name>
|
||||
<stock_item>GNOMEUIINFO_MENU_FILE_TREE</stock_item>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenu</class>
|
||||
<name>menu_file_menu</name>
|
||||
|
||||
<widget>
|
||||
<class>GtkPixmapMenuItem</class>
|
||||
<name>menu_new_invoice</name>
|
||||
<tooltip>Create a new invoice</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_new_invoice_cb</handler>
|
||||
<last_modification_time>Wed, 12 Jun 2002 05:41:11 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_New Invoice</label>
|
||||
<right_justify>False</right_justify>
|
||||
<stock_icon>GNOME_STOCK_MENU_NEW</stock_icon>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkPixmapMenuItem</class>
|
||||
<name>menu_new_account</name>
|
||||
<tooltip>Create a new Account</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_new_account_cb</handler>
|
||||
<last_modification_time>Tue, 02 Jul 2002 20:55:21 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>New Account</label>
|
||||
<right_justify>False</right_justify>
|
||||
<stock_icon>GNOME_STOCK_MENU_NEW</stock_icon>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>separator10</name>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkPixmapMenuItem</class>
|
||||
<name>menu_save</name>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_main_window_file_save_cb</handler>
|
||||
<last_modification_time>Sun, 16 Jun 2002 17:35:28 GMT</last_modification_time>
|
||||
</signal>
|
||||
<stock_item>GNOMEUIINFO_MENU_SAVE_ITEM</stock_item>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkPixmapMenuItem</class>
|
||||
<name>menu_saveas</name>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_main_window_file_save_as_cb</handler>
|
||||
<last_modification_time>Sun, 16 Jun 2002 17:35:28 GMT</last_modification_time>
|
||||
</signal>
|
||||
<stock_item>GNOMEUIINFO_MENU_SAVE_AS_ITEM</stock_item>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>separator12</name>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkPixmapMenuItem</class>
|
||||
<name>menu_print</name>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_printCB</handler>
|
||||
<last_modification_time>Wed, 12 Jun 2002 06:07:26 GMT</last_modification_time>
|
||||
</signal>
|
||||
<stock_item>GNOMEUIINFO_MENU_PRINT_ITEM</stock_item>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>separator1</name>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkPixmapMenuItem</class>
|
||||
<name>menu_close</name>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_closeCB</handler>
|
||||
<last_modification_time>Wed, 12 Jun 2002 01:59:32 GMT</last_modification_time>
|
||||
</signal>
|
||||
<stock_item>GNOMEUIINFO_MENU_CLOSE_ITEM</stock_item>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkPixmapMenuItem</class>
|
||||
<name>menu_exit</name>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_main_window_exit_cb</handler>
|
||||
<last_modification_time>Wed, 12 Jun 2002 05:55:04 GMT</last_modification_time>
|
||||
</signal>
|
||||
<stock_item>GNOMEUIINFO_MENU_EXIT_ITEM</stock_item>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_edit</name>
|
||||
<stock_item>GNOMEUIINFO_MENU_EDIT_TREE</stock_item>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenu</class>
|
||||
<name>menu_edit_menu</name>
|
||||
|
||||
<widget>
|
||||
<class>GtkPixmapMenuItem</class>
|
||||
<name>menu_cut</name>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_cut_cb</handler>
|
||||
<last_modification_time>Sun, 16 Jun 2002 17:35:28 GMT</last_modification_time>
|
||||
</signal>
|
||||
<stock_item>GNOMEUIINFO_MENU_CUT_ITEM</stock_item>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkPixmapMenuItem</class>
|
||||
<name>menu_copy</name>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_copy_cb</handler>
|
||||
<last_modification_time>Sun, 16 Jun 2002 17:35:28 GMT</last_modification_time>
|
||||
</signal>
|
||||
<stock_item>GNOMEUIINFO_MENU_COPY_ITEM</stock_item>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkPixmapMenuItem</class>
|
||||
<name>menu_paste</name>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_paste_cb</handler>
|
||||
<last_modification_time>Sun, 16 Jun 2002 17:35:28 GMT</last_modification_time>
|
||||
</signal>
|
||||
<stock_item>GNOMEUIINFO_MENU_PASTE_ITEM</stock_item>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>separator13</name>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_edit_invoice</name>
|
||||
<tooltip>Edit this Invoice</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_editCB</handler>
|
||||
<last_modification_time>Wed, 12 Jun 2002 05:42:08 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Edit Invoice</label>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>separator11</name>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_view</name>
|
||||
<stock_item>GNOMEUIINFO_MENU_VIEW_TREE</stock_item>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenu</class>
|
||||
<name>menu_view_menu</name>
|
||||
|
||||
<widget>
|
||||
<class>GtkCheckMenuItem</class>
|
||||
<name>menu_toolbar</name>
|
||||
<tooltip>Display the toolbar</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_toolbar_cb</handler>
|
||||
<last_modification_time>Wed, 12 Jun 2002 05:55:04 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Toolbar</label>
|
||||
<active>True</active>
|
||||
<always_show_toggle>True</always_show_toggle>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkCheckMenuItem</class>
|
||||
<name>menu_status_bar</name>
|
||||
<tooltip>Display the Status Bar</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_statusbar_cb</handler>
|
||||
<last_modification_time>Wed, 12 Jun 2002 06:03:51 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Status Bar</label>
|
||||
<active>True</active>
|
||||
<always_show_toggle>True</always_show_toggle>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>separator4</name>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_sort_order</name>
|
||||
<label>Sort _Order</label>
|
||||
<right_justify>False</right_justify>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenu</class>
|
||||
<name>menu_sort_order_menu</name>
|
||||
|
||||
<widget>
|
||||
<class>GtkRadioMenuItem</class>
|
||||
<name>menu_sort_standard</name>
|
||||
<tooltip>Keep normal invoice order</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_sort_standard_cb</handler>
|
||||
<last_modification_time>Wed, 12 Jun 2002 02:13:24 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Standard</label>
|
||||
<active>False</active>
|
||||
<always_show_toggle>True</always_show_toggle>
|
||||
<group>sort</group>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>separator5</name>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkRadioMenuItem</class>
|
||||
<name>menu_sort_date</name>
|
||||
<tooltip>Sort by date</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_sort_date_cb</handler>
|
||||
<last_modification_time>Wed, 12 Jun 2002 02:13:24 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Date</label>
|
||||
<active>False</active>
|
||||
<always_show_toggle>True</always_show_toggle>
|
||||
<group>sort</group>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkRadioMenuItem</class>
|
||||
<name>menu_sort_date_of_entry</name>
|
||||
<tooltip>Sort by the date of entry</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_sort_date_entered_cb</handler>
|
||||
<last_modification_time>Wed, 12 Jun 2002 02:13:24 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>Date of _Entry</label>
|
||||
<active>False</active>
|
||||
<always_show_toggle>True</always_show_toggle>
|
||||
<group>sort</group>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkRadioMenuItem</class>
|
||||
<name>menu_sort_quantity</name>
|
||||
<tooltip>Sort by quantity</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_sort_quantity_cb</handler>
|
||||
<last_modification_time>Wed, 12 Jun 2002 02:13:24 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Quantity</label>
|
||||
<active>False</active>
|
||||
<always_show_toggle>True</always_show_toggle>
|
||||
<group>sort</group>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkRadioMenuItem</class>
|
||||
<name>menu_price_quantity</name>
|
||||
<tooltip>Sort by price</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_sort_price_cb</handler>
|
||||
<last_modification_time>Wed, 12 Jun 2002 02:13:24 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Price</label>
|
||||
<active>False</active>
|
||||
<always_show_toggle>True</always_show_toggle>
|
||||
<group>sort</group>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkRadioMenuItem</class>
|
||||
<name>menu_sort_description</name>
|
||||
<tooltip>Sort by description</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_sort_description_cb</handler>
|
||||
<last_modification_time>Wed, 12 Jun 2002 02:13:24 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Description</label>
|
||||
<active>True</active>
|
||||
<always_show_toggle>True</always_show_toggle>
|
||||
<group>sort</group>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_actions</name>
|
||||
<label>_Actions</label>
|
||||
<right_justify>False</right_justify>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenu</class>
|
||||
<name>menu_actions_menu</name>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_enter</name>
|
||||
<tooltip>Record the current entry</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_recordCB</handler>
|
||||
<last_modification_time>Wed, 12 Jun 2002 02:01:51 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Enter</label>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_cancel</name>
|
||||
<tooltip>Cancel the current entry</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_cancelCB</handler>
|
||||
<last_modification_time>Wed, 12 Jun 2002 06:10:40 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Cancel</label>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_delete</name>
|
||||
<tooltip>Delete the current entry</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_deleteCB</handler>
|
||||
<last_modification_time>Tue, 18 Jun 2002 07:59:59 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Delete</label>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>separator8</name>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_duplicate</name>
|
||||
<tooltip>Make a copy of the current entry</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_duplicateCB</handler>
|
||||
<last_modification_time>Sun, 16 Jun 2002 00:14:37 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>Dup_licate</label>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_blank</name>
|
||||
<tooltip>Move to the blank entry at the bottom of the Invoice</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_blankCB</handler>
|
||||
<last_modification_time>Wed, 12 Jun 2002 06:13:45 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Blank</label>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_reports</name>
|
||||
<label>_Reports</label>
|
||||
<right_justify>False</right_justify>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenu</class>
|
||||
<name>menu_reports_menu</name>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_report_owner</name>
|
||||
<tooltip>Open a company report window for the owner of this Invoice</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_report_owner_cb</handler>
|
||||
<last_modification_time>Sun, 16 Jun 2002 17:31:17 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Company Report</label>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_tools</name>
|
||||
<label>_Tools</label>
|
||||
<right_justify>False</right_justify>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenu</class>
|
||||
<name>menu_tools_menu</name>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_general_ledger</name>
|
||||
<tooltip>Open a general ledger window</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_main_window_gl_cb</handler>
|
||||
<last_modification_time>Wed, 12 Jun 2002 06:22:56 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_General Ledger</label>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_price_editor</name>
|
||||
<tooltip>View and edit the prices for stocks and mutual funds</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_main_window_prices_cb</handler>
|
||||
<last_modification_time>Wed, 12 Jun 2002 06:22:56 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Price Editor</label>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_commodity_editor</name>
|
||||
<tooltip>View and edit the commodities for stocks and mutual funds</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_main_window_commodities_cb</handler>
|
||||
<last_modification_time>Wed, 12 Jun 2002 06:22:56 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Commodity Editor</label>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_fincalc</name>
|
||||
<tooltip>Use the financial calculator</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_main_window_fincalc_cb</handler>
|
||||
<last_modification_time>Wed, 12 Jun 2002 06:22:56 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Financial Calculator</label>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_taxtable</name>
|
||||
<tooltip>View and edit the list of Tax Tables</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_taxtable_cb</handler>
|
||||
<last_modification_time>Tue, 02 Jul 2002 20:55:22 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Tax Table Editor</label>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_billterm</name>
|
||||
<tooltip>View and edit the list of Billing Terms</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_billterm_cb</handler>
|
||||
<last_modification_time>Tue, 02 Jul 2002 20:55:22 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Billing Terms Editor</label>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_payment</name>
|
||||
<tooltip>Enter a payment for the owner of this Invoice</tooltip>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_invoice_window_payment_cb</handler>
|
||||
<last_modification_time>Tue, 02 Jul 2002 20:55:22 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>Process Pa_yment</label>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_help</name>
|
||||
<stock_item>GNOMEUIINFO_MENU_HELP_TREE</stock_item>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenu</class>
|
||||
<name>menu_help_menu</name>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_manual</name>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_main_window_help_cb</handler>
|
||||
<last_modification_time>Wed, 12 Jun 2002 01:57:06 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Gnucash Users Manual</label>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>menu_totd</name>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_main_window_totd_cb</handler>
|
||||
<last_modification_time>Wed, 12 Jun 2002 01:57:06 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>_Tip Of The Day</label>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkMenuItem</class>
|
||||
<name>separator9</name>
|
||||
<right_justify>False</right_justify>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkPixmapMenuItem</class>
|
||||
<name>menu_about</name>
|
||||
<signal>
|
||||
<name>activate</name>
|
||||
<handler>gnc_main_window_about_cb</handler>
|
||||
<last_modification_time>Sun, 16 Jun 2002 01:12:45 GMT</last_modification_time>
|
||||
</signal>
|
||||
<stock_item>GNOMEUIINFO_MENU_ABOUT_ITEM</stock_item>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
@@ -487,13 +1077,13 @@
|
||||
|
||||
<widget>
|
||||
<class>GtkToolbar</class>
|
||||
<name>toolbar1</name>
|
||||
<name>toolbar</name>
|
||||
<border_width>2</border_width>
|
||||
<orientation>GTK_ORIENTATION_HORIZONTAL</orientation>
|
||||
<type>GTK_TOOLBAR_BOTH</type>
|
||||
<space_size>5</space_size>
|
||||
<space_size>10</space_size>
|
||||
<space_style>GTK_TOOLBAR_SPACE_LINE</space_style>
|
||||
<relief>GTK_RELIEF_NORMAL</relief>
|
||||
<relief>GTK_RELIEF_NONE</relief>
|
||||
<tooltips>True</tooltips>
|
||||
|
||||
<widget>
|
||||
|
||||
@@ -646,3 +646,12 @@ gnc_entry_ledger_duplicate_current_entry (GncEntryLedger *ledger)
|
||||
gnc_resume_gui_refresh ();
|
||||
return;
|
||||
}
|
||||
|
||||
QueryNew *
|
||||
gnc_entry_ledger_get_query (GncEntryLedger *ledger)
|
||||
{
|
||||
if (!ledger)
|
||||
return NULL;
|
||||
|
||||
return ledger->query;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#ifndef GNC_ENTRY_LEDGER_H
|
||||
#define GNC_ENTRY_LEDGER_H
|
||||
|
||||
#include "QueryNew.h"
|
||||
#include "gncEntry.h"
|
||||
#include "gncOrder.h"
|
||||
#include "gnc-book.h"
|
||||
@@ -104,4 +105,6 @@ gboolean gnc_entry_ledger_get_entry_virt_loc (GncEntryLedger *ledger,
|
||||
void gnc_entry_ledger_delete_current_entry (GncEntryLedger *ledger);
|
||||
void gnc_entry_ledger_duplicate_current_entry (GncEntryLedger *ledger);
|
||||
|
||||
QueryNew * gnc_entry_ledger_get_query (GncEntryLedger *ledger);
|
||||
|
||||
#endif /* GNC_ENTRY_LEDGER_H */
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "guid.h"
|
||||
#include "gnc-book.h"
|
||||
#include "table-allgui.h"
|
||||
#include "QueryNew.h"
|
||||
#include "gncEntryLedger.h"
|
||||
|
||||
struct GncEntryLedger_s {
|
||||
|
||||
@@ -15,3 +15,5 @@
|
||||
(use-modules (gnucash report owner-report))
|
||||
|
||||
(define gnc:invoice-report-create gnc:invoice-report-create-internal)
|
||||
|
||||
(export gnc:owner-report-create)
|
||||
|
||||
@@ -446,6 +446,39 @@
|
||||
|
||||
document))
|
||||
|
||||
(define (find-first-account type)
|
||||
(define (find-first group num index)
|
||||
(if (>= index num)
|
||||
#f
|
||||
(let* ((this-account (gnc:group-get-account group index))
|
||||
(account-type (gw:enum-<gnc:AccountType>-val->sym
|
||||
(gnc:account-get-type this-account) #f)))
|
||||
(if (eq? account-type type)
|
||||
this-account
|
||||
(find-first group num (+ index 1))))))
|
||||
|
||||
(let* ((current-group (gnc:get-current-group))
|
||||
(num-accounts (gnc:group-get-num-accounts
|
||||
current-group)))
|
||||
(if (> num-accounts 0)
|
||||
(find-first current-group num-accounts 0)
|
||||
#f)))
|
||||
|
||||
(define (find-first-account-for-owner owner)
|
||||
(let ((type (gw:enum-<gnc:GncOwnerType>-val->sym
|
||||
(gnc:owner-get-type (gnc:owner-get-end-owner owner)) #f)))
|
||||
(case type
|
||||
((gnc-owner-customer)
|
||||
(find-first-account 'receivable))
|
||||
|
||||
((gnc-owner-vendor)
|
||||
(find-first-account 'payable))
|
||||
|
||||
((gnc-owner-job)
|
||||
(find-first-account-for-owner (gnc:owner-get-end-owner owner)))
|
||||
|
||||
(else
|
||||
#f))))
|
||||
|
||||
(gnc:define-report
|
||||
'version 1
|
||||
@@ -483,6 +516,37 @@
|
||||
(owner-report-create-internal "Vendor Report" owner query account)))
|
||||
))
|
||||
|
||||
(define (gnc:owner-report-create owner account)
|
||||
(let* ((q (gnc:malloc-query))
|
||||
(guid (gnc:owner-get-guid (gnc:owner-get-end-owner owner))))
|
||||
|
||||
; Figure out an account to use if nothing exists here.
|
||||
(if (not account)
|
||||
(set! account (find-first-account-for-owner owner)))
|
||||
|
||||
(gnc:query-add-guid-match
|
||||
q
|
||||
(list gnc:split-trans gnc:invoice-from-txn gnc:invoice-owner
|
||||
gnc:owner-parentg)
|
||||
guid 'query-or)
|
||||
(gnc:query-add-guid-match
|
||||
q
|
||||
(list gnc:split-lot gnc:owner-from-lot gnc:owner-parentg)
|
||||
guid 'query-or)
|
||||
(gnc:query-add-guid-match
|
||||
q
|
||||
(list gnc:split-lot gnc:invoice-from-lot gnc:invoice-owner
|
||||
gnc:owner-parentg)
|
||||
guid 'query-or)
|
||||
|
||||
(gnc:query-add-single-account-match q account 'query-and)
|
||||
(gnc:query-set-book q (gnc:get-current-book))
|
||||
|
||||
(let ((res (owner-report-create owner q account)))
|
||||
(gnc:free-query q)
|
||||
res)))
|
||||
|
||||
|
||||
(define (gnc:owner-report-create-internal
|
||||
account split query journal? double? title
|
||||
debit-string credit-string)
|
||||
@@ -490,7 +554,6 @@
|
||||
(let* ((trans (gnc:split-get-parent split))
|
||||
(invoice (gnc:invoice-get-invoice-from-txn trans))
|
||||
(temp-owner (gnc:owner-create))
|
||||
(q (gnc:malloc-query))
|
||||
(owner #f))
|
||||
|
||||
(if invoice
|
||||
@@ -511,33 +574,15 @@
|
||||
(check-splits (cdr splits)))))
|
||||
(check-splits split-list)))
|
||||
|
||||
(let ((guid (gnc:owner-get-guid (gnc:owner-get-end-owner owner))))
|
||||
(gnc:query-add-guid-match
|
||||
q
|
||||
(list gnc:split-trans gnc:invoice-from-txn gnc:invoice-owner
|
||||
gnc:owner-parentg)
|
||||
guid 'query-or)
|
||||
(gnc:query-add-guid-match
|
||||
q
|
||||
(list gnc:split-lot gnc:owner-from-lot gnc:owner-parentg)
|
||||
guid 'query-or)
|
||||
(gnc:query-add-guid-match
|
||||
q
|
||||
(list gnc:split-lot gnc:invoice-from-lot gnc:invoice-owner
|
||||
gnc:owner-parentg)
|
||||
guid 'query-or)
|
||||
)
|
||||
|
||||
(gnc:query-add-single-account-match q account 'query-and)
|
||||
(gnc:query-set-book q (gnc:get-current-book))
|
||||
|
||||
(let ((res (owner-report-create owner q account)))
|
||||
(let ((res (gnc:owner-report-create owner account)))
|
||||
(gnc:owner-destroy temp-owner)
|
||||
(gnc:free-query q)
|
||||
res)))
|
||||
|
||||
|
||||
(gnc:register-report-hook 'receivable #t
|
||||
gnc:owner-report-create-internal)
|
||||
|
||||
(gnc:register-report-hook 'payable #t
|
||||
gnc:owner-report-create-internal)
|
||||
|
||||
(export gnc:owner-report-create)
|
||||
|
||||
Reference in New Issue
Block a user