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>
|
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/gnome/druid-stock-split.c: remove share api
|
||||||
|
|
||||||
* src/engine/Account.[ch]: remove 'share' api and other
|
* src/engine/Account.[ch]: remove 'share' api and other
|
||||||
|
@ -1266,7 +1266,7 @@ LedgerAutoCompletion(SplitRegister *reg, gncTableTraversalDir dir,
|
|||||||
gnc_resume_gui_refresh ();
|
gnc_resume_gui_refresh ();
|
||||||
|
|
||||||
/* now move to the non-empty amount column */
|
/* 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;
|
cell_type = (gnc_numeric_negative_p (amount)) ? CRED_CELL : DEBT_CELL;
|
||||||
|
|
||||||
if (xaccSplitRegisterGetCurrentCellLoc (reg, cell_type, &new_virt_loc))
|
if (xaccSplitRegisterGetCurrentCellLoc (reg, cell_type, &new_virt_loc))
|
||||||
@ -1347,7 +1347,7 @@ LedgerAutoCompletion(SplitRegister *reg, gncTableTraversalDir dir,
|
|||||||
gnc_table_refresh_gui (reg->table, TRUE);
|
gnc_table_refresh_gui (reg->table, TRUE);
|
||||||
|
|
||||||
/* now move to the non-empty amount column */
|
/* 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;
|
cell_type = (gnc_numeric_negative_p (amount)) ? CRED_CELL : DEBT_CELL;
|
||||||
|
|
||||||
if (xaccSplitRegisterGetCurrentCellLoc (reg, cell_type, &new_virt_loc))
|
if (xaccSplitRegisterGetCurrentCellLoc (reg, cell_type, &new_virt_loc))
|
||||||
@ -3337,7 +3337,7 @@ xaccSRActuallySaveChangedCells( SplitRegister *reg, Transaction *trans, Split *s
|
|||||||
|
|
||||||
xaccDateCellGetDate (reg->dateCell, &ts);
|
xaccDateCellGetDate (reg->dateCell, &ts);
|
||||||
|
|
||||||
xaccTransSetDateTS (trans, &ts);
|
xaccTransSetDatePostedTS (trans, &ts);
|
||||||
}
|
}
|
||||||
if (MOD_NUM & changed)
|
if (MOD_NUM & changed)
|
||||||
{
|
{
|
||||||
@ -3486,7 +3486,7 @@ xaccSRActuallySaveChangedCells( SplitRegister *reg, Transaction *trans, Split *s
|
|||||||
|
|
||||||
DEBUG ("MOD_SHRS");
|
DEBUG ("MOD_SHRS");
|
||||||
|
|
||||||
xaccSplitSetShareAmount (split, amount);
|
xaccSplitSetAmount (split, amount);
|
||||||
xaccSplitSetSharePrice (split, price);
|
xaccSplitSetSharePrice (split, price);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3522,7 +3522,7 @@ xaccSRActuallySaveChangedCells( SplitRegister *reg, Transaction *trans, Split *s
|
|||||||
|
|
||||||
if (other_split)
|
if (other_split)
|
||||||
{
|
{
|
||||||
gnc_numeric amount = xaccSplitGetShareAmount (split);
|
gnc_numeric amount = xaccSplitGetAmount (split);
|
||||||
gnc_numeric price = xaccSplitGetSharePrice (split);
|
gnc_numeric price = xaccSplitGetSharePrice (split);
|
||||||
|
|
||||||
amount = gnc_numeric_neg (amount);
|
amount = gnc_numeric_neg (amount);
|
||||||
@ -3606,7 +3606,7 @@ get_trans_total_shares (SplitRegister *reg, Transaction *trans)
|
|||||||
if (xaccSplitGetAccount (split) != account)
|
if (xaccSplitGetAccount (split) != account)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
total = gnc_numeric_add_fixed (total, xaccSplitGetShareAmount (split));
|
total = gnc_numeric_add_fixed (total, xaccSplitGetAmount (split));
|
||||||
}
|
}
|
||||||
|
|
||||||
return total;
|
return total;
|
||||||
@ -3644,16 +3644,6 @@ get_trans_last_split (SplitRegister *reg, Transaction *trans)
|
|||||||
return last_split;
|
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
|
static gnc_numeric
|
||||||
get_trans_total_balance (SplitRegister *reg, Transaction *trans)
|
get_trans_total_balance (SplitRegister *reg, Transaction *trans)
|
||||||
{
|
{
|
||||||
@ -3944,9 +3934,9 @@ xaccSRGetEntryHandler (VirtualLocation virt_loc, gboolean translate,
|
|||||||
return "";
|
return "";
|
||||||
|
|
||||||
if (cell_type == SHRBALN_CELL)
|
if (cell_type == SHRBALN_CELL)
|
||||||
balance = xaccSplitGetShareBalance (split);
|
balance = xaccSplitGetBalance (split);
|
||||||
else
|
else
|
||||||
balance = get_trans_total_share_balance (reg, trans);
|
balance = get_trans_total_balance (reg, trans);
|
||||||
|
|
||||||
return xaccPrintAmount (balance,
|
return xaccPrintAmount (balance,
|
||||||
gnc_split_quantity_print_info (split, FALSE));
|
gnc_split_quantity_print_info (split, FALSE));
|
||||||
@ -4050,7 +4040,7 @@ xaccSRGetEntryHandler (VirtualLocation virt_loc, gboolean translate,
|
|||||||
if (!use_security_cells (reg, virt_loc))
|
if (!use_security_cells (reg, virt_loc))
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
shares = xaccSplitGetShareAmount (split);
|
shares = xaccSplitGetAmount (split);
|
||||||
|
|
||||||
if (gnc_numeric_zero_p (shares))
|
if (gnc_numeric_zero_p (shares))
|
||||||
return "";
|
return "";
|
||||||
@ -4417,7 +4407,7 @@ xaccSRGetFGColorHandler (VirtualLocation virt_loc, gpointer user_data)
|
|||||||
else if (is_current)
|
else if (is_current)
|
||||||
shares = xaccGetPriceCellValue (reg->sharesCell);
|
shares = xaccGetPriceCellValue (reg->sharesCell);
|
||||||
else
|
else
|
||||||
shares = xaccSplitGetShareAmount (split);
|
shares = xaccSplitGetAmount (split);
|
||||||
|
|
||||||
if (gnc_numeric_negative_p (shares))
|
if (gnc_numeric_negative_p (shares))
|
||||||
return red;
|
return red;
|
||||||
@ -4432,9 +4422,9 @@ xaccSRGetFGColorHandler (VirtualLocation virt_loc, gpointer user_data)
|
|||||||
gnc_numeric balance;
|
gnc_numeric balance;
|
||||||
|
|
||||||
if (cell_type == SHRBALN_CELL)
|
if (cell_type == SHRBALN_CELL)
|
||||||
balance = xaccSplitGetShareBalance (split);
|
balance = xaccSplitGetBalance (split);
|
||||||
else
|
else
|
||||||
balance = get_trans_total_share_balance (reg, trans);
|
balance = get_trans_total_balance (reg, trans);
|
||||||
|
|
||||||
if (gnc_numeric_negative_p (balance))
|
if (gnc_numeric_negative_p (balance))
|
||||||
return red;
|
return red;
|
||||||
|
@ -205,12 +205,12 @@ xaccSplitScrub (Split *split)
|
|||||||
{
|
{
|
||||||
value = xaccSplitGetValue (split);
|
value = xaccSplitGetValue (split);
|
||||||
|
|
||||||
if (gnc_numeric_same (xaccSplitGetShareAmount (split),
|
if (gnc_numeric_same (xaccSplitGetAmount (split),
|
||||||
xaccSplitGetValue (split),
|
xaccSplitGetValue (split),
|
||||||
value.denom, GNC_RND_ROUND))
|
value.denom, GNC_RND_ROUND))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
xaccSplitSetShareAmount (split, value);
|
xaccSplitSetAmount (split, value);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -237,7 +237,7 @@ xaccSplitScrub (Split *split)
|
|||||||
if (!trans_was_open)
|
if (!trans_was_open)
|
||||||
xaccTransBeginEdit (trans);
|
xaccTransBeginEdit (trans);
|
||||||
|
|
||||||
xaccSplitSetShareAmount (split, value);
|
xaccSplitSetAmount (split, value);
|
||||||
|
|
||||||
if (!trans_was_open)
|
if (!trans_was_open)
|
||||||
xaccTransCommitEdit (trans);
|
xaccTransCommitEdit (trans);
|
||||||
@ -362,7 +362,7 @@ xaccTransScrubImbalance (Transaction *trans, AccountGroup *root,
|
|||||||
|
|
||||||
commodity = xaccAccountGetCommodity (account);
|
commodity = xaccAccountGetCommodity (account);
|
||||||
if (gnc_commodity_equiv (currency, commodity))
|
if (gnc_commodity_equiv (currency, commodity))
|
||||||
xaccSplitSetShareAmount (balance_split, new_value);
|
xaccSplitSetAmount (balance_split, new_value);
|
||||||
|
|
||||||
if (!parent && gnc_numeric_zero_p (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);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
xaccTransSetDateTS(t, &(info->ts));
|
xaccTransSetDatePostedTS(t, &(info->ts));
|
||||||
g_free(info);
|
g_free(info);
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
@ -472,7 +472,7 @@ txn_restore_split_after_child_handler(gpointer data_for_children,
|
|||||||
else if(strcmp(child_result->tag, "quantity") == 0) {
|
else if(strcmp(child_result->tag, "quantity") == 0) {
|
||||||
gnc_numeric *n = (gnc_numeric *) child_result->data;
|
gnc_numeric *n = (gnc_numeric *) child_result->data;
|
||||||
g_return_val_if_fail(n, FALSE);
|
g_return_val_if_fail(n, FALSE);
|
||||||
xaccSplitSetShareAmount(s, *n);
|
xaccSplitSetAmount(s, *n);
|
||||||
/* let the normal child_result handler clean up n */
|
/* let the normal child_result handler clean up n */
|
||||||
}
|
}
|
||||||
else if(strcmp(child_result->tag, "value") == 0) {
|
else if(strcmp(child_result->tag, "value") == 0) {
|
||||||
|
@ -522,7 +522,7 @@ DxaccSplitSetShareAmount (Split *s, double damt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xaccSplitSetShareAmount (Split *s, gnc_numeric amt)
|
xaccSplitSetAmount (Split *s, gnc_numeric amt)
|
||||||
{
|
{
|
||||||
if(!s) return;
|
if(!s) return;
|
||||||
check_open (s->parent);
|
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
|
gnc_numeric
|
||||||
xaccSplitGetBalance (Split *s) {
|
xaccSplitGetBalance (Split *s) {
|
||||||
if (!s) return gnc_numeric_zero();
|
if (!s) return gnc_numeric_zero();
|
||||||
@ -624,25 +593,6 @@ xaccSplitGetReconciledBalance (Split *s) {
|
|||||||
return s->reconciled_balance;
|
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
|
* xaccInitTransaction
|
||||||
* Initialize a transaction structure
|
* Initialize a transaction structure
|
||||||
@ -982,14 +932,6 @@ xaccSplitSetBaseValue (Split *s, gnc_numeric value,
|
|||||||
mark_split (s);
|
mark_split (s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
double
|
|
||||||
DxaccSplitGetBaseValue (Split *s, const gnc_commodity * base_currency)
|
|
||||||
{
|
|
||||||
return gnc_numeric_to_double(xaccSplitGetBaseValue(s, base_currency));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
gnc_numeric
|
gnc_numeric
|
||||||
xaccSplitGetBaseValue (Split *s, const gnc_commodity * base_currency)
|
xaccSplitGetBaseValue (Split *s, const gnc_commodity * base_currency)
|
||||||
{
|
{
|
||||||
@ -1242,22 +1184,6 @@ xaccTransFindOldCommonCurrency (Transaction *trans)
|
|||||||
return retval;
|
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 */
|
/* The new routine for setting the common currency */
|
||||||
@ -1377,7 +1303,7 @@ xaccTransCommitEdit (Transaction *trans)
|
|||||||
xaccAccountInsertSplit (xaccSplitGetAccount(s), s);
|
xaccAccountInsertSplit (xaccSplitGetAccount(s), s);
|
||||||
xaccSplitSetMemo (s, split->memo);
|
xaccSplitSetMemo (s, split->memo);
|
||||||
xaccSplitSetAction (s, split->action);
|
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));
|
xaccSplitSetValue(s, gnc_numeric_neg(split->value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2153,7 +2079,7 @@ xaccTransSetDateEnteredSecs (Transaction *trans, time_t secs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xaccTransSetDateTS (Transaction *trans, const Timespec *ts)
|
xaccTransSetDatePostedTS (Transaction *trans, const Timespec *ts)
|
||||||
{
|
{
|
||||||
if (!ts) return;
|
if (!ts) return;
|
||||||
xaccTransSetDateInternal(trans, TDATE_POSTED, ts->tv_sec, ts->tv_nsec);
|
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);
|
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);
|
return (trans->date_posted.tv_sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
long long
|
|
||||||
xaccTransGetDateL (Transaction *trans)
|
|
||||||
{
|
|
||||||
if (!trans) return 0;
|
|
||||||
return (trans->date_posted.tv_sec);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
xaccTransGetDateTS (Transaction *trans, Timespec *ts)
|
xaccTransGetDateTS (Transaction *trans, Timespec *ts)
|
||||||
{
|
{
|
||||||
@ -2445,7 +2355,7 @@ xaccSplitGetReconcile (Split *split) {
|
|||||||
|
|
||||||
double
|
double
|
||||||
DxaccSplitGetShareAmount (Split * split) {
|
DxaccSplitGetShareAmount (Split * split) {
|
||||||
return gnc_numeric_to_double(xaccSplitGetShareAmount(split));
|
return gnc_numeric_to_double(xaccSplitGetAmount(split));
|
||||||
}
|
}
|
||||||
|
|
||||||
double
|
double
|
||||||
@ -2460,7 +2370,7 @@ DxaccSplitGetSharePrice (Split * split)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gnc_numeric
|
gnc_numeric
|
||||||
xaccSplitGetShareAmount (Split * split)
|
xaccSplitGetAmount (Split * split)
|
||||||
{
|
{
|
||||||
if (!split) return gnc_numeric_zero();
|
if (!split) return gnc_numeric_zero();
|
||||||
return split->amount;
|
return split->amount;
|
||||||
|
@ -147,19 +147,15 @@ void xaccTransSetSlots_nc(Transaction *t, kvp_frame *frm);
|
|||||||
* The xaccTransSetDate() method does the same thing as
|
* The xaccTransSetDate() method does the same thing as
|
||||||
* xaccTransSetDateSecs(), but takes a convenient day-month-year format.
|
* 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.
|
* 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,
|
void xaccTransSetDate (Transaction *trans,
|
||||||
int day, int mon, int year);
|
int day, int mon, int year);
|
||||||
void xaccTransSetDateSecs (Transaction *trans, time_t time);
|
void xaccTransSetDateSecs (Transaction *trans, time_t time);
|
||||||
void xaccTransSetDateToday (Transaction *trans);
|
void xaccTransSetDatePostedTS (Transaction *trans,
|
||||||
void xaccTransSetDateTS (Transaction *trans, const Timespec *ts);
|
const Timespec *ts);
|
||||||
#define xaccTransSetDatePostedTS xaccTransSetDateTS
|
|
||||||
|
|
||||||
void xaccTransSetDateEnteredSecs (Transaction *trans, time_t time);
|
void xaccTransSetDateEnteredSecs (Transaction *trans, time_t time);
|
||||||
void xaccTransSetDateEnteredTS (Transaction *trans,
|
void xaccTransSetDateEnteredTS (Transaction *trans,
|
||||||
@ -213,7 +209,6 @@ const char * xaccTransGetNum (Transaction *trans);
|
|||||||
const char * xaccTransGetDescription (Transaction *trans);
|
const char * xaccTransGetDescription (Transaction *trans);
|
||||||
const char * xaccTransGetNotes (Transaction *trans);
|
const char * xaccTransGetNotes (Transaction *trans);
|
||||||
time_t xaccTransGetDate (Transaction *trans);
|
time_t xaccTransGetDate (Transaction *trans);
|
||||||
long long xaccTransGetDateL (Transaction *trans);
|
|
||||||
|
|
||||||
void xaccTransGetDateTS (Transaction *trans, Timespec *ts);
|
void xaccTransGetDateTS (Transaction *trans, Timespec *ts);
|
||||||
#define xaccTransGetDatePostedTS xaccTransGetDateTS
|
#define xaccTransGetDatePostedTS xaccTransGetDateTS
|
||||||
@ -257,44 +252,6 @@ int xaccTransCountSplits (Transaction *trans);
|
|||||||
gnc_commodity * xaccTransGetCurrency (Transaction *trans);
|
gnc_commodity * xaccTransGetCurrency (Transaction *trans);
|
||||||
void xaccTransSetCurrency (Transaction *trans, gnc_commodity *curr);
|
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
|
/* The xaccTransGetImbalance() method returns the total value of the
|
||||||
* transaction. In a pure double-entry system, this imbalance
|
* transaction. In a pure double-entry system, this imbalance
|
||||||
* should be exactly zero, and if it is not, something is broken.
|
* 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,
|
void xaccSplitSetSharePriceAndAmount (Split *split, gnc_numeric price,
|
||||||
gnc_numeric amount);
|
gnc_numeric amount);
|
||||||
#define xaccSplitSetAmount xaccSplitSetShareAmount
|
void xaccSplitSetAmount (Split *split, gnc_numeric amount);
|
||||||
void xaccSplitSetShareAmount (Split *split, gnc_numeric amount);
|
|
||||||
void xaccSplitSetSharePrice (Split *split, gnc_numeric price);
|
void xaccSplitSetSharePrice (Split *split, gnc_numeric price);
|
||||||
void xaccSplitSetValue (Split *split, gnc_numeric value);
|
void xaccSplitSetValue (Split *split, gnc_numeric value);
|
||||||
void xaccSplitSetBaseValue (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.
|
* 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 xaccSplitGetBalance (Split *split);
|
||||||
gnc_numeric xaccSplitGetClearedBalance (Split *split);
|
gnc_numeric xaccSplitGetClearedBalance (Split *split);
|
||||||
gnc_numeric xaccSplitGetReconciledBalance (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,
|
gnc_numeric xaccSplitGetBaseValue (Split *split,
|
||||||
const gnc_commodity * base_currency);
|
const gnc_commodity * base_currency);
|
||||||
|
|
||||||
@ -441,8 +385,7 @@ double DxaccSplitGetShareAmount (Split * split);
|
|||||||
double DxaccSplitGetSharePrice (Split * split);
|
double DxaccSplitGetSharePrice (Split * split);
|
||||||
double DxaccSplitGetValue (Split * split);
|
double DxaccSplitGetValue (Split * split);
|
||||||
|
|
||||||
#define xaccSplitGetAmount xaccSplitGetShareAmount
|
gnc_numeric xaccSplitGetAmount (Split * split);
|
||||||
gnc_numeric xaccSplitGetShareAmount (Split * split);
|
|
||||||
gnc_numeric xaccSplitGetSharePrice (Split * split);
|
gnc_numeric xaccSplitGetSharePrice (Split * split);
|
||||||
gnc_numeric xaccSplitGetValue (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: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(
|
xmlAddChild(ret, guid_to_dom_tree(
|
||||||
"split:account",
|
"split:account",
|
||||||
@ -271,7 +271,7 @@ spl_value_handler(xmlNodePtr node, gpointer spl)
|
|||||||
static gboolean
|
static gboolean
|
||||||
spl_quantity_handler(xmlNodePtr node, gpointer spl)
|
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
|
static gboolean
|
||||||
|
@ -965,7 +965,7 @@ readTransaction( int fd, Account *acc, int revision)
|
|||||||
xaccTransCommitEdit (trans);
|
xaccTransCommitEdit (trans);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
xaccTransSetDateTS (trans, &ts);
|
xaccTransSetDatePostedTS (trans, &ts);
|
||||||
|
|
||||||
/* then the entered date ... */
|
/* then the entered date ... */
|
||||||
rc = readTSDate( fd, &ts, revision );
|
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);
|
xaccSplitSetReconcile (s, sl->split->reconciled);
|
||||||
xaccSplitSetDateReconciledTS (s, (Timespec *)&sl->split->date_reconciled);
|
xaccSplitSetDateReconciledTS (s, (Timespec *)&sl->split->date_reconciled);
|
||||||
xaccSplitSetValue (s, *((gnc_numeric *)&(sl->split->value)));
|
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);
|
s->kvp_data = rpcend_parse_gnckvp (sl->split->kvp_data);
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ define(`split', `gncEntry, Split, Split, e,
|
|||||||
action, , char *, xaccSplitGetAction(ptr),
|
action, , char *, xaccSplitGetAction(ptr),
|
||||||
reconciled, , char, xaccSplitGetReconcile(ptr),
|
reconciled, , char, xaccSplitGetReconcile(ptr),
|
||||||
date_reconciled, , Timespec, xaccSplitRetDateReconciledTS(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)),
|
value, , int64, gnc_numeric_num(xaccSplitGetValue(ptr)),
|
||||||
entryGUID, KEY, GUID *, xaccSplitGetGUID(ptr),
|
entryGUID, KEY, GUID *, xaccSplitGetGUID(ptr),
|
||||||
')
|
')
|
||||||
|
@ -74,7 +74,7 @@ is_trans_empty (Transaction *trans)
|
|||||||
if (1 != xaccTransCountSplits(trans)) return FALSE;
|
if (1 != xaccTransCountSplits(trans)) return FALSE;
|
||||||
|
|
||||||
s = xaccTransGetSplit(trans, 0);
|
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 (TRUE != gnc_numeric_zero_p(xaccSplitGetValue(s))) return FALSE;
|
||||||
if ('n' != xaccSplitGetReconcile(s)) return FALSE;
|
if ('n' != xaccSplitGetReconcile(s)) return FALSE;
|
||||||
if (0 != (xaccSplitGetMemo(s))[0]) return FALSE;
|
if (0 != (xaccSplitGetMemo(s))[0]) return FALSE;
|
||||||
@ -571,7 +571,7 @@ pgendCopyTransactionToEngine (PGBackend *be, const GUID *trans_guid)
|
|||||||
modity = xaccAccountGetCommodity (acc);
|
modity = xaccAccountGetCommodity (acc);
|
||||||
acct_frac = gnc_commodity_get_fraction (modity);
|
acct_frac = gnc_commodity_get_fraction (modity);
|
||||||
amount = gnc_numeric_create (num, acct_frac);
|
amount = gnc_numeric_create (num, acct_frac);
|
||||||
xaccSplitSetShareAmount (s, amount);
|
xaccSplitSetAmount (s, amount);
|
||||||
|
|
||||||
xaccTransAppendSplit (trans, s);
|
xaccTransAppendSplit (trans, s);
|
||||||
|
|
||||||
|
@ -391,7 +391,7 @@ stock_split_finish (GnomeDruidPage *druidpage,
|
|||||||
|
|
||||||
xaccAccountInsertSplit (account, split);
|
xaccAccountInsertSplit (account, split);
|
||||||
|
|
||||||
xaccSplitSetShareAmount (split, amount);
|
xaccSplitSetAmount (split, amount);
|
||||||
xaccSplitMakeStockSplit (split);
|
xaccSplitMakeStockSplit (split);
|
||||||
xaccSplitSetAction (split, _("Split"));
|
xaccSplitSetAction (split, _("Split"));
|
||||||
|
|
||||||
@ -450,7 +450,7 @@ stock_split_finish (GnomeDruidPage *druidpage,
|
|||||||
|
|
||||||
xaccTransAppendSplit (trans, split);
|
xaccTransAppendSplit (trans, split);
|
||||||
|
|
||||||
xaccSplitSetShareAmount (split, amount);
|
xaccSplitSetAmount (split, amount);
|
||||||
xaccSplitSetValue (split, amount);
|
xaccSplitSetValue (split, amount);
|
||||||
|
|
||||||
xaccSplitSetMemo (split, memo);
|
xaccSplitSetMemo (split, memo);
|
||||||
@ -469,7 +469,7 @@ stock_split_finish (GnomeDruidPage *druidpage,
|
|||||||
|
|
||||||
xaccTransAppendSplit (trans, split);
|
xaccTransAppendSplit (trans, split);
|
||||||
|
|
||||||
xaccSplitSetShareAmount (split, gnc_numeric_neg (amount));
|
xaccSplitSetAmount (split, gnc_numeric_neg (amount));
|
||||||
xaccSplitSetValue (split, gnc_numeric_neg (amount));
|
xaccSplitSetValue (split, gnc_numeric_neg (amount));
|
||||||
|
|
||||||
xaccSplitSetMemo (split, memo);
|
xaccSplitSetMemo (split, memo);
|
||||||
|
@ -470,7 +470,6 @@ gnc_reconcile_list_reconciled_balance (GNCReconcileList *list)
|
|||||||
GtkCList *clist = GTK_CLIST(list);
|
GtkCList *clist = GTK_CLIST(list);
|
||||||
Split *split;
|
Split *split;
|
||||||
gnc_numeric total;
|
gnc_numeric total;
|
||||||
int account_type;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
total = gnc_numeric_zero ();
|
total = gnc_numeric_zero ();
|
||||||
@ -481,8 +480,6 @@ gnc_reconcile_list_reconciled_balance (GNCReconcileList *list)
|
|||||||
if (list->reconciled == NULL)
|
if (list->reconciled == NULL)
|
||||||
return total;
|
return total;
|
||||||
|
|
||||||
account_type = xaccAccountGetType (list->account);
|
|
||||||
|
|
||||||
for (i = 0; i < list->num_splits; i++)
|
for (i = 0; i < list->num_splits; i++)
|
||||||
{
|
{
|
||||||
split = gtk_clist_get_row_data (clist, 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)
|
if (g_hash_table_lookup (list->reconciled, split) == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ((account_type == STOCK) || (account_type == MUTUAL) ||
|
total = gnc_numeric_add_fixed (total, xaccSplitGetAmount(split));
|
||||||
(account_type == CURRENCY))
|
|
||||||
total = gnc_numeric_add_fixed (total, xaccSplitGetShareAmount(split));
|
|
||||||
else
|
|
||||||
total = gnc_numeric_add_fixed (total, xaccSplitGetValue(split));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return gnc_numeric_abs (total);
|
return gnc_numeric_abs (total);
|
||||||
@ -654,7 +647,6 @@ gnc_reconcile_list_fill(GNCReconcileList *list)
|
|||||||
{
|
{
|
||||||
const gchar *strings[list->num_columns + 1];
|
const gchar *strings[list->num_columns + 1];
|
||||||
GNCPrintAmountInfo print_info;
|
GNCPrintAmountInfo print_info;
|
||||||
GNCAccountType account_type;
|
|
||||||
Transaction *trans;
|
Transaction *trans;
|
||||||
gboolean auto_check;
|
gboolean auto_check;
|
||||||
GList *splits;
|
GList *splits;
|
||||||
@ -664,7 +656,6 @@ gnc_reconcile_list_fill(GNCReconcileList *list)
|
|||||||
"Check off cleared transactions",
|
"Check off cleared transactions",
|
||||||
TRUE);
|
TRUE);
|
||||||
|
|
||||||
account_type = xaccAccountGetType (list->account);
|
|
||||||
strings[5] = NULL;
|
strings[5] = NULL;
|
||||||
|
|
||||||
print_info = gnc_account_print_info (list->account, FALSE);
|
print_info = gnc_account_print_info (list->account, FALSE);
|
||||||
@ -682,10 +673,7 @@ gnc_reconcile_list_fill(GNCReconcileList *list)
|
|||||||
if ((recn != NREC) && (recn != CREC))
|
if ((recn != NREC) && (recn != CREC))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if((account_type == STOCK) || (account_type == MUTUAL))
|
amount = xaccSplitGetAmount (split);
|
||||||
amount = xaccSplitGetShareAmount (split);
|
|
||||||
else
|
|
||||||
amount = xaccSplitGetValue (split);
|
|
||||||
|
|
||||||
if (gnc_numeric_negative_p (amount) && list->list_type == RECLIST_DEBIT)
|
if (gnc_numeric_negative_p (amount) && list->list_type == RECLIST_DEBIT)
|
||||||
continue;
|
continue;
|
||||||
|
@ -132,7 +132,7 @@
|
|||||||
(account-comm (gnc:account-get-commodity
|
(account-comm (gnc:account-get-commodity
|
||||||
(gnc:split-get-account a)))
|
(gnc:split-get-account a)))
|
||||||
(share-amount (gnc:numeric-abs
|
(share-amount (gnc:numeric-abs
|
||||||
(gnc:split-get-share-amount a)))
|
(gnc:split-get-amount a)))
|
||||||
(value-amount (gnc:numeric-abs
|
(value-amount (gnc:numeric-abs
|
||||||
(gnc:split-get-value a)))
|
(gnc:split-get-value a)))
|
||||||
(transaction-date (gnc:transaction-get-date-posted
|
(transaction-date (gnc:transaction-get-date-posted
|
||||||
@ -229,7 +229,7 @@
|
|||||||
(account-comm (gnc:account-get-commodity
|
(account-comm (gnc:account-get-commodity
|
||||||
(gnc:split-get-account a)))
|
(gnc:split-get-account a)))
|
||||||
(share-amount (gnc:numeric-abs
|
(share-amount (gnc:numeric-abs
|
||||||
(gnc:split-get-share-amount a)))
|
(gnc:split-get-amount a)))
|
||||||
(value-amount (gnc:numeric-abs
|
(value-amount (gnc:numeric-abs
|
||||||
(gnc:split-get-value a)))
|
(gnc:split-get-value a)))
|
||||||
(transaction-date (gnc:transaction-get-date-posted
|
(transaction-date (gnc:transaction-get-date-posted
|
||||||
@ -497,7 +497,7 @@
|
|||||||
(gnc:split-get-account a)))
|
(gnc:split-get-account a)))
|
||||||
;; Always use the absolute value here.
|
;; Always use the absolute value here.
|
||||||
(share-amount (gnc:numeric-abs
|
(share-amount (gnc:numeric-abs
|
||||||
(gnc:split-get-share-amount a)))
|
(gnc:split-get-amount a)))
|
||||||
(value-amount (gnc:numeric-abs
|
(value-amount (gnc:numeric-abs
|
||||||
(gnc:split-get-value a)))
|
(gnc:split-get-value a)))
|
||||||
(tmp (assoc transaction-comm sumlist))
|
(tmp (assoc transaction-comm sumlist))
|
||||||
|
@ -102,7 +102,7 @@
|
|||||||
(gnc:split-get-action split)
|
(gnc:split-get-action split)
|
||||||
(gnc:split-get-reconcile-state split)
|
(gnc:split-get-reconcile-state split)
|
||||||
(gnc:split-get-reconciled-date split)
|
(gnc:split-get-reconciled-date split)
|
||||||
(gnc:split-get-share-amount split)
|
(gnc:split-get-amount split)
|
||||||
(gnc:split-get-value split)))
|
(gnc:split-get-value split)))
|
||||||
|
|
||||||
;; Copy a scheme representation of a split onto a C split.
|
;; Copy a scheme representation of a split onto a C split.
|
||||||
@ -120,7 +120,7 @@
|
|||||||
(value (gnc:split-scm-get-value split-scm)))
|
(value (gnc:split-scm-get-value split-scm)))
|
||||||
(if memo (gnc:split-set-memo split memo))
|
(if memo (gnc:split-set-memo split memo))
|
||||||
(if action (gnc:split-set-action split action))
|
(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)))
|
(if value (gnc:split-set-value split value)))
|
||||||
(let ((account (gnc:account-lookup
|
(let ((account (gnc:account-lookup
|
||||||
(gnc:split-scm-get-account-guid split-scm))))
|
(gnc:split-scm-get-account-guid split-scm))))
|
||||||
|
@ -60,13 +60,6 @@
|
|||||||
(define (gnc:extensions-menu-setup)
|
(define (gnc:extensions-menu-setup)
|
||||||
(define menu (gnc:make-menu "Extensions" (list "_Settings")))
|
(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
|
(define schedxact-editor-item
|
||||||
(gnc:make-menu-item (N_ "SchedXact: Editor")
|
(gnc:make-menu-item (N_ "SchedXact: Editor")
|
||||||
(N_ "Editor of Scheduled Transactions")
|
(N_ "Editor of Scheduled Transactions")
|
||||||
|
@ -431,8 +431,7 @@
|
|||||||
;; currency value from the file import.
|
;; currency value from the file import.
|
||||||
(set! near-split-total (n+ near-split-total split-amt))
|
(set! near-split-total (n+ near-split-total split-amt))
|
||||||
(gnc:split-set-value gnc-far-split (n- split-amt))
|
(gnc:split-set-value gnc-far-split (n- split-amt))
|
||||||
(gnc:split-set-share-amount gnc-far-split
|
(gnc:split-set-amount gnc-far-split (n- split-amt))
|
||||||
(n- split-amt))
|
|
||||||
|
|
||||||
(if memo (gnc:split-set-memo gnc-far-split memo))
|
(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.
|
;; 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-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:transaction-append-split gnc-xtn gnc-near-split)
|
||||||
(gnc:account-insert-split near-acct gnc-near-split))
|
(gnc:account-insert-split near-acct gnc-near-split))
|
||||||
|
|
||||||
@ -546,45 +545,45 @@
|
|||||||
(case qif-action
|
(case qif-action
|
||||||
((buy buyx reinvint reinvdiv reinvsg reinvsh reinvmd reinvlg)
|
((buy buyx reinvint reinvdiv reinvsg reinvsh reinvmd reinvlg)
|
||||||
(if (not share-price) (set! share-price (gnc:numeric-zero)))
|
(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-near-split split-amt)
|
||||||
(gnc:split-set-value gnc-far-split (n- 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)))
|
||||||
|
|
||||||
((sell sellx)
|
((sell sellx)
|
||||||
(if (not share-price) (set! share-price (gnc:numeric-zero)))
|
(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-near-split (n- split-amt))
|
||||||
(gnc:split-set-value gnc-far-split 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))
|
||||||
|
|
||||||
((cgshort cgshortx cgmid cgmidx cglong cglongx intinc intincx
|
((cgshort cgshortx cgmid cgmidx cglong cglongx intinc intincx
|
||||||
div divx miscinc miscincx xin rtrncap rtrncapx)
|
div divx miscinc miscincx xin rtrncap rtrncapx)
|
||||||
(gnc:split-set-value gnc-near-split xtn-amt)
|
(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-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)
|
((xout miscexp miscexpx margint margintx)
|
||||||
(gnc:split-set-value gnc-near-split (n- xtn-amt))
|
(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-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)
|
((shrsin)
|
||||||
;; getting rid of the old equity-acct-per-stock trick.
|
;; getting rid of the old equity-acct-per-stock trick.
|
||||||
;; you must now have a cash/basis value for the stock.
|
;; 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-near-split split-amt)
|
||||||
(gnc:split-set-value gnc-far-split (n- 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)))
|
||||||
|
|
||||||
((shrsout)
|
((shrsout)
|
||||||
;; shrsout is like shrsin
|
;; 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-near-split (n- split-amt))
|
||||||
(gnc:split-set-value gnc-far-split 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))
|
||||||
|
|
||||||
;; stock splits: QIF just specifies the split ratio, not
|
;; stock splits: QIF just specifies the split ratio, not
|
||||||
;; the number of shares in and out, so we have to fetch
|
;; the number of shares in and out, so we have to fetch
|
||||||
@ -597,8 +596,8 @@
|
|||||||
(in-shares
|
(in-shares
|
||||||
(gnc:account-get-balance near-acct))
|
(gnc:account-get-balance near-acct))
|
||||||
(out-shares (n* in-shares splitratio)))
|
(out-shares (n* in-shares splitratio)))
|
||||||
(gnc:split-set-share-amount gnc-near-split out-shares)
|
(gnc:split-set-amount gnc-near-split out-shares)
|
||||||
(gnc:split-set-share-amount gnc-far-split (n- in-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-near-split (n- split-amt))
|
||||||
(gnc:split-set-value gnc-far-split split-amt))))
|
(gnc:split-set-value gnc-far-split split-amt))))
|
||||||
|
|
||||||
@ -622,7 +621,7 @@
|
|||||||
(begin
|
(begin
|
||||||
(set! commission-split (gnc:split-create))
|
(set! commission-split (gnc:split-create))
|
||||||
(gnc:split-set-value commission-split commission-amt)
|
(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)
|
(if (and qif-near-acct qif-far-acct)
|
||||||
(begin
|
(begin
|
||||||
|
@ -491,10 +491,6 @@
|
|||||||
;; This works similar as above but returns a commodity-collector,
|
;; This works similar as above but returns a commodity-collector,
|
||||||
;; thus takes care of children accounts with different currencies.
|
;; 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>
|
;; Also note that the commodity-collector contains <gnc:numeric>
|
||||||
;; values rather than double values.
|
;; values rather than double values.
|
||||||
(define (gnc:account-get-comm-balance-at-date account
|
(define (gnc:account-get-comm-balance-at-date account
|
||||||
@ -521,7 +517,7 @@
|
|||||||
|
|
||||||
(if (and splits (not (null? splits)))
|
(if (and splits (not (null? splits)))
|
||||||
(balance-collector 'add (gnc:account-get-commodity account)
|
(balance-collector 'add (gnc:account-get-commodity account)
|
||||||
(gnc:split-get-share-balance (car splits))))
|
(gnc:split-get-balance (car splits))))
|
||||||
balance-collector))
|
balance-collector))
|
||||||
|
|
||||||
;; get the balance of a group of accounts at the specified date
|
;; get the balance of a group of accounts at the specified date
|
||||||
|
@ -132,7 +132,7 @@
|
|||||||
(currency (if account
|
(currency (if account
|
||||||
(gnc:account-get-commodity account)
|
(gnc:account-get-commodity account)
|
||||||
(gnc:default-currency)))
|
(gnc:default-currency)))
|
||||||
(damount (gnc:split-get-share-amount split))
|
(damount (gnc:split-get-amount split))
|
||||||
(split-value (gnc:make-gnc-monetary currency damount)))
|
(split-value (gnc:make-gnc-monetary currency damount)))
|
||||||
|
|
||||||
(if (date-col column-vector)
|
(if (date-col column-vector)
|
||||||
@ -170,7 +170,7 @@
|
|||||||
(if (shares-col column-vector)
|
(if (shares-col column-vector)
|
||||||
(addto! row-contents
|
(addto! row-contents
|
||||||
(if split-info?
|
(if split-info?
|
||||||
(gnc:split-get-share-amount split)
|
(gnc:split-get-amount split)
|
||||||
" ")))
|
" ")))
|
||||||
(if (price-col column-vector)
|
(if (price-col column-vector)
|
||||||
(addto! row-contents
|
(addto! row-contents
|
||||||
|
@ -337,7 +337,7 @@
|
|||||||
(currency (if account
|
(currency (if account
|
||||||
(gnc:account-get-commodity account)
|
(gnc:account-get-commodity account)
|
||||||
(gnc:default-currency)))
|
(gnc:default-currency)))
|
||||||
(damount (gnc:split-get-share-amount split))
|
(damount (gnc:split-get-amount split))
|
||||||
(split-value (gnc:make-gnc-monetary
|
(split-value (gnc:make-gnc-monetary
|
||||||
currency
|
currency
|
||||||
(if (member account-type account-types-to-reverse)
|
(if (member account-type account-types-to-reverse)
|
||||||
@ -378,7 +378,7 @@
|
|||||||
(addto! row-contents (gnc:split-get-corr-account-name split))))
|
(addto! row-contents (gnc:split-get-corr-account-name split))))
|
||||||
|
|
||||||
(if (used-shares column-vector)
|
(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)
|
(if (used-price column-vector)
|
||||||
(addto!
|
(addto!
|
||||||
row-contents
|
row-contents
|
||||||
|
Loading…
Reference in New Issue
Block a user