Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace overly indirect gnc_business_get_default_tax_table.
With gncTaxTableGetDefault. qof_book_get_default_tax_table would have been even better but it would have created a circular dependency between QofBook and GncTaxTable.
- Loading branch information
Showing
9 changed files
with
57 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -681,6 +681,26 @@ GncTaxTable *gncTaxTableLookupByName (QofBook *book, const char *name) | |
return NULL; | ||
} | ||
|
||
GncTaxTable* | ||
gncTaxTableGetDefault (QofBook *book, GncOwnerType type) | ||
{ | ||
GSList *path = NULL; | ||
const GncGUID *guid = NULL; | ||
const char *vendor = "Default Vendor TaxTable"; | ||
const char *customer = "Default Customer TaxTable"; | ||
const char *section = "Business"; | ||
|
||
g_return_val_if_fail (book != NULL, NULL); | ||
g_return_val_if_fail (type == GNC_OWNER_CUSTOMER || \ | ||
type == GNC_OWNER_VENDOR, NULL); | ||
path = g_slist_prepend (path, type == GNC_OWNER_CUSTOMER ? (void*)customer : (void*)vendor); | ||
path = g_slist_prepend (path, (void*)section); | ||
|
||
guid = qof_book_get_guid_option (book, path); | ||
g_return_val_if_fail (guid, NULL); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jralls
Author
Member
|
||
return gncTaxTableLookup (book, guid); | ||
} | ||
|
||
GncTaxTableList * gncTaxTableGetTables (QofBook *book) | ||
{ | ||
struct _book_info *bi; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Just wondering if the g_return_val_if_fail is a good option, would it be normal to set these default options, I just noticed the assertion 'guid' failed in the trace file as both options are set to 'None'.