mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Add new files to make the string freeze that define the
interface to choose a customer or vendor for a hand-entered transaction. Hopefully we can simplify the input by allowing users to enter a transaction directly and assigning it to a customer/vendor by hand (rather than going through the business interfaces). git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13793 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
5362a54874
commit
4921f27c79
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
||||
2006-04-16 Derek Atkins <derek@ihtfp.com>
|
||||
|
||||
* src/business/business-gnome/glade/choose-owner.glade:
|
||||
* src/business/business-gnome/dialog-choose-owner.[ch]:
|
||||
Add new files to make the string freeze that define the
|
||||
interface to choose a customer or vendor for a hand-entered
|
||||
transaction. Hopefully we can simplify the input by allowing
|
||||
users to enter a transaction directly and assigning it to a
|
||||
customer/vendor by hand (rather than going through the business
|
||||
interfaces).
|
||||
|
||||
2006-04-15 Derek Atkins <derek@ihtfp.com>
|
||||
|
||||
* src/gnome-utils/druid-gnc-xml-import.c:
|
||||
|
@ -36,6 +36,7 @@ libgncmod_business_gnome_la_SOURCES = \
|
||||
business-urls.c \
|
||||
business-gnome-utils.c \
|
||||
dialog-billterms.c \
|
||||
dialog-choose-owner.c \
|
||||
dialog-customer.c \
|
||||
dialog-date-close.c \
|
||||
dialog-employee.c \
|
||||
@ -53,6 +54,7 @@ noinst_HEADERS = \
|
||||
business-urls.h \
|
||||
business-gnome-utils.h \
|
||||
dialog-billterms.h \
|
||||
dialog-choose-owner.h \
|
||||
dialog-customer.h \
|
||||
dialog-date-close.h \
|
||||
dialog-employee.h \
|
||||
|
104
src/business/business-gnome/dialog-choose-owner.c
Normal file
104
src/business/business-gnome/dialog-choose-owner.c
Normal file
@ -0,0 +1,104 @@
|
||||
/*
|
||||
* dialog-choose-owner.c -- Dialog to choose an owner for a business Split
|
||||
* Copyright (C) 2006 Derek Atkins
|
||||
* Author: Derek Atkins <warlord@MIT.EDU>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, contact:
|
||||
*
|
||||
* Free Software Foundation Voice: +1-617-542-5942
|
||||
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <qof.h>
|
||||
|
||||
#include "Transaction.h"
|
||||
#include "dialog-utils.h"
|
||||
#include "gncOwner.h"
|
||||
|
||||
#include "dialog-choose-owner.h"
|
||||
#include "business-gnome-utils.h"
|
||||
|
||||
struct _choose_owner_dialog {
|
||||
GtkWidget * dialog;
|
||||
GtkWidget * owner_choice;
|
||||
QofBook * book;
|
||||
GncOwner owner;
|
||||
Split * split;
|
||||
};
|
||||
|
||||
static DialogChooseOwner *
|
||||
gcoi_create_dialog(Split* split)
|
||||
{
|
||||
DialogChooseOwner* dco;
|
||||
GladeXML *xml;
|
||||
GtkWidget *widget, *box;
|
||||
|
||||
g_return_val_if_fail(split, NULL);
|
||||
|
||||
dco = g_new0(DialogChooseOwner, 1);
|
||||
g_assert(dco);
|
||||
dco->book = qof_instance_get_book(QOF_INSTANCE(split));
|
||||
dco->split = split;
|
||||
|
||||
/* Open the Glade file */
|
||||
xml = gnc_glade_xml_new("choose-owner.glade", "Choose Owner Dialog");
|
||||
g_assert(xml);
|
||||
|
||||
/* Get the dialog handle */
|
||||
dco->dialog = glade_xml_get_widget(xml, "Choose Owner Dialog");
|
||||
g_assert(dco->dialog);
|
||||
|
||||
/* Get the title widget and set the title */
|
||||
widget = glade_xml_get_widget(xml, "title_label");
|
||||
if (1 == 1) {
|
||||
gncOwnerInitCustomer(&(dco->owner), NULL);
|
||||
gtk_label_set_text(GTK_LABEL(widget),
|
||||
_("This transaction needs to be assigned to a Customer."
|
||||
" Please choose the Customer below."));
|
||||
} else {
|
||||
gncOwnerInitVendor(&(dco->owner), NULL);
|
||||
gtk_label_set_text(GTK_LABEL(widget),
|
||||
_("This transaction needs to be assigned to a Vendor."
|
||||
" Please choose the Vendor below."));
|
||||
}
|
||||
|
||||
/* Get the transaction description and set it */
|
||||
widget = glade_xml_get_widget(xml, "desc_label");
|
||||
gtk_label_set_text(GTK_LABEL(widget),
|
||||
xaccTransGetDescription(xaccSplitGetParent(split)));
|
||||
|
||||
/* Get the owner label and the owner box */
|
||||
widget = glade_xml_get_widget(xml, "owner_label");
|
||||
box = glade_xml_get_widget(xml, "owner_box");
|
||||
dco->owner_choice = gnc_owner_select_create(widget, box, dco->book,
|
||||
&(dco->owner));
|
||||
|
||||
gtk_widget_show_all(dco->dialog);
|
||||
return dco;
|
||||
}
|
||||
|
||||
|
||||
gboolean
|
||||
gnc_split_assign_owner(GtkWidget* window, Split* split)
|
||||
{
|
||||
if (1 == 0)
|
||||
gcoi_create_dialog(split);
|
||||
|
||||
return FALSE;
|
||||
}
|
38
src/business/business-gnome/dialog-choose-owner.h
Normal file
38
src/business/business-gnome/dialog-choose-owner.h
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* dialog-choose-owner.h -- Dialog to choose an owner for a business Split
|
||||
* Copyright (C) 2006 Derek Atkins
|
||||
* Author: Derek Atkins <warlord@MIT.EDU>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, contact:
|
||||
*
|
||||
* Free Software Foundation Voice: +1-617-542-5942
|
||||
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
|
||||
* Boston, MA 02110-1301, USA gnu@gnu.org
|
||||
*/
|
||||
|
||||
|
||||
#ifndef GNC_DIALOG_CHOOSE_OWNER_H_
|
||||
#define GNC_DIALOG_CHOOSE_OWNER_H_
|
||||
|
||||
#include "Split.h"
|
||||
|
||||
typedef struct _choose_owner_dialog DialogChooseOwner;
|
||||
|
||||
/**
|
||||
* This split was added to an A/R or A/P account. Make sure it
|
||||
* has an owner attached to it so the business reports work.
|
||||
*/
|
||||
gboolean gnc_split_assign_owner(GtkWidget* window, Split* split);
|
||||
|
||||
#endif /* GNC_DIALOG_CHOOSE_OWNER_H_ */
|
@ -2,6 +2,7 @@ gladedir = $(GNC_GLADE_DIR)
|
||||
glade_DATA = \
|
||||
billterms.glade \
|
||||
businessprefs.glade \
|
||||
choose-owner.glade \
|
||||
customer.glade \
|
||||
date-close.glade \
|
||||
employee.glade \
|
||||
|
233
src/business/business-gnome/glade/choose-owner.glade
Normal file
233
src/business/business-gnome/glade/choose-owner.glade
Normal file
@ -0,0 +1,233 @@
|
||||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
||||
|
||||
<glade-interface>
|
||||
|
||||
<widget class="GtkDialog" id="Choose Owner Dialog">
|
||||
<property name="visible">True</property>
|
||||
<property name="title" translatable="yes">Choose Owner Dialog</property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
||||
<property name="modal">False</property>
|
||||
<property name="resizable">True</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="decorated">True</property>
|
||||
<property name="skip_taskbar_hint">False</property>
|
||||
<property name="skip_pager_hint">False</property>
|
||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
|
||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
||||
<property name="has_separator">True</property>
|
||||
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child internal-child="action_area">
|
||||
<widget class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="cancelbutton1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="response_id">-6</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="okbutton1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="response_id">-5</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">GTK_PACK_END</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="title_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="no">(docs)</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">True</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHSeparator" id="hseparator1">
|
||||
<property name="visible">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox3">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox2">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Description</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="owner_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="no">(owner)</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox3">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="desc_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="no">(desc)</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="owner_box">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
</glade-interface>
|
Loading…
Reference in New Issue
Block a user