mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix OFX import problem with some dividends transactions. Patch by
David Reiser. #164645. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13503 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
56fe010a14
commit
4a1a07554b
@ -1,5 +1,8 @@
|
||||
2006-03-06 Christian Stimming <stimming@tuhh.de>
|
||||
|
||||
* src/import-export/ofx/gnc-ofx-import.c: Fix OFX import problem
|
||||
with some dividends transactions. Patch by David Reiser. #164645.
|
||||
|
||||
* src/import-export/import-backend.c: Fix crash when "clear" is
|
||||
chosen but no matching transaction is selected. Now those imported
|
||||
transactions will silently be ignored. #317917.
|
||||
|
@ -440,9 +440,7 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data, void * transaction_u
|
||||
}
|
||||
}
|
||||
if(income_account!=NULL&&
|
||||
(data.invtransactiontype==OFX_REINVEST||
|
||||
data.invtransactiontype==OFX_INCOME)
|
||||
)
|
||||
data.invtransactiontype==OFX_REINVEST)
|
||||
{
|
||||
DEBUG("Adding investment split; Money flows from the income account");
|
||||
split=xaccMallocSplit(book);
|
||||
@ -462,6 +460,27 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data, void * transaction_u
|
||||
xaccSplitSetMemo(split, data.memo);
|
||||
}
|
||||
}
|
||||
if(income_account!=NULL&&
|
||||
data.invtransactiontype==OFX_INCOME)
|
||||
{
|
||||
DEBUG("Adding investment split; Money flows from the income account");
|
||||
split=xaccMallocSplit(book);
|
||||
xaccTransAppendSplit(transaction,split);
|
||||
xaccAccountInsertSplit(income_account,split);
|
||||
|
||||
gnc_amount = double_to_gnc_numeric (-data.amount,/*OFX_INCOME amounts come in as positive numbers*/
|
||||
gnc_commodity_get_fraction(xaccTransGetCurrency(transaction)),
|
||||
GNC_RND_ROUND);
|
||||
xaccSplitSetBaseValue(split, gnc_amount, xaccTransGetCurrency(transaction));
|
||||
|
||||
/* Also put the ofx transaction name in the splits memo field, or ofx memo if name is unavailable */
|
||||
if(data.name_valid==true){
|
||||
xaccSplitSetMemo(split, data.name);
|
||||
}
|
||||
else if(data.memo_valid==true){
|
||||
xaccSplitSetMemo(split, data.memo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(data.invtransactiontype!=OFX_REINVEST)
|
||||
|
Loading…
Reference in New Issue
Block a user