mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Robert Graham Merkel's transaction report patch.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2255 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
32e2654774
commit
82178560d4
@ -1,3 +1,10 @@
|
|||||||
|
2000-05-02 Robert Graham Merkel <rgmerk@mira.net>
|
||||||
|
|
||||||
|
* man/gnc-prices.1: fixed typo.
|
||||||
|
|
||||||
|
* src/scm/report/transaction-report-2.scm: fixed typo for debit string
|
||||||
|
and reversed displayed sign in debit column.
|
||||||
|
|
||||||
2000-05-01 Robert Graham Merkel <rgmerk@mira.net>
|
2000-05-01 Robert Graham Merkel <rgmerk@mira.net>
|
||||||
|
|
||||||
* src/scm/report/transaction-report-2.scm : Added i18n and
|
* src/scm/report/transaction-report-2.scm : Added i18n and
|
||||||
|
@ -537,6 +537,50 @@ get_selected_node(BudgetDialog *bd, EntryType type)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GtkCTreeNode *
|
||||||
|
get_previous_sibling_node(BudgetDialog *bd, GtkCTreeNode *node)
|
||||||
|
{
|
||||||
|
GtkCTreeNode *sibling;
|
||||||
|
GtkCTree *ctree;
|
||||||
|
BudgetItem *bi;
|
||||||
|
EntryType type;
|
||||||
|
|
||||||
|
if (node == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
ctree = GTK_CTREE(bd->entry_tree);
|
||||||
|
|
||||||
|
bi = gtk_ctree_node_get_row_data(ctree, node);
|
||||||
|
type = bi->type;
|
||||||
|
|
||||||
|
sibling = GTK_CTREE_NODE_PREV(node);
|
||||||
|
if (sibling == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
bi = gtk_ctree_node_get_row_data(ctree, sibling);
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case BUDGET_ENTRY:
|
||||||
|
while (bi->type != BUDGET_ENTRY)
|
||||||
|
{
|
||||||
|
sibling = GTK_CTREE_NODE_PREV(sibling);
|
||||||
|
if (sibling == NULL)
|
||||||
|
return NULL;
|
||||||
|
bi = gtk_ctree_node_get_row_data(ctree, sibling);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case BUDGET_SUBENTRY:
|
||||||
|
if (bi->type == BUDGET_ENTRY)
|
||||||
|
return NULL;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
g_warning("get_previous_sibling_node: bad entry type");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return sibling;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
entry_description_entry_changed(GtkEditable *editable, BudgetDialog *bd)
|
entry_description_entry_changed(GtkEditable *editable, BudgetDialog *bd)
|
||||||
{
|
{
|
||||||
@ -603,7 +647,6 @@ entry_up_button_clicked(GtkButton *button, BudgetDialog *bd)
|
|||||||
GtkCTreeNode *parent;
|
GtkCTreeNode *parent;
|
||||||
GtkCTreeNode *sibling;
|
GtkCTreeNode *sibling;
|
||||||
GtkCTree *ctree;
|
GtkCTree *ctree;
|
||||||
BudgetItem *bi;
|
|
||||||
|
|
||||||
if (bd->num_entries == 0)
|
if (bd->num_entries == 0)
|
||||||
return;
|
return;
|
||||||
@ -616,33 +659,11 @@ entry_up_button_clicked(GtkButton *button, BudgetDialog *bd)
|
|||||||
row = GTK_CTREE_ROW(node);
|
row = GTK_CTREE_ROW(node);
|
||||||
|
|
||||||
parent = row->parent;
|
parent = row->parent;
|
||||||
sibling = GTK_CTREE_NODE_PREV(node);
|
sibling = get_previous_sibling_node(bd, node);
|
||||||
|
|
||||||
if (sibling == NULL)
|
if (sibling == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bi = gtk_ctree_node_get_row_data(ctree, node);
|
|
||||||
switch (bi->type)
|
|
||||||
{
|
|
||||||
case BUDGET_SUBENTRY:
|
|
||||||
if (parent == sibling)
|
|
||||||
return;
|
|
||||||
break;
|
|
||||||
case BUDGET_ENTRY:
|
|
||||||
bi = gtk_ctree_node_get_row_data(ctree, sibling);
|
|
||||||
while (bi->type != BUDGET_ENTRY)
|
|
||||||
{
|
|
||||||
sibling = GTK_CTREE_NODE_PREV(sibling);
|
|
||||||
if (sibling == NULL)
|
|
||||||
return;
|
|
||||||
bi = gtk_ctree_node_get_row_data(ctree, sibling);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
g_warning("entry_up_button_clicked: bad item type");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
gtk_ctree_move(ctree, node, parent, sibling);
|
gtk_ctree_move(ctree, node, parent, sibling);
|
||||||
if (gtk_ctree_node_is_visible(ctree, node) != GTK_VISIBILITY_FULL)
|
if (gtk_ctree_node_is_visible(ctree, node) != GTK_VISIBILITY_FULL)
|
||||||
gtk_ctree_node_moveto(ctree, node, 0, 0.5, 0);
|
gtk_ctree_node_moveto(ctree, node, 0, 0.5, 0);
|
||||||
@ -749,13 +770,8 @@ mechanism_menu_changed(GtkButton *button, BudgetDialog *bd)
|
|||||||
static void
|
static void
|
||||||
allow_edits(BudgetDialog *bd, gboolean allow_edits)
|
allow_edits(BudgetDialog *bd, gboolean allow_edits)
|
||||||
{
|
{
|
||||||
GtkWidget *widget;
|
gtk_widget_set_sensitive(bd->entry_frame, allow_edits);
|
||||||
|
gtk_widget_set_sensitive(bd->subentry_frame, allow_edits);
|
||||||
widget = gtk_object_get_data(GTK_OBJECT(bd->dialog), "entry_frame");
|
|
||||||
gtk_widget_set_sensitive(widget, allow_edits);
|
|
||||||
|
|
||||||
widget = gtk_object_get_data(GTK_OBJECT(bd->dialog), "subentry_frame");
|
|
||||||
gtk_widget_set_sensitive(widget, allow_edits);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -970,7 +986,7 @@ gnc_ui_budget_dialog_create(SCM budget, SCM apply_func)
|
|||||||
menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(menu));
|
menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(menu));
|
||||||
gtk_container_forall(GTK_CONTAINER(menu), connect_mechanism_menu_item, bd);
|
gtk_container_forall(GTK_CONTAINER(menu), connect_mechanism_menu_item, bd);
|
||||||
|
|
||||||
bd->entry_frame = gtk_object_get_data(bdo, "entry_frame");
|
bd->subentry_frame = gtk_object_get_data(bdo, "subentry_frame");
|
||||||
|
|
||||||
button = gtk_object_get_data(bdo, "entry_up_button");
|
button = gtk_object_get_data(bdo, "entry_up_button");
|
||||||
arrow = gtk_arrow_new(GTK_ARROW_UP, GTK_SHADOW_IN);
|
arrow = gtk_arrow_new(GTK_ARROW_UP, GTK_SHADOW_IN);
|
||||||
|
@ -171,10 +171,10 @@
|
|||||||
(eq? (gnc:option-value
|
(eq? (gnc:option-value
|
||||||
(gnc:lookup-option options "Display" "Amount")) 'double)
|
(gnc:lookup-option options "Display" "Amount")) 'double)
|
||||||
(make-report-spec
|
(make-report-spec
|
||||||
(string-db 'lookup -debit-string)
|
(string-db 'lookup 'debit-string)
|
||||||
(lambda (split) (min 0 (gnc:split-get-value split)))
|
(lambda (split) (max 0 (- (gnc:split-get-value split))))
|
||||||
(lambda (value)
|
(lambda (value)
|
||||||
(if (< value 0) (html-right-cell (html-currency value))
|
(if (> value 0) (html-right-cell (html-currency value))
|
||||||
(html-right-cell (html-string " "))))
|
(html-right-cell (html-string " "))))
|
||||||
+ ; total-proc
|
+ ; total-proc
|
||||||
(lambda (value)
|
(lambda (value)
|
||||||
@ -185,7 +185,7 @@
|
|||||||
(lambda (split)
|
(lambda (split)
|
||||||
(map gnc:split-get-value (gnc:split-get-other-splits split)))
|
(map gnc:split-get-value (gnc:split-get-other-splits split)))
|
||||||
(lambda (value)
|
(lambda (value)
|
||||||
(if (< value 0) (html-right-cell (html-ital (html-currency value)))
|
(if (> value 0) (html-right-cell (html-ital (html-currency value)))
|
||||||
(html-right-cell (html-ital (html-string " "))))))
|
(html-right-cell (html-ital (html-string " "))))))
|
||||||
#f)
|
#f)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user