mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
2001-07-12 Dave Peticolas <dave@krondo.com>
* src/scm/report/transaction.scm: remove old api * src/scm/report-utilities.scm: remove old api * src/scm/commodity-utilities.scm: remove old api * src/scm/engine-interface.scm: remove old api * src/scm/extensions.scm: remove old api * src/scm/report-utilities.scm: remove old api * src/gnome/reconcile-list.c: remove old api * src/scm/report/register.scm: remove old api * src/engine/Scrub.c: remove old api * src/engine/sql/txn.c: remove old api * src/engine/rpc/RpcUtils.c: remove old api * src/guile/gnc.gwp: remove cruft * src/scm/extensions.scm: remove cruft * src/guile/gnc-helpers.[ch]: remove old api * src/engine/io-gncbin-r.c: remove old api * src/guile/gnc-helpers.c: remove old api * src/SplitLedger.c: remove old api * src/engine/Transaction.[ch]: remove share api and older api * src/engine/Transaction-xml-parser-v1.c: remove old api git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4946 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
91973a0430
commit
30799ccd2f
38
ChangeLog
38
ChangeLog
@ -1,5 +1,43 @@
|
||||
2001-07-12 Dave Peticolas <dave@krondo.com>
|
||||
|
||||
* src/scm/report/transaction.scm: remove old api
|
||||
|
||||
* src/scm/report-utilities.scm: remove old api
|
||||
|
||||
* src/scm/commodity-utilities.scm: remove old api
|
||||
|
||||
* src/scm/engine-interface.scm: remove old api
|
||||
|
||||
* src/scm/extensions.scm: remove old api
|
||||
|
||||
* src/scm/report-utilities.scm: remove old api
|
||||
|
||||
* src/gnome/reconcile-list.c: remove old api
|
||||
|
||||
* src/scm/report/register.scm: remove old api
|
||||
|
||||
* src/engine/Scrub.c: remove old api
|
||||
|
||||
* src/engine/sql/txn.c: remove old api
|
||||
|
||||
* src/engine/rpc/RpcUtils.c: remove old api
|
||||
|
||||
* src/guile/gnc.gwp: remove cruft
|
||||
|
||||
* src/scm/extensions.scm: remove cruft
|
||||
|
||||
* src/guile/gnc-helpers.[ch]: remove old api
|
||||
|
||||
* src/engine/io-gncbin-r.c: remove old api
|
||||
|
||||
* src/guile/gnc-helpers.c: remove old api
|
||||
|
||||
* src/SplitLedger.c: remove old api
|
||||
|
||||
* src/engine/Transaction.[ch]: remove share api and older api
|
||||
|
||||
* src/engine/Transaction-xml-parser-v1.c: remove old api
|
||||
|
||||
* src/gnome/druid-stock-split.c: remove share api
|
||||
|
||||
* src/engine/Account.[ch]: remove 'share' api and other
|
||||
|
@ -1266,7 +1266,7 @@ LedgerAutoCompletion(SplitRegister *reg, gncTableTraversalDir dir,
|
||||
gnc_resume_gui_refresh ();
|
||||
|
||||
/* now move to the non-empty amount column */
|
||||
amount = xaccSplitGetShareAmount (blank_split);
|
||||
amount = xaccSplitGetAmount (blank_split);
|
||||
cell_type = (gnc_numeric_negative_p (amount)) ? CRED_CELL : DEBT_CELL;
|
||||
|
||||
if (xaccSplitRegisterGetCurrentCellLoc (reg, cell_type, &new_virt_loc))
|
||||
@ -1347,7 +1347,7 @@ LedgerAutoCompletion(SplitRegister *reg, gncTableTraversalDir dir,
|
||||
gnc_table_refresh_gui (reg->table, TRUE);
|
||||
|
||||
/* now move to the non-empty amount column */
|
||||
amount = xaccSplitGetShareAmount (auto_split);
|
||||
amount = xaccSplitGetAmount (auto_split);
|
||||
cell_type = (gnc_numeric_negative_p (amount)) ? CRED_CELL : DEBT_CELL;
|
||||
|
||||
if (xaccSplitRegisterGetCurrentCellLoc (reg, cell_type, &new_virt_loc))
|
||||
@ -3337,7 +3337,7 @@ xaccSRActuallySaveChangedCells( SplitRegister *reg, Transaction *trans, Split *s
|
||||
|
||||
xaccDateCellGetDate (reg->dateCell, &ts);
|
||||
|
||||
xaccTransSetDateTS (trans, &ts);
|
||||
xaccTransSetDatePostedTS (trans, &ts);
|
||||
}
|
||||
if (MOD_NUM & changed)
|
||||
{
|
||||
@ -3486,7 +3486,7 @@ xaccSRActuallySaveChangedCells( SplitRegister *reg, Transaction *trans, Split *s
|
||||
|
||||
DEBUG ("MOD_SHRS");
|
||||
|
||||
xaccSplitSetShareAmount (split, amount);
|
||||
xaccSplitSetAmount (split, amount);
|
||||
xaccSplitSetSharePrice (split, price);
|
||||
}
|
||||
|
||||
@ -3522,7 +3522,7 @@ xaccSRActuallySaveChangedCells( SplitRegister *reg, Transaction *trans, Split *s
|
||||
|
||||
if (other_split)
|
||||
{
|
||||
gnc_numeric amount = xaccSplitGetShareAmount (split);
|
||||
gnc_numeric amount = xaccSplitGetAmount (split);
|
||||
gnc_numeric price = xaccSplitGetSharePrice (split);
|
||||
|
||||
amount = gnc_numeric_neg (amount);
|
||||
@ -3606,7 +3606,7 @@ get_trans_total_shares (SplitRegister *reg, Transaction *trans)
|
||||
if (xaccSplitGetAccount (split) != account)
|
||||
continue;
|
||||
|
||||
total = gnc_numeric_add_fixed (total, xaccSplitGetShareAmount (split));
|
||||
total = gnc_numeric_add_fixed (total, xaccSplitGetAmount (split));
|
||||
}
|
||||
|
||||
return total;
|
||||
@ -3644,16 +3644,6 @@ get_trans_last_split (SplitRegister *reg, Transaction *trans)
|
||||
return last_split;
|
||||
}
|
||||
|
||||
static gnc_numeric
|
||||
get_trans_total_share_balance (SplitRegister *reg, Transaction *trans)
|
||||
{
|
||||
Split *last_split;
|
||||
|
||||
last_split = get_trans_last_split (reg, trans);
|
||||
|
||||
return xaccSplitGetShareBalance (last_split);
|
||||
}
|
||||
|
||||
static gnc_numeric
|
||||
get_trans_total_balance (SplitRegister *reg, Transaction *trans)
|
||||
{
|
||||
@ -3944,9 +3934,9 @@ xaccSRGetEntryHandler (VirtualLocation virt_loc, gboolean translate,
|
||||
return "";
|
||||
|
||||
if (cell_type == SHRBALN_CELL)
|
||||
balance = xaccSplitGetShareBalance (split);
|
||||
balance = xaccSplitGetBalance (split);
|
||||
else
|
||||
balance = get_trans_total_share_balance (reg, trans);
|
||||
balance = get_trans_total_balance (reg, trans);
|
||||
|
||||
return xaccPrintAmount (balance,
|
||||
gnc_split_quantity_print_info (split, FALSE));
|
||||
@ -4050,7 +4040,7 @@ xaccSRGetEntryHandler (VirtualLocation virt_loc, gboolean translate,
|
||||
if (!use_security_cells (reg, virt_loc))
|
||||
return "";
|
||||
|
||||
shares = xaccSplitGetShareAmount (split);
|
||||
shares = xaccSplitGetAmount (split);
|
||||
|
||||
if (gnc_numeric_zero_p (shares))
|
||||
return "";
|
||||
@ -4417,7 +4407,7 @@ xaccSRGetFGColorHandler (VirtualLocation virt_loc, gpointer user_data)
|
||||
else if (is_current)
|
||||
shares = xaccGetPriceCellValue (reg->sharesCell);
|
||||
else
|
||||
shares = xaccSplitGetShareAmount (split);
|
||||
shares = xaccSplitGetAmount (split);
|
||||
|
||||
if (gnc_numeric_negative_p (shares))
|
||||
return red;
|
||||
@ -4432,9 +4422,9 @@ xaccSRGetFGColorHandler (VirtualLocation virt_loc, gpointer user_data)
|
||||
gnc_numeric balance;
|
||||
|
||||
if (cell_type == SHRBALN_CELL)
|
||||
balance = xaccSplitGetShareBalance (split);
|
||||
balance = xaccSplitGetBalance (split);
|
||||
else
|
||||
balance = get_trans_total_share_balance (reg, trans);
|
||||
balance = get_trans_total_balance (reg, trans);
|
||||
|
||||
if (gnc_numeric_negative_p (balance))
|
||||
return red;
|
||||
|
@ -205,12 +205,12 @@ xaccSplitScrub (Split *split)
|
||||
{
|
||||
value = xaccSplitGetValue (split);
|
||||
|
||||
if (gnc_numeric_same (xaccSplitGetShareAmount (split),
|
||||
if (gnc_numeric_same (xaccSplitGetAmount (split),
|
||||
xaccSplitGetValue (split),
|
||||
value.denom, GNC_RND_ROUND))
|
||||
return;
|
||||
|
||||
xaccSplitSetShareAmount (split, value);
|
||||
xaccSplitSetAmount (split, value);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -237,7 +237,7 @@ xaccSplitScrub (Split *split)
|
||||
if (!trans_was_open)
|
||||
xaccTransBeginEdit (trans);
|
||||
|
||||
xaccSplitSetShareAmount (split, value);
|
||||
xaccSplitSetAmount (split, value);
|
||||
|
||||
if (!trans_was_open)
|
||||
xaccTransCommitEdit (trans);
|
||||
@ -362,7 +362,7 @@ xaccTransScrubImbalance (Transaction *trans, AccountGroup *root,
|
||||
|
||||
commodity = xaccAccountGetCommodity (account);
|
||||
if (gnc_commodity_equiv (currency, commodity))
|
||||
xaccSplitSetShareAmount (balance_split, new_value);
|
||||
xaccSplitSetAmount (balance_split, new_value);
|
||||
|
||||
if (!parent && gnc_numeric_zero_p (new_value))
|
||||
{
|
||||
|
@ -347,7 +347,7 @@ txn_rest_date_posted_end_handler(gpointer data_for_children,
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
xaccTransSetDateTS(t, &(info->ts));
|
||||
xaccTransSetDatePostedTS(t, &(info->ts));
|
||||
g_free(info);
|
||||
return(TRUE);
|
||||
}
|
||||
@ -472,7 +472,7 @@ txn_restore_split_after_child_handler(gpointer data_for_children,
|
||||
else if(strcmp(child_result->tag, "quantity") == 0) {
|
||||
gnc_numeric *n = (gnc_numeric *) child_result->data;
|
||||
g_return_val_if_fail(n, FALSE);
|
||||
xaccSplitSetShareAmount(s, *n);
|
||||
xaccSplitSetAmount(s, *n);
|
||||
/* let the normal child_result handler clean up n */
|
||||
}
|
||||
else if(strcmp(child_result->tag, "value") == 0) {
|
||||
|
@ -522,7 +522,7 @@ DxaccSplitSetShareAmount (Split *s, double damt)
|
||||
}
|
||||
|
||||
void
|
||||
xaccSplitSetShareAmount (Split *s, gnc_numeric amt)
|
||||
xaccSplitSetAmount (Split *s, gnc_numeric amt)
|
||||
{
|
||||
if(!s) return;
|
||||
check_open (s->parent);
|
||||
@ -575,37 +575,6 @@ xaccSplitSetValue (Split *s, gnc_numeric amt)
|
||||
/********************************************************************\
|
||||
\********************************************************************/
|
||||
|
||||
double
|
||||
DxaccSplitGetBalance (Split *s) {
|
||||
return gnc_numeric_to_double(xaccSplitGetBalance(s));
|
||||
}
|
||||
|
||||
double
|
||||
DxaccSplitGetClearedBalance (Split *s) {
|
||||
return gnc_numeric_to_double(xaccSplitGetClearedBalance(s));
|
||||
}
|
||||
|
||||
double
|
||||
DxaccSplitGetReconciledBalance (Split *s) {
|
||||
return gnc_numeric_to_double(xaccSplitGetReconciledBalance(s));
|
||||
}
|
||||
|
||||
double
|
||||
DxaccSplitGetShareBalance (Split *s) {
|
||||
return gnc_numeric_to_double(xaccSplitGetShareBalance(s));
|
||||
}
|
||||
|
||||
double
|
||||
DxaccSplitGetShareClearedBalance (Split *s) {
|
||||
return gnc_numeric_to_double(xaccSplitGetShareClearedBalance(s));
|
||||
}
|
||||
|
||||
double
|
||||
DxaccSplitGetShareReconciledBalance (Split *s) {
|
||||
return gnc_numeric_to_double(xaccSplitGetShareReconciledBalance(s));
|
||||
}
|
||||
|
||||
|
||||
gnc_numeric
|
||||
xaccSplitGetBalance (Split *s) {
|
||||
if (!s) return gnc_numeric_zero();
|
||||
@ -624,25 +593,6 @@ xaccSplitGetReconciledBalance (Split *s) {
|
||||
return s->reconciled_balance;
|
||||
}
|
||||
|
||||
gnc_numeric
|
||||
xaccSplitGetShareBalance (Split *s) {
|
||||
if (!s) return gnc_numeric_zero();
|
||||
return s->balance;
|
||||
}
|
||||
|
||||
gnc_numeric
|
||||
xaccSplitGetShareClearedBalance (Split *s) {
|
||||
if (!s) return gnc_numeric_zero();
|
||||
return s->cleared_balance;
|
||||
}
|
||||
|
||||
gnc_numeric
|
||||
xaccSplitGetShareReconciledBalance (Split *s) {
|
||||
if (!s) return gnc_numeric_zero();
|
||||
return s->reconciled_balance;
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************\
|
||||
* xaccInitTransaction
|
||||
* Initialize a transaction structure
|
||||
@ -982,14 +932,6 @@ xaccSplitSetBaseValue (Split *s, gnc_numeric value,
|
||||
mark_split (s);
|
||||
}
|
||||
|
||||
|
||||
double
|
||||
DxaccSplitGetBaseValue (Split *s, const gnc_commodity * base_currency)
|
||||
{
|
||||
return gnc_numeric_to_double(xaccSplitGetBaseValue(s, base_currency));
|
||||
}
|
||||
|
||||
|
||||
gnc_numeric
|
||||
xaccSplitGetBaseValue (Split *s, const gnc_commodity * base_currency)
|
||||
{
|
||||
@ -1242,22 +1184,6 @@ xaccTransFindOldCommonCurrency (Transaction *trans)
|
||||
return retval;
|
||||
}
|
||||
|
||||
gnc_commodity *
|
||||
xaccTransIsCommonCurrency (Transaction *trans, gnc_commodity * ra)
|
||||
{
|
||||
if (!trans) return NULL;
|
||||
return FindCommonCurrency (trans->splits, ra, NULL);
|
||||
}
|
||||
|
||||
gnc_commodity *
|
||||
xaccTransIsCommonExclSCurrency (Transaction *trans,
|
||||
gnc_commodity * ra,
|
||||
Split *excl_split)
|
||||
{
|
||||
if (!trans) return NULL;
|
||||
return FindCommonExclSCurrency (trans->splits, ra, NULL, excl_split);
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
\********************************************************************/
|
||||
/* The new routine for setting the common currency */
|
||||
@ -1377,7 +1303,7 @@ xaccTransCommitEdit (Transaction *trans)
|
||||
xaccAccountInsertSplit (xaccSplitGetAccount(s), s);
|
||||
xaccSplitSetMemo (s, split->memo);
|
||||
xaccSplitSetAction (s, split->action);
|
||||
xaccSplitSetShareAmount(s, gnc_numeric_neg(split->amount));
|
||||
xaccSplitSetAmount(s, gnc_numeric_neg(split->amount));
|
||||
xaccSplitSetValue(s, gnc_numeric_neg(split->value));
|
||||
}
|
||||
}
|
||||
@ -2153,7 +2079,7 @@ xaccTransSetDateEnteredSecs (Transaction *trans, time_t secs)
|
||||
}
|
||||
|
||||
void
|
||||
xaccTransSetDateTS (Transaction *trans, const Timespec *ts)
|
||||
xaccTransSetDatePostedTS (Transaction *trans, const Timespec *ts)
|
||||
{
|
||||
if (!ts) return;
|
||||
xaccTransSetDateInternal(trans, TDATE_POSTED, ts->tv_sec, ts->tv_nsec);
|
||||
@ -2173,15 +2099,6 @@ xaccTransSetDate (Transaction *trans, int day, int mon, int year)
|
||||
xaccTransSetDateInternal(trans, TDATE_POSTED, ts.tv_sec, ts.tv_nsec);
|
||||
}
|
||||
|
||||
void
|
||||
xaccTransSetDateToday (Transaction *trans)
|
||||
{
|
||||
struct timeval tv;
|
||||
gettimeofday (&tv, NULL);
|
||||
xaccTransSetDateInternal(trans, TDATE_POSTED, tv.tv_sec, tv.tv_usec);
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************\
|
||||
\********************************************************************/
|
||||
|
||||
@ -2277,13 +2194,6 @@ xaccTransGetDate (Transaction *trans)
|
||||
return (trans->date_posted.tv_sec);
|
||||
}
|
||||
|
||||
long long
|
||||
xaccTransGetDateL (Transaction *trans)
|
||||
{
|
||||
if (!trans) return 0;
|
||||
return (trans->date_posted.tv_sec);
|
||||
}
|
||||
|
||||
void
|
||||
xaccTransGetDateTS (Transaction *trans, Timespec *ts)
|
||||
{
|
||||
@ -2445,7 +2355,7 @@ xaccSplitGetReconcile (Split *split) {
|
||||
|
||||
double
|
||||
DxaccSplitGetShareAmount (Split * split) {
|
||||
return gnc_numeric_to_double(xaccSplitGetShareAmount(split));
|
||||
return gnc_numeric_to_double(xaccSplitGetAmount(split));
|
||||
}
|
||||
|
||||
double
|
||||
@ -2460,7 +2370,7 @@ DxaccSplitGetSharePrice (Split * split)
|
||||
}
|
||||
|
||||
gnc_numeric
|
||||
xaccSplitGetShareAmount (Split * split)
|
||||
xaccSplitGetAmount (Split * split)
|
||||
{
|
||||
if (!split) return gnc_numeric_zero();
|
||||
return split->amount;
|
||||
|
@ -147,19 +147,15 @@ void xaccTransSetSlots_nc(Transaction *t, kvp_frame *frm);
|
||||
* The xaccTransSetDate() method does the same thing as
|
||||
* xaccTransSetDateSecs(), but takes a convenient day-month-year format.
|
||||
*
|
||||
* The xaccTransSetDateTS() method does the same thing as
|
||||
* The xaccTransSetDatePostedTS() method does the same thing as
|
||||
* xaccTransSetDateSecs(), but takes a struct timespec64.
|
||||
*
|
||||
* The xaccTransSetDateToday() method does the same thing as
|
||||
* xaccTransSetDateSecs(), but sets the date to the current system
|
||||
* date/time.
|
||||
*/
|
||||
void xaccTransSetDate (Transaction *trans,
|
||||
int day, int mon, int year);
|
||||
void xaccTransSetDateSecs (Transaction *trans, time_t time);
|
||||
void xaccTransSetDateToday (Transaction *trans);
|
||||
void xaccTransSetDateTS (Transaction *trans, const Timespec *ts);
|
||||
#define xaccTransSetDatePostedTS xaccTransSetDateTS
|
||||
void xaccTransSetDatePostedTS (Transaction *trans,
|
||||
const Timespec *ts);
|
||||
|
||||
void xaccTransSetDateEnteredSecs (Transaction *trans, time_t time);
|
||||
void xaccTransSetDateEnteredTS (Transaction *trans,
|
||||
@ -213,7 +209,6 @@ const char * xaccTransGetNum (Transaction *trans);
|
||||
const char * xaccTransGetDescription (Transaction *trans);
|
||||
const char * xaccTransGetNotes (Transaction *trans);
|
||||
time_t xaccTransGetDate (Transaction *trans);
|
||||
long long xaccTransGetDateL (Transaction *trans);
|
||||
|
||||
void xaccTransGetDateTS (Transaction *trans, Timespec *ts);
|
||||
#define xaccTransGetDatePostedTS xaccTransGetDateTS
|
||||
@ -257,44 +252,6 @@ int xaccTransCountSplits (Transaction *trans);
|
||||
gnc_commodity * xaccTransGetCurrency (Transaction *trans);
|
||||
void xaccTransSetCurrency (Transaction *trans, gnc_commodity *curr);
|
||||
|
||||
/* ---------
|
||||
* and now for the 'old' routines
|
||||
* --------- */
|
||||
|
||||
/* The xaccTransIsCommonCurrency () method compares the input commodity
|
||||
* to the currency/security denominations of all splits in the
|
||||
* transaction, and returns the input commodity if it is common with
|
||||
* all the splits, otherwise, it returns NULL.
|
||||
*
|
||||
* Note that this routine is *not* merely a compare on the
|
||||
* value returned by TransFindCommonCurrency(). This is because
|
||||
* all of the splits in a transaction may share *both* a common
|
||||
* currency and a common security. If the desired match is the
|
||||
* security, a simple match won't reveal this fact.
|
||||
*
|
||||
* This routine is useful in dealing with currency trading accounts
|
||||
* and/or with "stock boxes", where transaction have a security in
|
||||
* common. This routine is useful in dealing with securities of
|
||||
* differing types as they are moved across accounts.
|
||||
*/
|
||||
gnc_commodity * xaccTransIsCommonCurrency(Transaction *trans,
|
||||
gnc_commodity *curr);
|
||||
|
||||
/* The xaccTransIsCommonExclSCurrency () method compares the input
|
||||
* string to the currency/security denominations of all splits in
|
||||
* the transaction except the one given as parameter, and returns
|
||||
* the input string if it is common with all splits except the one
|
||||
* given, otherwise, it returns NULL.
|
||||
*
|
||||
* This is useful when changing one split such that the old entry in
|
||||
* that split is of no relevance when determining whether the new
|
||||
* entry has a common currency with the other splits.
|
||||
*/
|
||||
gnc_commodity *
|
||||
xaccTransIsCommonExclSCurrency (Transaction *trans,
|
||||
gnc_commodity * currency,
|
||||
Split *excl_split);
|
||||
|
||||
/* The xaccTransGetImbalance() method returns the total value of the
|
||||
* transaction. In a pure double-entry system, this imbalance
|
||||
* should be exactly zero, and if it is not, something is broken.
|
||||
@ -385,8 +342,7 @@ void DxaccSplitSetBaseValue (Split *split, double value,
|
||||
|
||||
void xaccSplitSetSharePriceAndAmount (Split *split, gnc_numeric price,
|
||||
gnc_numeric amount);
|
||||
#define xaccSplitSetAmount xaccSplitSetShareAmount
|
||||
void xaccSplitSetShareAmount (Split *split, gnc_numeric amount);
|
||||
void xaccSplitSetAmount (Split *split, gnc_numeric amount);
|
||||
void xaccSplitSetSharePrice (Split *split, gnc_numeric price);
|
||||
void xaccSplitSetValue (Split *split, gnc_numeric value);
|
||||
void xaccSplitSetBaseValue (Split *split, gnc_numeric value,
|
||||
@ -410,21 +366,9 @@ void xaccSplitSetBaseValue (Split *split, gnc_numeric value,
|
||||
* of all transactions that have been marked as reconciled.
|
||||
*/
|
||||
|
||||
double DxaccSplitGetBalance (Split *split);
|
||||
double DxaccSplitGetClearedBalance (Split *split);
|
||||
double DxaccSplitGetReconciledBalance (Split *split);
|
||||
double DxaccSplitGetShareBalance (Split *split);
|
||||
double DxaccSplitGetShareClearedBalance (Split *split);
|
||||
double DxaccSplitGetShareReconciledBalance (Split *split);
|
||||
double DxaccSplitGetBaseValue (Split *split,
|
||||
const gnc_commodity * base_currency);
|
||||
|
||||
gnc_numeric xaccSplitGetBalance (Split *split);
|
||||
gnc_numeric xaccSplitGetClearedBalance (Split *split);
|
||||
gnc_numeric xaccSplitGetReconciledBalance (Split *split);
|
||||
gnc_numeric xaccSplitGetShareBalance (Split *split);
|
||||
gnc_numeric xaccSplitGetShareClearedBalance (Split *split);
|
||||
gnc_numeric xaccSplitGetShareReconciledBalance (Split *split);
|
||||
gnc_numeric xaccSplitGetBaseValue (Split *split,
|
||||
const gnc_commodity * base_currency);
|
||||
|
||||
@ -441,8 +385,7 @@ double DxaccSplitGetShareAmount (Split * split);
|
||||
double DxaccSplitGetSharePrice (Split * split);
|
||||
double DxaccSplitGetValue (Split * split);
|
||||
|
||||
#define xaccSplitGetAmount xaccSplitGetShareAmount
|
||||
gnc_numeric xaccSplitGetShareAmount (Split * split);
|
||||
gnc_numeric xaccSplitGetAmount (Split * split);
|
||||
gnc_numeric xaccSplitGetSharePrice (Split * split);
|
||||
gnc_numeric xaccSplitGetValue (Split * split);
|
||||
|
||||
|
@ -102,7 +102,7 @@ split_to_dom_tree(const gchar *tag, Split *spl)
|
||||
|
||||
add_gnc_num(ret, "split:value", xaccSplitGetValue(spl));
|
||||
|
||||
add_gnc_num(ret, "split:quantity", xaccSplitGetShareAmount(spl));
|
||||
add_gnc_num(ret, "split:quantity", xaccSplitGetAmount(spl));
|
||||
|
||||
xmlAddChild(ret, guid_to_dom_tree(
|
||||
"split:account",
|
||||
@ -271,7 +271,7 @@ spl_value_handler(xmlNodePtr node, gpointer spl)
|
||||
static gboolean
|
||||
spl_quantity_handler(xmlNodePtr node, gpointer spl)
|
||||
{
|
||||
return set_spl_gnc_num(node, (Split*)spl, xaccSplitSetShareAmount);
|
||||
return set_spl_gnc_num(node, (Split*)spl, xaccSplitSetAmount);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -965,7 +965,7 @@ readTransaction( int fd, Account *acc, int revision)
|
||||
xaccTransCommitEdit (trans);
|
||||
return NULL;
|
||||
}
|
||||
xaccTransSetDateTS (trans, &ts);
|
||||
xaccTransSetDatePostedTS (trans, &ts);
|
||||
|
||||
/* then the entered date ... */
|
||||
rc = readTSDate( fd, &ts, revision );
|
||||
|
@ -1053,7 +1053,7 @@ int rpcend_do_add_txn (gncTransaction * txn, gnc_commodity_table *ct)
|
||||
xaccSplitSetReconcile (s, sl->split->reconciled);
|
||||
xaccSplitSetDateReconciledTS (s, (Timespec *)&sl->split->date_reconciled);
|
||||
xaccSplitSetValue (s, *((gnc_numeric *)&(sl->split->value)));
|
||||
xaccSplitSetShareAmount (s, *((gnc_numeric *)&(sl->split->damount)));
|
||||
xaccSplitSetAmount (s, *((gnc_numeric *)&(sl->split->damount)));
|
||||
|
||||
s->kvp_data = rpcend_parse_gnckvp (sl->split->kvp_data);
|
||||
|
||||
|
@ -23,7 +23,7 @@ define(`split', `gncEntry, Split, Split, e,
|
||||
action, , char *, xaccSplitGetAction(ptr),
|
||||
reconciled, , char, xaccSplitGetReconcile(ptr),
|
||||
date_reconciled, , Timespec, xaccSplitRetDateReconciledTS(ptr),
|
||||
amount, , int64, gnc_numeric_num(xaccSplitGetShareAmount(ptr)),
|
||||
amount, , int64, gnc_numeric_num(xaccSplitGetAmount(ptr)),
|
||||
value, , int64, gnc_numeric_num(xaccSplitGetValue(ptr)),
|
||||
entryGUID, KEY, GUID *, xaccSplitGetGUID(ptr),
|
||||
')
|
||||
|
@ -74,7 +74,7 @@ is_trans_empty (Transaction *trans)
|
||||
if (1 != xaccTransCountSplits(trans)) return FALSE;
|
||||
|
||||
s = xaccTransGetSplit(trans, 0);
|
||||
if (TRUE != gnc_numeric_zero_p(xaccSplitGetShareAmount(s))) return FALSE;
|
||||
if (TRUE != gnc_numeric_zero_p(xaccSplitGetAmount(s))) return FALSE;
|
||||
if (TRUE != gnc_numeric_zero_p(xaccSplitGetValue(s))) return FALSE;
|
||||
if ('n' != xaccSplitGetReconcile(s)) return FALSE;
|
||||
if (0 != (xaccSplitGetMemo(s))[0]) return FALSE;
|
||||
@ -571,7 +571,7 @@ pgendCopyTransactionToEngine (PGBackend *be, const GUID *trans_guid)
|
||||
modity = xaccAccountGetCommodity (acc);
|
||||
acct_frac = gnc_commodity_get_fraction (modity);
|
||||
amount = gnc_numeric_create (num, acct_frac);
|
||||
xaccSplitSetShareAmount (s, amount);
|
||||
xaccSplitSetAmount (s, amount);
|
||||
|
||||
xaccTransAppendSplit (trans, s);
|
||||
|
||||
|
@ -391,7 +391,7 @@ stock_split_finish (GnomeDruidPage *druidpage,
|
||||
|
||||
xaccAccountInsertSplit (account, split);
|
||||
|
||||
xaccSplitSetShareAmount (split, amount);
|
||||
xaccSplitSetAmount (split, amount);
|
||||
xaccSplitMakeStockSplit (split);
|
||||
xaccSplitSetAction (split, _("Split"));
|
||||
|
||||
@ -450,7 +450,7 @@ stock_split_finish (GnomeDruidPage *druidpage,
|
||||
|
||||
xaccTransAppendSplit (trans, split);
|
||||
|
||||
xaccSplitSetShareAmount (split, amount);
|
||||
xaccSplitSetAmount (split, amount);
|
||||
xaccSplitSetValue (split, amount);
|
||||
|
||||
xaccSplitSetMemo (split, memo);
|
||||
@ -469,7 +469,7 @@ stock_split_finish (GnomeDruidPage *druidpage,
|
||||
|
||||
xaccTransAppendSplit (trans, split);
|
||||
|
||||
xaccSplitSetShareAmount (split, gnc_numeric_neg (amount));
|
||||
xaccSplitSetAmount (split, gnc_numeric_neg (amount));
|
||||
xaccSplitSetValue (split, gnc_numeric_neg (amount));
|
||||
|
||||
xaccSplitSetMemo (split, memo);
|
||||
|
@ -470,7 +470,6 @@ gnc_reconcile_list_reconciled_balance (GNCReconcileList *list)
|
||||
GtkCList *clist = GTK_CLIST(list);
|
||||
Split *split;
|
||||
gnc_numeric total;
|
||||
int account_type;
|
||||
int i;
|
||||
|
||||
total = gnc_numeric_zero ();
|
||||
@ -481,8 +480,6 @@ gnc_reconcile_list_reconciled_balance (GNCReconcileList *list)
|
||||
if (list->reconciled == NULL)
|
||||
return total;
|
||||
|
||||
account_type = xaccAccountGetType (list->account);
|
||||
|
||||
for (i = 0; i < list->num_splits; i++)
|
||||
{
|
||||
split = gtk_clist_get_row_data (clist, i);
|
||||
@ -490,11 +487,7 @@ gnc_reconcile_list_reconciled_balance (GNCReconcileList *list)
|
||||
if (g_hash_table_lookup (list->reconciled, split) == NULL)
|
||||
continue;
|
||||
|
||||
if ((account_type == STOCK) || (account_type == MUTUAL) ||
|
||||
(account_type == CURRENCY))
|
||||
total = gnc_numeric_add_fixed (total, xaccSplitGetShareAmount(split));
|
||||
else
|
||||
total = gnc_numeric_add_fixed (total, xaccSplitGetValue(split));
|
||||
total = gnc_numeric_add_fixed (total, xaccSplitGetAmount(split));
|
||||
}
|
||||
|
||||
return gnc_numeric_abs (total);
|
||||
@ -654,7 +647,6 @@ gnc_reconcile_list_fill(GNCReconcileList *list)
|
||||
{
|
||||
const gchar *strings[list->num_columns + 1];
|
||||
GNCPrintAmountInfo print_info;
|
||||
GNCAccountType account_type;
|
||||
Transaction *trans;
|
||||
gboolean auto_check;
|
||||
GList *splits;
|
||||
@ -664,7 +656,6 @@ gnc_reconcile_list_fill(GNCReconcileList *list)
|
||||
"Check off cleared transactions",
|
||||
TRUE);
|
||||
|
||||
account_type = xaccAccountGetType (list->account);
|
||||
strings[5] = NULL;
|
||||
|
||||
print_info = gnc_account_print_info (list->account, FALSE);
|
||||
@ -682,10 +673,7 @@ gnc_reconcile_list_fill(GNCReconcileList *list)
|
||||
if ((recn != NREC) && (recn != CREC))
|
||||
continue;
|
||||
|
||||
if((account_type == STOCK) || (account_type == MUTUAL))
|
||||
amount = xaccSplitGetShareAmount (split);
|
||||
else
|
||||
amount = xaccSplitGetValue (split);
|
||||
amount = xaccSplitGetAmount (split);
|
||||
|
||||
if (gnc_numeric_negative_p (amount) && list->list_type == RECLIST_DEBIT)
|
||||
continue;
|
||||
|
@ -132,7 +132,7 @@
|
||||
(account-comm (gnc:account-get-commodity
|
||||
(gnc:split-get-account a)))
|
||||
(share-amount (gnc:numeric-abs
|
||||
(gnc:split-get-share-amount a)))
|
||||
(gnc:split-get-amount a)))
|
||||
(value-amount (gnc:numeric-abs
|
||||
(gnc:split-get-value a)))
|
||||
(transaction-date (gnc:transaction-get-date-posted
|
||||
@ -229,7 +229,7 @@
|
||||
(account-comm (gnc:account-get-commodity
|
||||
(gnc:split-get-account a)))
|
||||
(share-amount (gnc:numeric-abs
|
||||
(gnc:split-get-share-amount a)))
|
||||
(gnc:split-get-amount a)))
|
||||
(value-amount (gnc:numeric-abs
|
||||
(gnc:split-get-value a)))
|
||||
(transaction-date (gnc:transaction-get-date-posted
|
||||
@ -497,7 +497,7 @@
|
||||
(gnc:split-get-account a)))
|
||||
;; Always use the absolute value here.
|
||||
(share-amount (gnc:numeric-abs
|
||||
(gnc:split-get-share-amount a)))
|
||||
(gnc:split-get-amount a)))
|
||||
(value-amount (gnc:numeric-abs
|
||||
(gnc:split-get-value a)))
|
||||
(tmp (assoc transaction-comm sumlist))
|
||||
|
@ -102,7 +102,7 @@
|
||||
(gnc:split-get-action split)
|
||||
(gnc:split-get-reconcile-state split)
|
||||
(gnc:split-get-reconciled-date split)
|
||||
(gnc:split-get-share-amount split)
|
||||
(gnc:split-get-amount split)
|
||||
(gnc:split-get-value split)))
|
||||
|
||||
;; Copy a scheme representation of a split onto a C split.
|
||||
@ -120,7 +120,7 @@
|
||||
(value (gnc:split-scm-get-value split-scm)))
|
||||
(if memo (gnc:split-set-memo split memo))
|
||||
(if action (gnc:split-set-action split action))
|
||||
(if quantity (gnc:split-set-share-amount split quantity))
|
||||
(if quantity (gnc:split-set-amount split quantity))
|
||||
(if value (gnc:split-set-value split value)))
|
||||
(let ((account (gnc:account-lookup
|
||||
(gnc:split-scm-get-account-guid split-scm))))
|
||||
|
@ -60,13 +60,6 @@
|
||||
(define (gnc:extensions-menu-setup)
|
||||
(define menu (gnc:make-menu "Extensions" (list "_Settings")))
|
||||
|
||||
; (define export-item
|
||||
; (gnc:make-menu-item (N_ "Export data as text (Danger: Unfinished)")
|
||||
; (N_ "Export data as text.")
|
||||
; (list "Extensions" "")
|
||||
; (lambda () (gnc:main-win-account-group-write win))))
|
||||
|
||||
|
||||
(define schedxact-editor-item
|
||||
(gnc:make-menu-item (N_ "SchedXact: Editor")
|
||||
(N_ "Editor of Scheduled Transactions")
|
||||
|
@ -431,8 +431,7 @@
|
||||
;; currency value from the file import.
|
||||
(set! near-split-total (n+ near-split-total split-amt))
|
||||
(gnc:split-set-value gnc-far-split (n- split-amt))
|
||||
(gnc:split-set-share-amount gnc-far-split
|
||||
(n- split-amt))
|
||||
(gnc:split-set-amount gnc-far-split (n- split-amt))
|
||||
|
||||
(if memo (gnc:split-set-memo gnc-far-split memo))
|
||||
|
||||
@ -482,7 +481,7 @@
|
||||
|
||||
;; the value of the near split is the total of the far splits.
|
||||
(gnc:split-set-value gnc-near-split near-split-total)
|
||||
(gnc:split-set-share-amount gnc-near-split near-split-total)
|
||||
(gnc:split-set-amount gnc-near-split near-split-total)
|
||||
(gnc:transaction-append-split gnc-xtn gnc-near-split)
|
||||
(gnc:account-insert-split near-acct gnc-near-split))
|
||||
|
||||
@ -546,45 +545,45 @@
|
||||
(case qif-action
|
||||
((buy buyx reinvint reinvdiv reinvsg reinvsh reinvmd reinvlg)
|
||||
(if (not share-price) (set! share-price (gnc:numeric-zero)))
|
||||
(gnc:split-set-share-amount gnc-near-split num-shares)
|
||||
(gnc:split-set-amount gnc-near-split num-shares)
|
||||
(gnc:split-set-value gnc-near-split split-amt)
|
||||
(gnc:split-set-value gnc-far-split (n- xtn-amt))
|
||||
(gnc:split-set-share-amount gnc-far-split (n- xtn-amt)))
|
||||
(gnc:split-set-amount gnc-far-split (n- xtn-amt)))
|
||||
|
||||
((sell sellx)
|
||||
(if (not share-price) (set! share-price (gnc:numeric-zero)))
|
||||
(gnc:split-set-share-amount gnc-near-split (n- num-shares))
|
||||
(gnc:split-set-amount gnc-near-split (n- num-shares))
|
||||
(gnc:split-set-value gnc-near-split (n- split-amt))
|
||||
(gnc:split-set-value gnc-far-split xtn-amt)
|
||||
(gnc:split-set-share-amount gnc-far-split xtn-amt))
|
||||
(gnc:split-set-amount gnc-far-split xtn-amt))
|
||||
|
||||
((cgshort cgshortx cgmid cgmidx cglong cglongx intinc intincx
|
||||
div divx miscinc miscincx xin rtrncap rtrncapx)
|
||||
(gnc:split-set-value gnc-near-split xtn-amt)
|
||||
(gnc:split-set-share-amount gnc-near-split xtn-amt)
|
||||
(gnc:split-set-amount gnc-near-split xtn-amt)
|
||||
(gnc:split-set-value gnc-far-split (n- xtn-amt))
|
||||
(gnc:split-set-share-amount gnc-far-split (n- xtn-amt)))
|
||||
(gnc:split-set-amount gnc-far-split (n- xtn-amt)))
|
||||
|
||||
((xout miscexp miscexpx margint margintx)
|
||||
(gnc:split-set-value gnc-near-split (n- xtn-amt))
|
||||
(gnc:split-set-share-amount gnc-near-split (n- xtn-amt))
|
||||
(gnc:split-set-amount gnc-near-split (n- xtn-amt))
|
||||
(gnc:split-set-value gnc-far-split xtn-amt)
|
||||
(gnc:split-set-share-amount gnc-far-split xtn-amt))
|
||||
(gnc:split-set-amount gnc-far-split xtn-amt))
|
||||
|
||||
((shrsin)
|
||||
;; getting rid of the old equity-acct-per-stock trick.
|
||||
;; you must now have a cash/basis value for the stock.
|
||||
(gnc:split-set-share-amount gnc-near-split num-shares)
|
||||
(gnc:split-set-amount gnc-near-split num-shares)
|
||||
(gnc:split-set-value gnc-near-split split-amt)
|
||||
(gnc:split-set-value gnc-far-split (n- xtn-amt))
|
||||
(gnc:split-set-share-amount gnc-far-split (n- xtn-amt)))
|
||||
(gnc:split-set-amount gnc-far-split (n- xtn-amt)))
|
||||
|
||||
((shrsout)
|
||||
;; shrsout is like shrsin
|
||||
(gnc:split-set-share-amount gnc-near-split (n- num-shares))
|
||||
(gnc:split-set-amount gnc-near-split (n- num-shares))
|
||||
(gnc:split-set-value gnc-near-split (n- split-amt))
|
||||
(gnc:split-set-value gnc-far-split xtn-amt)
|
||||
(gnc:split-set-share-amount gnc-far-split xtn-amt))
|
||||
(gnc:split-set-amount gnc-far-split xtn-amt))
|
||||
|
||||
;; stock splits: QIF just specifies the split ratio, not
|
||||
;; the number of shares in and out, so we have to fetch
|
||||
@ -597,8 +596,8 @@
|
||||
(in-shares
|
||||
(gnc:account-get-balance near-acct))
|
||||
(out-shares (n* in-shares splitratio)))
|
||||
(gnc:split-set-share-amount gnc-near-split out-shares)
|
||||
(gnc:split-set-share-amount gnc-far-split (n- in-shares))
|
||||
(gnc:split-set-amount gnc-near-split out-shares)
|
||||
(gnc:split-set-amount gnc-far-split (n- in-shares))
|
||||
(gnc:split-set-value gnc-near-split (n- split-amt))
|
||||
(gnc:split-set-value gnc-far-split split-amt))))
|
||||
|
||||
@ -622,7 +621,7 @@
|
||||
(begin
|
||||
(set! commission-split (gnc:split-create))
|
||||
(gnc:split-set-value commission-split commission-amt)
|
||||
(gnc:split-set-share-amount commission-split commission-amt)))
|
||||
(gnc:split-set-amount commission-split commission-amt)))
|
||||
|
||||
(if (and qif-near-acct qif-far-acct)
|
||||
(begin
|
||||
|
@ -491,10 +491,6 @@
|
||||
;; This works similar as above but returns a commodity-collector,
|
||||
;; thus takes care of children accounts with different currencies.
|
||||
;;
|
||||
;; Note that this uses the gnc:split-get-share-balance rather than
|
||||
;; gnc:split-get-balance as above, which means that results for both
|
||||
;; may differ especially for stock accounts.
|
||||
;;
|
||||
;; Also note that the commodity-collector contains <gnc:numeric>
|
||||
;; values rather than double values.
|
||||
(define (gnc:account-get-comm-balance-at-date account
|
||||
@ -521,9 +517,9 @@
|
||||
|
||||
(if (and splits (not (null? splits)))
|
||||
(balance-collector 'add (gnc:account-get-commodity account)
|
||||
(gnc:split-get-share-balance (car splits))))
|
||||
(gnc:split-get-balance (car splits))))
|
||||
balance-collector))
|
||||
|
||||
|
||||
;; get the balance of a group of accounts at the specified date
|
||||
;; inlcuding child accounts.
|
||||
(define (gnc:group-get-balance-at-date group date)
|
||||
|
@ -132,7 +132,7 @@
|
||||
(currency (if account
|
||||
(gnc:account-get-commodity account)
|
||||
(gnc:default-currency)))
|
||||
(damount (gnc:split-get-share-amount split))
|
||||
(damount (gnc:split-get-amount split))
|
||||
(split-value (gnc:make-gnc-monetary currency damount)))
|
||||
|
||||
(if (date-col column-vector)
|
||||
@ -170,7 +170,7 @@
|
||||
(if (shares-col column-vector)
|
||||
(addto! row-contents
|
||||
(if split-info?
|
||||
(gnc:split-get-share-amount split)
|
||||
(gnc:split-get-amount split)
|
||||
" ")))
|
||||
(if (price-col column-vector)
|
||||
(addto! row-contents
|
||||
|
@ -337,7 +337,7 @@
|
||||
(currency (if account
|
||||
(gnc:account-get-commodity account)
|
||||
(gnc:default-currency)))
|
||||
(damount (gnc:split-get-share-amount split))
|
||||
(damount (gnc:split-get-amount split))
|
||||
(split-value (gnc:make-gnc-monetary
|
||||
currency
|
||||
(if (member account-type account-types-to-reverse)
|
||||
@ -378,7 +378,7 @@
|
||||
(addto! row-contents (gnc:split-get-corr-account-name split))))
|
||||
|
||||
(if (used-shares column-vector)
|
||||
(addto! row-contents (gnc:split-get-share-amount split)))
|
||||
(addto! row-contents (gnc:split-get-amount split)))
|
||||
(if (used-price column-vector)
|
||||
(addto!
|
||||
row-contents
|
||||
|
Loading…
Reference in New Issue
Block a user