Commit Graph

34 Commits

Author SHA1 Message Date
Linas Vepstas
4d997e5b52 add missing gnc-commodity.h include file
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8573 57a11ea4-9604-0410-9ed3-97b8803252fd
2003-06-11 16:22:26 +00:00
Derek Atkins
3b4bf7ad45 * src/business/business-core/gncEntry.[ch]: add interfaces
to deal with bill 'payment types', in preparation for
	  employee expense vouchers.
	* src/business/business-core/file/gnc-entry-xml-v2.c:
	  add support for the bill payment type.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8033 57a11ea4-9604-0410-9ed3-97b8803252fd
2003-03-03 04:58:55 +00:00
Derek Atkins
39b506f60c * src/business/business-core/gncOwner.[ch]: rename ...Commodity() to
...Currency()
	* src/business/business-core/gncInvoice.[ch]: rename ...CommonCommodity()
	  to ...Currency()
	  use new gncOwner function name
	* src/business/business-core/gncEntry.c: use new Currency() functions
	* src/business/business-core/gw-business-core-spec.scm:
	  wrap gncInvoiceSetCurrency()
	  wrap gncInvoiceGetCurrency()
	  wrap gncOwnerGetCurrency()
	* src/business/business-core/file/gnc-invoice-xml-v2.c: use new funcs
	* src/business/business-gnome/dialog-invoice.c: use new functions --
	  set invoice currency based on owner's currency
	* src/business/business-reports/invoice.scm: use invoice's currency
	  for printing the invoice.
	PARTITAL fix for #101001


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7817 57a11ea4-9604-0410-9ed3-97b8803252fd
2003-01-12 22:07:33 +00:00
David Hampton
ed7e5bfc88 Fix a bunch of compilation warning messages.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7498 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-11-18 05:05:48 +00:00
Derek Atkins
25f3ffddb9 * business/business-core/*.c: add begin/commit edit calls in every 'set'
function.  Fixes 96855.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7434 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-11-04 00:41:01 +00:00
Derek Atkins
ac574a38eb * engine/gnc-be-utils.h: implement macro helpers for begin/commit functions
* business/business-core/*.c: Implement BeginEdit()/CommitEdit() functions
	  for all the business-accounting data objects.
	* Use the begin/commit calls in the GUI and file-backend.
	* mostly fixes bug #96855.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7431 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-11-03 20:21:42 +00:00
Derek Atkins
1a38508787 Add TaxTable entries to Vendor Invoices (Bills); make sure it does
not bleed over into billback items.  Fixes RFE #91415

	(See ChangeLog for more details)


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7208 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-09-14 05:32:37 +00:00
Derek Atkins
7a4f46c88f * change gncEntry->account into gncEntry->invAccount and
gncEntry->billAccount.  Change the register so that Bills use
	  the BillAccount and Invoices use the InvoiceAccount.  This
	  allows the same Entry to have both an "expense" and "income"
	  account to offset each other.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7117 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-07-11 15:11:33 +00:00
Derek Atkins
1f559cc1ae * business-prefs: add the bill_reg_width preference to save the value
* implement "Default Project" in the Bill register to enter a
	  default Bill-to customer/job.  It's only visible on Bills, not
	  Invoices.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7116 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-07-11 05:20:52 +00:00
Derek Atkins
5266dcf818 * add Billable flag and Bill-To (owner) to line-item entries.
* save these flags only if the entry is attached to a Bill.
	* add a Billable column to Bill register


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7110 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-07-10 17:32:59 +00:00
Derek Atkins
f1314f2ad7 * Separate Bills and Invoices into (somewhat) different things.
An Entry now has pointers to an Invoice and a Bill, although
	  both are represented by a GncInvoice.  Force a GncInvoice to a
	  Bill if the owner is a Vendor.  (It's a regular Invoice if the
	  owner is a Customer).  Eventually we can support Owner ==
	  Employee to deal with Expense Reports.
	* gncInvoice: add gncBill{Add,Remove}Entry
	* gncEntry: add gncEntry{Get,Set}Bill
	* gw-business-core: wrap gncEntryGetBill
	* gnc-entry-xml-v2: add entry:bill pointer
	* gncEntryLedger: deal with Bill Entry.  Don't need a lot of
	  columns (compared to Invoices).  This is not complete, but is
	  at a workable point now.
	* dialog-invoice: call the BILL vs. INVOICE entry-ledger based
	  on the invoice owner.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7108 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-07-10 04:12:19 +00:00
Derek Atkins
94946605f6 Add DATE_ENTERED parameter into the searchable fields
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7074 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-07-02 22:08:00 +00:00
Derek Atkins
52b503aca9 * fix the business XML to use symbolic names for enums (instead of
their integer values).  This is an incompatible change -- old
	business XML objects will not load properly.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7053 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-07-01 18:31:48 +00:00
Derek Atkins
068749c658 Fix logic for "dirty" setting; only set dirty when data actually
changes.  Only set "global" dirty flag at 'commitedit'


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6990 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-06-21 19:00:34 +00:00
Derek Atkins
19cc155b3e Add a notes field to the entry object.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6974 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-06-17 04:04:05 +00:00
Derek Atkins
8ef6d641be Integrate the tax table into the gncEntry object; change how taxes
and discounts are computed, stored, and returned.  Fix the Entry
	XML code to save/load the new taxtable data (not backwards
	compatible).  Integrate new changes into the entry-ledger.

	fix some bugs in the business xml code.  fix some memory leaks.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6966 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-06-16 05:11:33 +00:00
Derek Atkins
aef6a39dce * Create new options for a few business objects. This allows you to
save reports that reference Invoices, Customers, or Vendors and have
  them reload properly.

* Add two new functions to interface Invoices, Customers, and Vendors
  to scheme (RetGUID and LookupDirect)

* fix the way Entry values are computed.  Cache the computed values so
  you're not recomputing the math all the time.  It should also round
  properly, now.

* fix the display of entry values to round to the commodity fraction.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6920 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-05-27 18:17:31 +00:00
Derek Atkins
b9575c340f Provide a method to obtain the computed discount
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6911 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-05-24 21:19:45 +00:00
Derek Atkins
094b57930f implement "Delete" and "Duplicate" functions
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6877 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-05-18 20:10:27 +00:00
Derek Atkins
cfd8718a42 * Plug-in Extensions for backends, so pluggable objects can
provide backend-support without changing the core backend
	implementation.

	* src/engine/gncObject: Add a 'mark_clean' data-type method()
				add backend extension registration.

	* src/engine/gnc-book.c: use mark_clean object interface

	* src/backend/file/io-gncxml-v2: use the backend extensions

	* src/business/business-core/gnc*: add the mark_clean methods
					   add commodities to many objects

	* src/business/business-core/gncInvoice.c: fix GetPaidTxn() bug

	* src/business/business-core/file: the XML backend extensions for
	business objects.

	* src/business/business-gnome/dialog-*: supply default commodities


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6770 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-03-04 19:34:52 +00:00
Derek Atkins
2e801a6460 gncCustomer: change terms from gint to string
gncEntry: emit engine events for changes
        emit an event when the order is set: 'owner' modified
gncOrder: add the entry to the order before setting the entry
business-gnome.scm: change the API for invoice/order find/edit functions
dialog-customer: change terms entry to a GtkEntry; handle as string
	integrate invoice/order API changes
dialog-invoice: change find/edit API; start work for asynchronous UI
dialog-order: change find/edit API; start work for asynchronous UI
dialog-vendor: integrate invoice/order API changes
dialog-job-select: integrate invoice/order API changes


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6750 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-03-01 04:15:01 +00:00
Derek Atkins
a2f360a38b srfi-19: Fix date->string to work with guile-1.4/slib-2d2
gncEntry: add date_entered for better sorting
	  change SetDate methods from "Timespec*" to "Timespec"
	  update entry ledger to use new function calls

Fix a comparison bug in Entry/Invoice/Order.  Compares now
work correctly.

Updated invoice report; use date->string to print today's date;
flags to print notes.  Added more flexibility in what gets printed.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6748 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-02-28 05:10:07 +00:00
Derek Atkins
c659be0528 wrap a bunch of the core business objects
add 'ReturnValue' and 'ReturnTaxValue' functions for simplicity of wrapping


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6737 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-02-25 05:02:21 +00:00
Derek Atkins
3c71341542 - Provide 'QUERY_PARAM_GUID' to abstract the guid parameter. Remove all
the *_GUID defines, and change them all the QUERY_PARAM_GUID.
- Add a gncObject is_dirty() method, and have the book call it --
  this gives the UI a means to warn the user if any business objects
  changed.
- abstract out the storage methods in the business objects


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6734 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-02-24 22:12:24 +00:00
Derek Atkins
a90bed0151 default to % for discount and tax interpretation types
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6691 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-02-05 20:27:10 +00:00
Derek Atkins
2a0f766c34 * fix QueryNew bug: make sure to retain book list
* Update the QueryNew API to take a GList of terms to allow
  for any number of iterative lookups (such as
  GncEntry->GncInvoice->GncAccount->GNCBook->guid) (not that this
  is a useful example ;)

* Update all the business objects to the new API -- don't distinguish
  between a parameter that returns a core type and a parameter that
  returns another object.  Note that this implies that the namespace
  is shared between the objects and core types.  Also note that this
  is not enforced in any way.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6681 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-02-04 01:55:33 +00:00
Derek Atkins
ff880b0efd * gncObject -- object registration in the engine; hook into the books
* QueryNew interface revision-1 check-in

 * update all the business objects to register with the new query system


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6680 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-02-03 20:01:08 +00:00
Derek Atkins
ca457c00f0 More work on the Order Dialog and Entry Ledger
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6627 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-01-21 22:59:44 +00:00
Derek Atkins
7270c1d5fd - Add a "date-close" dialog that basically asks for confimation
of closing and sets the close-date (for when you close out an
  order to post an invoice).

- Refactor the Entry Value computation so that it is possible to
  compute the values in real-time (although it's not used at the
  moment)

- Change the Order Entry UI to make it a but clearer.

- change the EntryLedger to allow RO and RW entries for Invoices and
  Orders.

- Implement closing an Order; Opening (editing/viewing) a closed should be
  a read-only operation.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6621 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-01-21 02:27:02 +00:00
Derek Atkins
5564e42695 Add "GetValue()" method to an Entry and move the value computation
into the Entry from the Invoice.
Add more hooks to post an Invoice to an Account and lookup
an invoice from a transaction


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6615 57a11ea4-9604-0410-9ed3-97b8803252fd
2002-01-13 04:25:55 +00:00
Derek Atkins
997d8e92a7 First pass at an Entry Ledger. It compiles. It still needs
to be tested, and then it needs to be used.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6073 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-11-26 23:30:33 +00:00
Derek Atkins
b1cdb65bcd * Remove the "GncBusiness" object type in preparation to move
structure registration (GncBusinessObject) into "gncCore" in the
   engine.

 * Change all the Business Objects to take a GNCBook instead of
   GncBusiness; use the GNCEntityTable in the Book for GUID storage.

 * Use xaccGUIDNew() instead of guid_new().

 * Move the object storage tables into the GNCBook via get/set_data.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6041 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-11-25 05:34:34 +00:00
Derek Atkins
277282f25c Add tax_type and discount_type to GncEntry -- this allows you
to change how the Tax and Discount fields are handled (values
or percentages)

Add code to link a GncInvoice to a Transaction, and to lookup
the GncInvoice from a linked Transaction.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5989 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-11-24 05:35:08 +00:00
Derek Atkins
7a818ba566 Add first-pass at Entry, Order, and Invoice objects
move EntityTable management into gncBusiness (for now)


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5973 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-11-22 01:23:07 +00:00