Merge with trunk through 17173

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/branches/gda-dev2@17174 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Phil Longstaff committed 2008-05-25 22:50:06 +00:00
1 parent 30083659af
commit b353b3fcc9
50 files changed
+25276 -1370

No files matched your search

+4
View File
@@ -110,6 +110,7 @@ Terry Boldt <tboldt@attglobal.net> financial calculator and expression parser
Richard Braakman <dark@xs4all.nl> xml version configure patch
Simon Britnell <simon.britnell@peace.com> patch to RPM spec
Christopher B. Browne <cbbrowne@hex.net> for perl, lots of scheme and documentation updates
Nathan Buchanan <nbinont@yahoo.ca> packaging Windows binaries for release
Johan Buret <johanburet@free.fr> french translation
Thomas Bushnell <tb@becket.net> fix for file backups
Eskil Bylund <eskil.bylund@gmail.com> account type deprecation
@@ -151,11 +152,13 @@ Daniel Hagerty <hag@linnaean.org> patch to balance sheet report
Mitsuo Hamada <mhamada@redhat.com> messages Japanese translations
Otto Hammersmith <otto@bug.redhat.com> for RedHat RPM version
Eric Hanchrow <offby1@blarg.net> updated currency documentation
Daniel Harding <dharding@gmail.com> Windows build tweaks; various code fixes
Alexandru Harsanyi <haral@codec.ro> for core dumps, lockups, gtk work
John Hasler <john@dhh.gt.org> engine patch
Jon Kåre Hellan <hellan@acm.org> misc core dump fixes
Hendrik-Jan Heins <hjh@passys.nl> Dutch translation
Claus Hindsgaul <claus_h@image.dk> messages Danish translation
Ori Hoch <ori@uumpa.com> Hebrew translation
Péter Hosszú <hosszu@web.de> Hungarian translation
Edward J. Huff <ejhuff@huff20may77.us> Date handling in reports, quarterly option
Tomokazu Iwashita <iwashita@center.nitech.ac.jp> Japanese translation of xea
@@ -249,6 +252,7 @@ Nigel Titley <nigel@titley.com> British English translation
James A. Treacy <treacy@debian.org> doc patch
Arnold Troeger <troeger@samart.co.th> Mandrake packager
Diane Trout <detrout@earthlink.net> scheme QIF import patch
Nicolae Turcan <nicturcan@gmail.com> Romanian translation
Richard -Gilligan- Uschold <uschold@cs.ucf.edu> tax report & txf export
Matthew Vanecek <mevanecek@yahoo.com> lots of postgres backend work
Didier Vidal <didier-devel@9online.fr> various G2 fixes.
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

File renamed without changes.
+2
View File
@@ -4,6 +4,7 @@ checksdir = ${GNC_CHECKS_DIR}
if HAVE_GTK_2_10
checks_DATA = \
deluxe.chk \
liberty.chk \
quicken.chk \
quicken_wallet.chk
else
@@ -15,6 +16,7 @@ endif
EXTRA_DIST = \
deluxe.chk \
liberty.chk \
quicken.chk \
quicken_wallet.chk \
gnomeprint/deluxe.chk \
+23
View File
@@ -0,0 +1,23 @@
[Top]
Guid = 378e5740-a2d3-4678-be20-37d14d97b458
Title = Liberty(tm) Personal Checks US-Letter
Rotation = -90.0
Translation = 4;492
Show_Grid = false
Show_Boxes = false
[Check Items]
Type_1 = PAYEE
Coords_1 = 118.0;74.0
Type_2 = AMOUNT_WORDS
Coords_2 = 90.0;96.0
Type_3 = AMOUNT_NUMBER
Coords_3 = 415.0;74.0
Type_4 = DATE
Coords_4 = 323.0;43.0
Type_5 = NOTES
Coords_5 = 90.0;155.0
+1 -1
View File
@@ -74,7 +74,7 @@ AC_DEFINE_UNQUOTED(GNUCASH_MICRO_VERSION, $GNUCASH_MICRO_VERSION,
[GnuCash Micro version number])
dnl Set of available languages.
ALL_LINGUAS="ca cs da de de_CH el en_GB es_NI es eu fr hu it ja nb ne nl pl pt_BR pt ro ru rw sk sv ta tr uk vi zh_CN zh_TW"
ALL_LINGUAS="ca cs da de de_CH el en_GB es_NI es eu fr he hu it ja nb ne nl pl pt_BR pt ro ru rw sk sv ta tr uk vi zh_CN zh_TW"
GETTEXT_PACKAGE=gnucash
AC_SUBST(GETTEXT_PACKAGE)
+3 -3
View File
@@ -661,7 +661,7 @@ guid_match_predicate (gpointer object, QofParam *getter,
return (node == NULL);
break;
case QOF_GUID_MATCH_NULL:
return (guid == NULL);
return ((guid == NULL) || guid_equal(guid, guid_null()));
break;
default:
PWARN ("bad match type");
@@ -1383,7 +1383,7 @@ collect_match_predicate (gpointer object, QofParam *getter,
break;
}
case QOF_GUID_MATCH_NULL : {
return (guid == NULL);
return ((guid == NULL) || guid_equal(guid, guid_null()));
break;
}
default : {
@@ -1563,7 +1563,7 @@ choice_match_predicate (gpointer object, QofParam *getter,
return (node == NULL);
break;
case QOF_GUID_MATCH_NULL:
return (guid == NULL);
return ((guid == NULL) || guid_equal(guid, guid_null()));
break;
default:
PWARN ("bad match type");
+5
View File
@@ -58,6 +58,8 @@ if [ "$BUILD_FROM_TARBALL" = "yes" ]; then
else
# change this to "no" if you are using install.sh from the same repository checkout
set_default UPDATE_SOURCES yes
# latest revision that should compile, use HEAD or vwxyz
set_default SVN_REV "HEAD"
set_default GNUCASH_DIR $GLOBAL_DIR\\gnucash
set_default REPOS_URL "http://svn.gnucash.org/repo/gnucash/trunk"
set_default REPOS_DIR $GNUCASH_DIR\\repos
@@ -266,8 +268,11 @@ set_default LIBGDA_PATCH `pwd`/libgda-3.1.2-patch.diff
set_default LIBGDA_PATCH2 `pwd`/libgda-3.1.2-patch2.diff
set_default DOCBOOK_XSL_URL "$SF_MIRROR/docbook/docbook-xsl-1.72.0.zip"
set_default UPDATE_DOCS yes
set_default DOCS_REV "HEAD"
set_default DOCS_URL "http://svn.gnucash.org/repo/gnucash-docs/trunk"
set_default DOCS_DIR $GLOBAL_DIR\\gnucash-docs
set_default XSLTPROCFLAGS ""
##
# There is no reason to ever need to comment these out!
+11 -13
View File
@@ -959,8 +959,6 @@ function inst_libgda() {
function svn_up() {
mkdir -p $_REPOS_UDIR
qpushd $REPOS_DIR
# latest revision that should compile, use HEAD or vwxyz
SVN_REV="HEAD"
if [ -x .svn ]; then
setup "svn update in ${REPOS_DIR}"
svn up -r ${SVN_REV}
@@ -980,10 +978,8 @@ function inst_gnucash() {
mkdir -p $_BUILD_UDIR
add_to_env $_INSTALL_UDIR/bin PATH
# When aqbanking is enabled, uncomment this:
AQBANKING_OPTIONS="--enable-hbci --with-aqbanking-dir=${_AQBANKING_UDIR}"
AQBANKING_UPATH="${_OPENSSL_UDIR}/bin:${_GWENHYWFAR_UDIR}/bin:${_AQBANKING_UDIR}/bin"
AQBANKING_PATH="${OPENSSL_DIR}\\bin;${GWENHYWFAR_DIR}\\bin;${AQBANKING_DIR}\\bin"
LIBOFX_OPTIONS="--enable-ofx --with-ofx-prefix=${_LIBOFX_UDIR}"
qpushd $REPOS_DIR
@@ -1032,6 +1028,8 @@ function inst_gnucash() {
}
function make_install() {
AQBANKING_PATH="${OPENSSL_DIR}\\bin;${GWENHYWFAR_DIR}\\bin;${AQBANKING_DIR}\\bin"
make install
qpushd $_INSTALL_UDIR/lib
@@ -1078,7 +1076,7 @@ function make_chm() {
_CHM_LANG=$2
echo "Processing $_CHM_TYPE ($_CHM_LANG) ..."
qpushd $_CHM_TYPE/$_CHM_LANG
xsltproc ../../../docbook-xsl/htmlhelp/htmlhelp.xsl gnucash-$_CHM_TYPE.xml
xsltproc $XSLTPROCFLAGS ../../../docbook-xsl/htmlhelp/htmlhelp.xsl gnucash-$_CHM_TYPE.xml
count=0
echo >> htmlhelp.hhp
echo "[ALIAS]" >> htmlhelp.hhp
@@ -1112,14 +1110,14 @@ function inst_docs() {
fi
mkdir -p $_DOCS_UDIR/repos
qpushd $DOCS_DIR/repos
# latest revision that should compile, use HEAD or vwxyz
SVN_REV="HEAD"
if [ -x .svn ]; then
setup "SVN update of docs"
svn up -r ${SVN_REV}
else
setup "SVN checkout of docs"
svn co -r ${SVN_REV} $DOCS_URL .
if [ "$UPDATE_DOCS" = "yes" ]; then
if [ -x .svn ]; then
setup "SVN update of docs"
svn up -r ${DOCS_REV}
else
setup "SVN checkout of docs"
svn co -r ${DOCS_REV} $DOCS_URL .
fi
fi
setup docs
_DOCS_INST_UDIR=`unix_path $INSTALL_DIR`/share/gnucash/help
+760
View File
@@ -0,0 +1,760 @@
# Glossary of terms in GnuCash
# Copyright (C) 2008 Free Software Foundation, Inc.
# Ori Hoch <ori@uumpa.com>, 2008
# http://www.uumpa.com/gnucash-he/
#
msgid ""
msgstr ""
"Project-Id-Version: gnucash 2.2\n"
"POT-Creation-Date: 2008-04-18 00:32+0300\n"
"PO-Revision-Date: 2008-04-23 00:04+0200\n"
"Last-Translator: Ori Hoch <ori@uumpa.com>\n"
"Language-Team: HE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. "English Definition (Dear translator: This file will never be visible to the user! It should only serve as a tool for you, the translator. Nothing more.)"
msgid "Term (Dear translator: This file will never be visible to the user!)"
msgstr "מונח"
#. "A detailed record of money spent and received"
msgid "account"
msgstr "חשבון"
#. "-"
msgid "account code"
msgstr "קוד חשבון"
#. "the tree view of all accounts"
msgid "account hierarchy"
msgstr "היררכית חשבונות"
#. "-"
msgid "account name"
msgstr "שם חשבון"
#. "A thing, esp. owned by a person or company, that has value and can be used or sold to pay debts"
msgid "account type: Asset"
msgstr "נכס"
#. "(esp. US) (Brit = current account) a bank account from which money can be withdrawn without previous notice"
msgid "account type: checking"
msgstr "עובר ושב"
#. "-"
msgid "account type: currency"
msgstr "מטבע"
#. "see: Equity"
msgid "account type: Equity"
msgstr "זכות"
#. "-"
msgid "account type: Expense"
msgstr "הוצאות"
#. "-"
msgid "account type: Income"
msgstr "הכנסות"
#. "A debt, a financial obligation"
msgid "account type: Liability"
msgstr "חוב"
#. "-"
msgid "account type: money-market"
msgstr "שוק ההון"
#. "-"
msgid "account type: Mutual fund"
msgstr "קרן נאמנות"
#. "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
msgid "account type: saving"
msgstr "חיסכון"
#. "-"
msgid "account type: Stock"
msgstr "מניות"
#. "-"
msgid "account: parent account"
msgstr "חשבון אב"
#. "-"
msgid "account: subaccount"
msgstr "תת חשבון"
#. "-"
msgid "account: top level account"
msgstr "חשבון ראשי"
#. "The process of doing something that caused a transaction to happen"
msgid "Action (register)"
msgstr "פעולה"
#. "Automated teller machine"
msgid "action: ATM"
msgstr "כספומט"
#. "Transaction was an auto deposit"
msgid "action: autoDep"
msgstr "הפקדה אוטומטית"
#. "-"
msgid "action: buy"
msgstr "קניה"
#. "-"
msgid "action: deposit"
msgstr "הפקדה"
#. "When people can automatically deduct money straight from your account. The reverse of Direct Deposit."
msgid "action: direct debit"
msgstr "חיוב ישיר"
#. "transaction is a distribution (???)"
msgid "action: dist"
msgstr "הפצה"
#. "transaction is a dividend"
msgid "action: div"
msgstr "דיבידנד"
#. "-"
msgid "action: fee"
msgstr "עמלה"
#. "transaction comes from interest"
msgid "action: int"
msgstr "ריבית"
#. "-"
msgid "action: loan"
msgstr "הלוואה"
#. "see: payment 1."
msgid "action: payment"
msgstr "תשלום"
#. "-"
msgid "action: POS"
msgstr "נקודת מכירה"
#. "-"
msgid "action: rebate"
msgstr "זיכוי"
#. "-"
msgid "action: sell"
msgstr "מכירה"
#. "-"
msgid "action: Teller"
msgstr "כספר"
#. "see: transfer 2. (=credit transfer)"
msgid "action: transfer"
msgstr "העברה"
#. "-"
msgid "action: wire"
msgstr ""
#. "-"
msgid "action: withdraw"
msgstr "משיכה"
#. "A sum of money"
msgid "amount"
msgstr "סכום"
#. "The result of adding several amounts together and then dividing this total by the number of amounts"
msgid "average"
msgstr "ממוצע"
#. "The amount of money that is in one's account"
msgid "balance (noun)"
msgstr "מאזן"
#. "A written record of money received and paid out, showing the difference between the two total amounts"
msgid "balance sheet"
msgstr "מאזן"
#. "To arrange for income and spending to be equal"
msgid "balance, to"
msgstr "לאזן"
#. "-"
msgid "bank"
msgstr "בנק"
#. "A written statement of money owed for goods or services supplied. In Gnucash, a 'bill' is a statement that we received (from a vendor), whereas an 'invoice' is one that we sent out (to a customer)."
msgid "bill"
msgstr "חשבון"
#. "Conditions on paying a bill. Both an invoice and a bill have billing terms. For example, you can have 'terms' of 'Net-30', where the bill is due in full in 30 days."
msgid "billing terms"
msgstr "תנאי תשלום"
#. "The dataset that encapsulates all the collections of entities (accounts etc.) in gnucash. The written records of the financial affairs of a business."
msgid "Book"
msgstr "ספר"
#. "Completing the records of financial affairs for a specific time period, e.g. at the end of the year."
msgid "book closing"
msgstr "סגירת ספר"
#. "An estimate or plan of the money available to somebody and how it will be spent over a period of time."
msgid "Budget"
msgstr "תקציב"
#. "-"
msgid "business (adjective)"
msgstr "עסקי"
#. "as Menu Item: Headline for features that are related to small business accounting"
msgid "business (noun)"
msgstr "עסק"
#. "Profits made from the sale of investments or property"
msgid "capital gains"
msgstr "תשואה"
#. "Distinguishing the uppercase and lowercase letters"
#, fuzzy
msgid "case sensitive"
msgstr "מבדיל בין אותיות גדולות לקטנות"
#. "Money in coins or notes"
msgid "cash"
msgstr "מזומן"
#. "(esp. US) (= cheque) A special printed form on which one writes an order to a bank to pay a sum of money from one's account to another person"
msgid "check"
msgstr "המחאה"
#. "To repair unbalanced transactions and orphan splits in an account tree. Any transactions that have debits != credits will get a balancing split added (pointing to a special new account called 'Imbalance'). Any splits that do not have accounts are put into another special account called 'Orphan'. Formerly known as 'to scrub'."
msgid "check and repair, to"
msgstr "לבדוק ולתקן"
#. "To end an application's relationship with an open file so that the application will no longer be able to access the file without opening it again. "
msgid "close, to"
msgstr "לסגור"
#. "An article that is bought and sold. The most general term of what an account keeps track of, e.g. a currency or a stock."
msgid "commodity"
msgstr "מטבע"
#. "e.g. NASDAQ"
msgid "commodity listing"
msgstr "בורסה"
#. "the smallest amount of a commodity that's traded (e.g. 1/100 for USD, 1 for most stocks)"
msgid "commodity option: fraction"
msgstr "שבר"
#. "e.g. USD, DEM"
msgid "commodity option: Symbol"
msgstr "סמל"
#. "(a) A sum of money paid into an account. (b) A record of such a payment. (c) The state of having money in one's bank account."
msgid "Credit (column in register)"
msgstr ""
#. "-"
msgid "Credit Card"
msgstr "כרטיס אשראי"
#. "A transfer of money direct from one bank account to another, without using a cheque"
msgid "credit transfer"
msgstr "העברה בנקאית"
#. "The system of money used in a country"
msgid "currency"
msgstr "מטבע"
#. "Custom print format (i.e. according to the user's wishes) as opposed to a template choice."
msgid "Custom"
msgstr "מותאם אישית"
#. "The backend where the data is stored."
msgid "database"
msgstr "מסד נתונים"
#. "A specific numbered day of the month"
msgid "Date"
msgstr "תאריך"
#. "DD/MM/YY or MM/DD/YY or something else"
msgid "date format"
msgstr "מבנה התאריך"
#. "A range in time that is delimited by two distinct dates."
msgid "date range"
msgstr "טווח תאריכים"
#. "(a) A written note in an account of a sum owed or paid out. (b) A sum withdrawn from an account."
msgid "Debit (column in register)"
msgstr ""
#. "Each option has a default setting that it is shipped with, until the user changes the setting."
msgid "default"
msgstr "ברירת מחדל"
#. "see credit"
msgid "deposit (in the reconcile dialog)"
msgstr ""
#. "The process of something becoming less valuable"
msgid "depreciation"
msgstr ""
#. "1. One textfield per transaction. The text in it should describe what the transaction was about. A short descriptive phrase (up to 40 chars) 2. One textfield per account. It is intended to be a longer, 1-5 sentence description of what this account is all about."
msgid "Description (column in register)"
msgstr "תיאור"
#. "Important Buzzword :)"
msgid "double entry"
msgstr "הכנסה כפולה"
#. "a person who works for somebody or a company in return for wages"
msgid "employee"
msgstr "עובד"
#. "1. The money value of a property after all charges on it have been paid. Equity isn't debt, it's a representation of long-term capital (So combining it with liability isn't really very meaningful, except in the balance sheet. 2. (a) The value of the shares issued by a company. (b) Ordinary stocks and shares that carry no fixed interest."
msgid "equity"
msgstr "הון עצמי"
#. "Report that ... FIXME: Add description."
msgid "equity statement"
msgstr ""
#. "A trusted third party that holds a payment or deposit until a transaction is completed. In the US, many mortgage companies set up an escrow account when you get a mortgage. You pay into the account every month and they disburse amounts out of the escrow to pay for hazard insurance and property taxes. So they are holding funds 'in escrow' to complete the transactions (paying insurance and taxes)."
msgid "escrow (account)"
msgstr ""
#. "The relation in value between the money used in different countries"
msgid "exchange rate"
msgstr "שער חליפין"
#. "in the account creation dialog??"
msgid "field"
msgstr "שדה"
#. "Any piece of information (text, graphics, executable) put together and given a name. All the information you have on the hard drive is arranged as a collection of files."
msgid "file"
msgstr "קובץ"
#. "-"
msgid "file type"
msgstr "סוג קובץ"
#. "-"
#, fuzzy
msgid "financial calculator: interest rate"
msgstr "מחשבון עם מצבים פיננסיים ומדעיים"
#. "see: payment"
#, fuzzy
msgid "financial calculator: payments"
msgstr "מקש קיצור למחשבון"
#. "An increase in wealth; profit; advantage (See also: capital gains)"
msgid "gain"
msgstr "רווח"
#. "Name of an automaticly created account to get imbalanced transactions back in balance"
msgid "imbalance"
msgstr ""
#. "Process of extracting data from a non-Gnucash format into a Gnucash file. E.g. QIF Import."
msgid "import"
msgstr "ייבוא"
#. "Report that ... FIXME: add description. This report used to be called the 'Profit & Loss', but it was renamed on 2004-07-13."
#, fuzzy
msgid "income statement"
msgstr "תילכת-תלוטנ הארוה"
#. "Money charged for borrowing money, or paid to somebody who invests money"
msgid "interest"
msgstr "ריבית"
#. "A list of goods sold or services provided together with the prices charged; see also: a bill. In Gnucash, an 'invoice' is a statement that we sent out (to a customer), whereas a 'bill' is one that we received (from a vendor)."
msgid "invoice"
msgstr "קבלה"
#. "In business accounting: Jobs are a mechanism by which you can group multiple invoices or bills that belong to the same customer or vendor. The job describes a (larger) piece of work or a task undertaken on order, for which one or many invoices or bills will be issued."
#, fuzzy
msgid "job"
msgstr "%s משימה #%d"
#. "A book in which a bank, business firm, etc. records its financial accounts"
msgid "ledger"
msgstr "ספר חשבונות"
#. "The heading for the right side of the balance sheet. See also: Equity."
msgid "liabilities/equity"
msgstr ""
#. "A sum of money that is lent (by a bank)"
msgid "loan"
msgstr "הלוואה"
#. "The money lost in business activity"
msgid "loss"
msgstr "הפסד"
#. "name of an automatically created account"
#, fuzzy
msgid "Lost Accounts"
msgstr "The accounts list"
#. "A particular collection of items that were bought in one transaction. A lot is typically formed when the item is bought, and is closed when the item is sold out. Needed e.g. for U.S. tax purposes."
msgid "Lot"
msgstr ""
#. "Combine two books into one (see book)."
msgid "merge, to"
msgstr "לאחד"
#. "The thing that the scatter plot uses to mark each data point"
msgid "marker"
msgstr ""
#. "The way how more than one window is displayed in GnuCash at the same time. MDI = Multiple Document Interface."
#, fuzzy
msgid "MDI modus"
msgstr "Accessible MDI Value"
#. "One textfield per split that should help you remember what this split was about."
msgid "Memo"
msgstr "תזכיר"
#. "(a) An agreement by which money is lent by a bank for buying a house or other property, the property being the security. (b) A sum of money lent in this way."
msgid "Mortgage"
msgstr "משכנתה"
#. "e.g. USD, DEM, see Currency."
msgid "national currency"
msgstr "מטבע לאומי"
#. "(of money) remaining when nothing more is to be taken away"
msgid "net"
msgstr "נטו"
#. "net total of all assets"
#, fuzzy
msgid "net assets"
msgstr "הספק רשת"
#. "The total income minus the total expenses of a given time period."
#, fuzzy
msgid "net profit"
msgstr "הספק רשת"
#. "Your net worth is your assets minus your liabilities. If your accounts are balanced, your net worth should equal your equity plus your net profit."
#, fuzzy
msgid "net worth"
msgstr "הספק רשת"
#. "One textfield per transaction that can hold explanatory text about the transaction."
msgid "notes (register)"
msgstr "רשימות"
#. "Abbreviation for: number; Field in a transaction. If this transaction was done by check, then the check number should be noted in this field."
msgid "Num (column in register)"
msgstr "מס'"
#. "to make accessible"
msgid "open, to"
msgstr "לפתוח"
#. "If an account starts with a non-zero balance, then this amount is called the opening balance."
msgid "opening balance"
msgstr "מאזן פתיחה"
#. "A menu choice in the graphical user interface that allows the user to specify how the application will act each time it is used. "
msgid "options"
msgstr "אפשרויות"
#. "Watch out: Although this word exists in gnucash program code, all that program code in gnucash is currently not activated. In the future, it will be used in business accounting as follows: A particular request to make or supply goods, but belonging to a (larger) job. Such a request can come from a customer or be sent to a vendor. An order will probably generate one invoice or bill."
#, fuzzy
msgid "order"
msgstr "סדר"
#. "Name of an automatically created account that holds splits that have no account."
msgid "orphan"
msgstr ""
#. "A secret phrase that one needs to know in order to get access to a user account "
msgid "passphrase"
msgstr "סיסמה"
#. "An amount that must be paid / An amount for which money has not yet been received"
msgid "Payables/Receivables"
msgstr ""
#. "A person to whom sth is paid"
msgid "payee"
msgstr ""
#. "A person who pays or who has to pay for sth"
msgid "payer"
msgstr ""
#. "1. The action of paying sb/sth or of being paid. 2. A sum of money paid."
msgid "payment"
msgstr "תשלום"
#. "An account where no transactions may be posted to; transactions can only be posted to subaccounts of this account, so this account serves as a placeholder in the hierarchy"
msgid "placeholder"
msgstr ""
#. "A set of investments owned by a person"
msgid "portfolio"
msgstr ""
#. "A menu choice in many graphical user interface applications that allows the user to specify how the application will act each time it is used. "
msgid "preferences"
msgstr "מאפיינים"
#. "An amount of money for which sth may be bought or sold"
#, fuzzy
msgid "price (in a split)"
msgstr "הכפל לאחר פיצול"
#. "An ask is an offer to sell, and the price you want to sell at."
#, fuzzy
msgid "price type: ask"
msgstr "_שאל בכל פעם"
#. "A bid is an offer to buy, and the price you want to buy at."
#, fuzzy
msgid "price type: bid"
msgstr "סוג מדיה שבור"
#. "online quotes (rather: quotation!?) A statement of the current price of stocks or commodities"
#, fuzzy
msgid "price: quotes"
msgstr "ה&צג מרכאות"
#. "Money gained in business, esp. the difference between the amount earned and the amount spent"
msgid "profit"
msgstr ""
#. "OBSOLETE. This report was renamed to 'income statement' on 2004-07-13. Old definition: A list that shows the amount of money spent compared with the amount earned by a business in a particular period"
msgid "Profit & Loss"
msgstr ""
#. "-"
#, fuzzy
msgid "quick-fill"
msgstr "justify fill"
#. "-"
#, fuzzy
msgid "rebalance, to (a transaction)"
msgstr "לא מצליח לכתוב ל-%s"
#. "reconcile an account, a reconciled split. To find a way to make the bank's account statement agree with the user's recorded transactions in an account."
#, fuzzy
msgid "reconcile, to"
msgstr "%s (בגלל %s) "
#. "-"
#, fuzzy
msgid "record keeping"
msgstr "רישום ביבליוגרפי"
#. "A list of items; a book containing such a list"
#, fuzzy
msgid "register"
msgstr "הרשם"
#. "A transaction that is divided into two or more parts"
msgid "register entry: split transaction"
msgstr ""
#. "-"
msgid "register entry: stock split"
msgstr ""
#. "one form of register"
msgid "register: auto-split ledger"
msgstr ""
#. "another form of register"
#, fuzzy
msgid "register: basic ledger"
msgstr "מחשב אסטרטגיה בסיסית..."
#. "another form of register"
#, fuzzy
msgid "register: general ledger"
msgstr "מידע כללי"
#. "another form of register"
#, fuzzy
msgid "register: transaction journal"
msgstr "הירשם למאגר מקומי"
#. "reload the current document"
#, fuzzy
msgid "reload, to"
msgstr "%s (בגלל %s) "
#. "name of an equity account (?); to be distinguished from the opening balance."
msgid "Retained Earnings"
msgstr "Retained Earnings"
#. "Create a new transaction that is the inverse of the old one. When you add the two together they completely cancel out. Accounts use this instead of voiding transactions, usually because the prior month has been closed and can no longer be changed, or the entire accounting system is 'write only'."
msgid "reverse transaction, to (Action in the register)"
msgstr ""
#. "To write data (typically a file) to a storage medium, such as a disk or tape."
#, fuzzy
msgid "save, to (to a file)"
msgstr "_שמירה לקובץ..."
#. "A transaction or reminder of a transaction that can be automatically executed at a specific time. It can be executed either once, or several times at regular intervals."
#, fuzzy
msgid "Scheduled Transaction"
msgstr "מבצע משימות מתוזמנות"
#. "DEPRECATED. To repair unbalanced transactions and orphan splits in an account tree. Any transactions that have debits != credits will get a balancing split added (pointing to a special new account called 'Imbalance'). Any splits that do not have accounts are put into another special account called 'Orphan'. Deprecated - use the term 'to check and repair' now."
#, fuzzy
msgid "scrub, to"
msgstr "%s (בגלל %s) "
#. "A document or certificate showing who owns shares"
#, fuzzy
msgid "security"
msgstr "אבטחה"
#. "-"
#, fuzzy
msgid "Share Balance (register)"
msgstr "הירשם למאגר מקומי"
#. "Any of the equal parts into which the money of a business company is divided, giving the holder a right to a portion of the profits"
msgid "shares"
msgstr ""
#. "(of a price) A place wfrom which sth comes or is obtained"
#, fuzzy
msgid "source"
msgstr "מקור:‏"
#. "One of the two or several parts a transaction is divided into"
#, fuzzy
msgid "split"
msgstr "פצל"
#. "This sets the particular design or shape of a report."
#, fuzzy
msgid "style sheet"
msgstr "גיליון מסוגנן"
#. "The total of a set of figures that are part of a larger group of figures"
msgid "subtotal"
msgstr ""
#. "field of an account"
#, fuzzy
msgid "tax info"
msgstr "מידע על הפרויקט"
#. "if you create a new e.g. style sheet, you can start from a template"
#, fuzzy
msgid "template"
msgstr "תבנית"
#. "see: date range"
#, fuzzy
msgid "time period"
msgstr "קו זמן"
#. "as abbreviation for Total"
msgid "Tot"
msgstr ""
#. "The full number or amount: total of some balances, of any account's running balance etc."
#, fuzzy
msgid "total"
msgstr "סה\"כ"
#. "A piece of business done; the transfer of money from one account to one or more other accounts. (see also: Scheduled Transaction)"
msgid "transaction"
msgstr ""
#. "A transaction whose amount has actually been moved. The word comes from checks: a check is issued, but several steps have to be done until the amount is actually retrieved from the bank account, which is the point in time where that transaction (check) gets cleared."
msgid "transaction state: cleared"
msgstr "נוקה"
#. "-"
msgid "transaction state: frozen"
msgstr "הוקפא"
#. "A transaction that was reconciled with the bank's statement."
msgid "transaction state: reconciled"
msgstr "אושר"
#. "A transaction that is void i.e. not valid (anymore)."
msgid "transaction state: voided"
msgstr "שגוי"
#. "1. The action of transferring sth. 2. see: credit transfer"
#, fuzzy
msgid "transfer (noun)"
msgstr "ההעברה הושלמה"
#. "The account where an amount is transferred to"
#, fuzzy
msgid "transfer account"
msgstr "מספר _חשבון:"
#. "To move money from one account to another. Will create a transaction."
#, fuzzy
msgid "transfer, to (register toolbar)"
msgstr "How to draw the toolbar"
#. "The trial balance is a worksheet on which you list all your general ledger accounts and their debit or credit balance. It is a tool that is used to alert you to errors in your books. The total debits must equal the total credits. If they don't equal, you know you have an error that must be tracked down."
#, fuzzy
msgid "trial balance (report)"
msgstr "התגלה דיווח התרסקות"
#. "A class or things that have characteristics in common; type of an account, of a commodity etc."
#, fuzzy
msgid "type"
msgstr "<b>סוג:</b>"
#. "A fixed amount or number used as a standard of measurement; e.g. millimeters, inch; for absolute positioning in the custom check format."
#, fuzzy
msgid "units"
msgstr "יחידות"
#. "-"
msgid "URL"
msgstr "כתובת אינטרנט (‏‪URL‬‏)‏"
#. "The worth of sth in terms of money or other commodities for which it can be exchanged"
#, fuzzy
msgid "value (in a split)"
msgstr "Value in list"
#. "In small business accounting: A person or company that sells items and is supplying goods"
msgid "vendor"
msgstr "יצרן"
#. "The terms 'Voucher' and 'Expense Voucher' are used interchangeably in gnucash. The 'Expense Voucher' is also a bit of a misnomer -- it's more like an 'Expense Report' in gnucash. The phrase is meant to be a list of expenses incurred by an employee for which the company will reminburse them."
msgid "voucher"
msgstr ""
#. "see debit"
#, fuzzy
msgid "withdraw (in the reconcile dialog)"
msgstr "חלק מההגדרות בתיבת הדו-שיח מתנגשים"
+22037
View File
File diff suppressed because it is too large. Load diff
+1
View File
@@ -291,6 +291,7 @@ gnc_find_state_file (const gchar *url,
g_free(file_guid);
break;
}
g_free(file_guid);
/* Handle the case where gnucash was updated first, and is trying
* to find new key names in an old state files. */
+4 -1
View File
@@ -431,9 +431,12 @@ static gboolean
sx_schedule_recurrence_handler(xmlNodePtr node, gpointer parsing_data)
{
GList **schedule = (GList**)parsing_data;
gchar* sched_str;
Recurrence *r = dom_tree_to_recurrence(node);
g_return_val_if_fail(r, FALSE);
g_debug("parsed recurrence [%s]", recurrenceToString(r));
sched_str = recurrenceToString(r);
g_debug("parsed recurrence [%s]", sched_str);
g_free(sched_str);
*schedule = g_list_append(*schedule, r);
return TRUE;
}
+1 -1
View File
@@ -84,7 +84,7 @@ gnc_print_unstable_message(void)
_("This is a development version. It may or may not work.\n"),
_("Report bugs and other problems to gnucash-devel@gnucash.org.\n"),
_("You can also lookup and file bug reports at http://bugzilla.gnome.org\n"),
_("The last stable version was "), "GnuCash 2.2.4",
_("The last stable version was "), "GnuCash 2.2.5",
_("The next stable version will be "), "GnuCash 2.4");
}
@@ -73,6 +73,12 @@ gnc_dialog_date_close_ok_cb (GtkWidget *widget, gpointer user_data)
return;
}
if (xaccAccountGetPlaceholder (acc)) {
gnc_error_dialog (ddc->dialog,
_("Placeholder account selected. Please try again."));
return;
}
ddc->acct = acc;
}
@@ -28,6 +28,7 @@
#include "gnc-ui-util.h"
#include "gnc-component-manager.h"
#include "gnc-event.h"
#include "gnc-gconf-utils.h"
#include "gncEntry.h"
#include "gncEntryLedger.h"
@@ -70,6 +71,20 @@ gnc_entry_ledger_refresh_internal (GncEntryLedger *ledger, GList *entries)
ledger->loading = FALSE;
}
static void
gnc_entry_ledger_gconf_changed (GConfEntry *entry, gpointer user_data)
{
GncEntryLedger *ledger = user_data;
g_return_if_fail (ledger && entry && entry->key);
if (g_str_has_suffix (entry->key, KEY_ACCOUNT_SEPARATOR)) {
gnc_entry_ledger_display_refresh (ledger);
} else {
g_warning ("gnc_entry_gconf_changed: Unknown gconf key %s", entry->key);
}
}
static void
gnc_entry_ledger_set_watches (GncEntryLedger *ledger, GList *entries)
{
@@ -155,6 +170,9 @@ gnc_entry_ledger_display_init (GncEntryLedger *ledger)
ledger->component_id = gnc_register_gui_component (ENTRYLEDGER_CLASS,
refresh_handler,
NULL, ledger);
gnc_gconf_general_register_cb(KEY_ACCOUNT_SEPARATOR,
gnc_entry_ledger_gconf_changed, ledger);
gnc_entry_ledger_display_refresh (ledger);
}
@@ -164,6 +182,8 @@ gnc_entry_ledger_display_fini (GncEntryLedger *ledger)
if (!ledger) return;
gnc_unregister_gui_component (ledger->component_id);
gnc_gconf_general_remove_cb(KEY_ACCOUNT_SEPARATOR,
gnc_entry_ledger_gconf_changed, ledger);
}
void
+33 -32
View File
@@ -189,22 +189,45 @@
table))
;;
;; Make a row list based on the visible columns
;;
(define (make-row column-vector date due-date num type-str memo monetary)
(let ((row-contents '()))
(if (date-col column-vector)
(addto! row-contents (gnc-print-date date)))
(if (date-due-col column-vector)
(addto! row-contents
(if (and due-date
(not (equal? due-date (cons 0 0))))
(gnc-print-date due-date)
"")))
(if (num-col column-vector)
(addto! row-contents num))
(if (type-col column-vector)
(addto! row-contents type-str))
(if (memo-col column-vector)
(addto! row-contents memo))
(if (value-col column-vector)
(addto! row-contents
(gnc:make-html-table-cell/markup "number-cell" monetary)))
row-contents))
;;
;; Adds the 'Balance' row to the table if it has not been printed and
;; total is not zero
;;
;; Returns printed?
;;
(define (add-balance-row table txn odd-row? printed? start-date total)
(define (add-balance-row table column-vector txn odd-row? printed? start-date total)
(if (not printed?)
(begin
(set! printed? #t)
(if (not (gnc-numeric-zero-p total))
(let ((row (list (gnc-print-date start-date) "" "" "Balance" ""
(gnc:make-html-table-cell/markup "number-cell"
(gnc:make-gnc-monetary (xaccTransGetCurrency txn) total))))
(let ((row (make-row column-vector start-date #f "" (_ "Balance") ""
(gnc:make-gnc-monetary (xaccTransGetCurrency txn) total)))
(row-style (if odd-row? "normal-row" "alternate-row")))
(gnc:html-table-append-row/markup! table row-style row)
(gnc:html-table-append-row/markup! table row-style (reverse row))
(set! odd-row? (not odd-row?))
(set! row-style (if odd-row? "normal-row" "alternate-row")))
)))
@@ -238,29 +261,6 @@
(else (_ "Unknown"))))
)
(define (make-row date due-date num type-str memo value)
(let ((row-contents '()))
(if (date-col column-vector)
(addto! row-contents (gnc-print-date date)))
(if (date-due-col column-vector)
(addto! row-contents
(if (and due-date
(not (equal? due-date (cons 0 0))))
(gnc-print-date due-date)
"")))
(if (num-col column-vector)
(addto! row-contents num))
(if (type-col column-vector)
(addto! row-contents type-str))
(if (memo-col column-vector)
(addto! row-contents memo))
(if (value-col column-vector)
(addto! row-contents
(gnc:make-html-table-cell/markup "number-cell"
(gnc:make-gnc-monetary
currency value))))
row-contents))
(if reverse?
(set! value (gnc-numeric-neg value)))
@@ -268,14 +268,15 @@
(begin
; Adds 'balance' row if needed
(set! printed? (add-balance-row table txn odd-row? printed? start-date total))
(set! printed? (add-balance-row table column-vector txn odd-row? printed? start-date total))
; Now print out the invoice row
(if (not (null? invoice))
(set! due-date (gncInvoiceGetDateDue invoice)))
(let ((row (make-row date due-date (xaccTransGetNum txn)
type-str (xaccSplitGetMemo split) value))
(let ((row (make-row column-vector date due-date (xaccTransGetNum txn)
type-str (xaccSplitGetMemo split)
(gnc:make-gnc-monetary currency value)))
(row-style (if odd-row? "normal-row" "alternate-row")))
(gnc:html-table-append-row/markup! table row-style
@@ -325,7 +326,7 @@
;Balance row may not have been added if all transactions were before
;start-date (and no other rows would be added either) so add it now
(if (not (null? txns))
(add-balance-row table (car txns) odd-row? printed? start-date total)
(add-balance-row table used-columns (car txns) odd-row? printed? start-date total)
))
(gnc:html-table-append-row/markup!
+6 -2
View File
@@ -213,8 +213,10 @@ gnc_locale_from_utf8(const gchar* str)
/* Convert from UTF-8 to the encoding used in the current locale. */
locale_str = g_locale_from_utf8(str, -1, NULL, &bytes_written, &err);
if (err)
if (err) {
g_warning("g_locale_from_utf8 failed: %s", err->message);
g_error_free(err);
}
return locale_str;
}
@@ -228,8 +230,10 @@ gnc_locale_to_utf8(const gchar* str)
/* Convert to UTF-8 from the encoding used in the current locale. */
utf8_str = g_locale_to_utf8(str, -1, NULL, &bytes_written, &err);
if (err)
if (err) {
g_warning("g_locale_to_utf8 failed: %s", err->message);
g_error_free(err);
}
return utf8_str;
}
+8 -8
View File
@@ -30,7 +30,7 @@
@{ */
/** @file gnc-glib-utils.h
* @brief glib helper routines.
* @brief GLib helper routines
* @author Copyright (C) 2006 David Hampton <hampton@employees.org>
*/
@@ -57,10 +57,12 @@ int safe_utf8_collate (const char *str1, const char *str2);
/**
* @brief Validates UTF-8 encoded text for use in GnuCash.
*
* Validates the strict subset of UTF-8 that is valid XML text, as detailed in
* http://www.w3.org/TR/REC-xml/#NT-Char linked from bug #346535.
*
* (copied from g_utf8_validate):
* <em>Copied from g_utf8_validate():</em>
*
* Validates UTF-8 encoded text, where @a str is the text to validate; if
* @a str is nul-terminated, then @a max_len can be -1, otherwise @a max_len
* should be the number of bytes to validate. If @a end is non-%NULL, then the
@@ -107,9 +109,8 @@ void gnc_utf8_strip_invalid (gchar *str);
gchar *gnc_utf8_strip_invalid_strdup (const gchar* str);
/**
* @brief Converts a string from UTF-8 to the current locale.
* Converts a string from UTF-8 to the encoding used for strings
* in the current locale.
* @brief Converts a string from UTF-8 to the encoding used for
* strings in the current locale.
*
* This essentially is a wrapper for g_locale_from_utf8 that can
* be swigified for use with Scheme to avoid adding a dependency
@@ -122,9 +123,8 @@ gchar *gnc_utf8_strip_invalid_strdup (const gchar* str);
gchar *gnc_locale_from_utf8(const gchar* str);
/**
* @brief Converts a string to UTF-8 from the current locale.
* Converts a string to UTF-8 from the encoding used for strings
* in the current locale.
* @brief Converts a string to UTF-8 from the encoding used for
* strings in the current locale.
*
* This essentially is a wrapper for g_locale_to_utf8 that can
* be swigified for use with Scheme to avoid adding a dependency
+8 -1
View File
@@ -4403,6 +4403,7 @@ xaccAccountStagedTransactionTraversal (const Account *acc,
{
AccountPrivate *priv;
GList *split_p;
GList *next;
Transaction *trans;
Split *s;
int retval;
@@ -4410,7 +4411,13 @@ xaccAccountStagedTransactionTraversal (const Account *acc,
if (!acc) return 0;
priv = GET_PRIVATE(acc);
for(split_p = priv->splits; split_p; split_p = g_list_next(split_p)) {
for(split_p = priv->splits; split_p; split_p = next) {
/* Get the next element in the split list now, just in case some
* naughty thunk destroys the one we're using. This reduces, but
* does not eliminate, the possibility of undefined results if
* a thunk removes splits from this account. */
next = g_list_next(split_p);
s = split_p->data;
trans = s->parent;
if (trans && (trans->marker < stage)) {
+71 -61
View File
@@ -978,29 +978,33 @@ SplitList* xaccAccountGetSplitList (const Account *account);
void xaccAccountMoveAllSplits (Account *accfrom, Account *accto);
/** The xaccAccountForEachTransaction() routine will traverse all of
the transactions in the given 'account' and call the callback
function 'proc' on each transaction. Processing will continue
if-and-only-if 'proc' returns 0. The user data pointer
'data' will be passed on to the callback function 'proc'.
This function does not descend recursively to traverse transactions
in child accounts.
'proc' will be called exactly once for each transaction that is
pointed to by at least one split in the given account.
The result of this function will be 0 if-and-only-if
every relevant transaction was traversed exactly once.
Else the return value is the last non-zero value returned by proc.
Note that the traversal occurs only over the transactions that
are locally cached in the local gnucash engine. If the gnucash
engine is attached to a remote database, the database may contain
(many) transactions that are not mirrored in the local cache.
This routine will not cause an SQL database query to be performed;
it will not traverse transactions present only in the remote
database.
*/
* the transactions in @a account and call the callback
* function @a proc on each transaction. Processing will continue
* if-and-only-if @a proc returns 0. The user data pointer
* @a data will be passed on to the callback function @a proc.
*
* This function does not descend recursively to traverse transactions
* in child accounts.
*
* @a proc will be called exactly once for each transaction that is
* pointed to by at least one split in the given account.
*
* The result of this function will be 0 <em>if and only if</em>
* every relevant transaction was traversed exactly once.
* Else the return value is the last non-zero value returned by proc.
*
* \warning For performance reasons, the transaction callback @a proc
* must never destroy any of the transaction's splits, nor assign any
* of them to a different account. <b>To do so risks a crash.</b>
*
* \warning The traversal occurs only over the transactions that
* are locally cached in the local gnucash engine. If the gnucash
* engine is attached to a remote database, the database may contain
* (many) transactions that are not mirrored in the local cache.
* This routine will not cause an SQL database query to be performed;
* it will not traverse transactions present only in the remote
* database.
*/
gint xaccAccountForEachTransaction(const Account *account,
TransactionCallback proc,
void *data);
@@ -1278,16 +1282,17 @@ gboolean xaccTransactionTraverse(Transaction *trans, int stage);
*/
gboolean xaccSplitTransactionTraverse(Split *split, int stage);
/** xaccAccountStagedTransactionTraversal() calls thunk on each
* transaction in the account whose current marker is less than the
* given `stage' and updates each transaction's marker to be `stage'.
* The traversal will stop if thunk() returns a non-zero value.
/** xaccAccountStagedTransactionTraversal() calls @a thunk on each
* transaction in account @a a whose current marker is less than the
* given @a stage and updates each transaction's marker to be @a stage.
* The traversal will stop if @a thunk returns a non-zero value.
* xaccAccountStagedTransactionTraversal() function will return zero
* or the non-zero value returned by thunk().
* or the non-zero value returned by @a thunk.
* This API does not handle handle recursive traversals.
*
* Currently the result of adding or removing transactions during
* a traversal is undefined, so don't do that.
* \warning For performance reasons, the transaction callback @a thunk
* must never destroy any of the transaction's splits, nor assign any
* of them to a different account. <b>To do so risks a crash.</b>
*/
int xaccAccountStagedTransactionTraversal(const Account *a,
@@ -1295,16 +1300,17 @@ int xaccAccountStagedTransactionTraversal(const Account *a,
TransactionCallback thunk,
void *data);
/** gnc_account_tree_staged_transaction_traversal() calls thunk on each
/** gnc_account_tree_staged_transaction_traversal() calls @a thunk on each
* transaction in the group whose current marker is less than the
* given `stage' and updates each transaction's marker to be `stage'.
* The traversal will stop if thunk() returns a non-zero value.
* gnc_account_tree_staged_transaction_traversal() function will return zero
* or the non-zero value returned by thunk(). This
* given @a stage and updates each transaction's marker to be @a stage.
* The traversal will stop if @a thunk returns a non-zero value.
* gnc_account_tree_staged_transaction_traversal() function will return zero
* or the non-zero value returned by @a thunk. This
* API does not handle handle recursive traversals.
*
* Currently the result of adding or removing transactions during
* a traversal is undefined, so don't do that.
* \warning For performance reasons, the transaction callback @a thunk
* must never destroy any of the transaction's splits, nor assign any
* of them to a different account. <b>To do so risks a crash.</b>
*/
int gnc_account_tree_staged_transaction_traversal(const Account *account,
@@ -1313,30 +1319,34 @@ int gnc_account_tree_staged_transaction_traversal(const Account *account,
void *data);
/** Traverse all of the transactions in the given account group.
Continue processing IFF proc returns 0. This function
will descend recursively to traverse transactions in the
children of the accounts in the group.
Proc will be called exactly once for each transaction that is
pointed to by at least one split in any account in the hierarchy
topped by the root Account acc.
The result of this function will be 0 IFF every relevant
transaction was traversed exactly once; otherwise, the return
value is the last non-zero value returned by the callback.
Note that the traversal occurs only over the transactions that
are locally cached in the local gnucash engine. If the gnucash
engine is attached to a remote database, the database may contain
(many) transactions that are not mirrored in the local cache.
This routine will not cause an SQL database query to be performed;
it will not traverse transactions present only in the remote
database.
Note that this routine is just a trivial wrapper for
gnc_account_tree_begin_staged_transaction_traversals(g);
gnc_account_tree_staged_transaction_traversal(g, 42, proc, data);
* Continue processing IFF @a proc returns 0. This function
* will descend recursively to traverse transactions in the
* children of the accounts in the group.
*
* @a Proc will be called exactly once for each transaction that is
* pointed to by at least one split in any account in the hierarchy
* topped by the root Account @a acc.
*
* The result of this function will be 0 IFF every relevant
* transaction was traversed exactly once; otherwise, the return
* value is the last non-zero value returned by the callback.
*
* \warning For performance reasons, the transaction callback @a proc
* must never destroy any of the transaction's splits, nor assign any
* of them to a different account. <b>To do so risks a crash.</b>
*
* \warning The traversal occurs only over the transactions that
* are locally cached in the local gnucash engine. If the gnucash
* engine is attached to a remote database, the database may contain
* (many) transactions that are not mirrored in the local cache.
* This routine will not cause an SQL database query to be performed;
* it will not traverse transactions present only in the remote
* database.
*
* Note that this routine is just a trivial wrapper for
*
* gnc_account_tree_begin_staged_transaction_traversals(g);
* gnc_account_tree_staged_transaction_traversal(g, 42, proc, data);
*/
int xaccAccountTreeForEachTransaction(Account *acc,
+2 -1
View File
@@ -319,7 +319,8 @@ gnc_ui_to_account(AccountWindow *aw)
return;
}
if (aw->type != xaccAccountGetType (account)) {
if (aw->dialog_type == EDIT_ACCOUNT
&& aw->type != xaccAccountGetType (account)) {
/* Just refreshing won't work. */
aw_call_destroy_callbacks (account);
}
+4 -2
View File
@@ -974,13 +974,15 @@ gnc_option_create_list_widget(GNCOption *option, char *name, GtkTooltips *toolti
num_values = gnc_option_num_permissible_values(option);
for (i = 0; i < num_values; i++)
{
gchar *string;
gchar *raw_string, *string;
string = gnc_option_permissible_value_name(option, i);
raw_string = gnc_option_permissible_value_name(option, i);
string = (raw_string && *raw_string) ? _(raw_string) : "";
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
0, string ? string : "",
-1);
g_free(raw_string);
}
gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(view), FALSE, FALSE, 0);
+7 -4
View File
@@ -623,14 +623,17 @@ gnc_xfer_dialog_quickfill( XferDialog *xferData )
{
GNCAccountType other_type;
GtkWidget *other_button;
XferDirection other_direction;
DEBUG("updating other split");
if (xferData->quickfill == XFER_DIALOG_FROM) {
other_button = xferData->from_show_button;
other_button = xferData->to_show_button;
other_direction = XFER_DIALOG_TO;
}
else
{
other_button = xferData->to_show_button;
other_button = xferData->from_show_button;
other_direction = XFER_DIALOG_FROM;
}
other_type = xaccAccountGetType(other_acct);
@@ -641,7 +644,7 @@ gnc_xfer_dialog_quickfill( XferDialog *xferData )
if( (other_type == ACCT_TYPE_EXPENSE) || (other_type == ACCT_TYPE_INCOME) )
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(other_button), TRUE);
gnc_transfer_dialog_set_selected_account (xferData, other_acct, xferData->quickfill);
gnc_transfer_dialog_set_selected_account (xferData, other_acct, other_direction);
changed = TRUE;
}
+5 -3
View File
@@ -721,9 +721,9 @@ format_read_item_placement(const gchar * file,
}
g_free(key);
key = g_strdup_printf("%s_%d", KF_KEY_ALIGN, item_num);
value =
g_key_file_get_string(key_file, KF_GROUP_ITEMS, KF_KEY_ALIGN,
&error);
g_key_file_get_string(key_file, KF_GROUP_ITEMS, key, &error);
if (!error) {
g_debug("Check file %s, group %s, key %s, value: %s",
file, KF_GROUP_ITEMS, key, value);
@@ -744,6 +744,7 @@ format_read_item_placement(const gchar * file,
data->align = PANGO_ALIGN_LEFT;
g_clear_error(&error);
}
g_free(key);
}
/* Get any extra data for specific items. */
switch (data->type) {
@@ -1362,7 +1363,8 @@ draw_text(GncPrintContext * context, const gchar * text, check_item_t * data,
}
pango_layout_set_alignment(layout,
data->w ? data->align : PANGO_ALIGN_LEFT);
pango_layout_set_width(layout, -1);
pango_layout_set_width(layout, data->w ? data->w * PANGO_SCALE : -1);
pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_END);
if (gnc_gconf_get_bool(GCONF_SECTION, KEY_BLOCKING_CHARS, NULL)) {
new_text = g_strdup_printf("***%s***", text);
pango_layout_set_text(layout, new_text, -1);
-52
View File
@@ -86,8 +86,6 @@ static void gnc_split_reg_refresh_toolbar( GNCSplitReg *gsr );
static void gnc_split_reg_ld_destroy( GNCLedgerDisplay *ledger );
gboolean gnc_split_reg_check_close(GNCSplitReg *gsr);
void gsr_default_enter_handler ( GNCSplitReg *w, gpointer ud );
void gsr_default_cancel_handler ( GNCSplitReg *w, gpointer ud );
void gsr_default_delete_handler ( GNCSplitReg *w, gpointer ud );
@@ -695,56 +693,6 @@ gnc_split_reg_ld_destroy( GNCLedgerDisplay *ledger )
gnc_ledger_display_set_user_data (ledger, NULL);
}
gboolean
gnc_split_reg_check_close( GNCSplitReg *gsr )
{
GtkWidget *dialog;
gint response;
gboolean pending_changes;
SplitRegister *reg;
const char *title = _("Save transaction before closing?");
const char *message =
_("The current transaction has been changed. Would you like to "
"record the changes before closing this page, close the page "
"without recording the changes, or cancel the close?");
reg = gnc_ledger_display_get_split_register( gsr->ledger );
pending_changes = gnc_split_register_changed( reg );
if ( !pending_changes )
return TRUE;
dialog = gtk_message_dialog_new(GTK_WINDOW(gsr->window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_NONE,
"%s", title);
gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
"%s", message);
gtk_dialog_add_buttons(GTK_DIALOG(dialog),
_("_Don't Record"), GTK_RESPONSE_REJECT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
_("_Record"), GTK_RESPONSE_ACCEPT,
NULL);
response = gnc_dialog_run(GTK_DIALOG(dialog), "transaction_changed");
gtk_widget_destroy(dialog);
switch (response)
{
case GTK_RESPONSE_ACCEPT:
gnc_split_reg_record_trans_cb( gsr->window, gsr );
return TRUE;
case GTK_RESPONSE_REJECT:
gnc_split_register_cancel_cursor_trans_changes( reg );
return TRUE;
case GTK_RESPONSE_CANCEL:
default:
return FALSE;
}
return TRUE;
}
void
gsr_default_cut_handler( GNCSplitReg *gsr, gpointer data )
{
-9
View File
@@ -206,15 +206,6 @@ GtkWidget *gnc_split_reg_get_summarybar( GNCSplitReg *gsr );
void gnc_split_reg_set_split_state( GNCSplitReg *gsr, gboolean split );
void gnc_split_reg_set_double_line( GNCSplitReg *gsr, gboolean doubleLine );
/**
* Check if its OK to close this register window. Gives the register
* a chance to abort the close if there are roblems, e.g. an open
* transaction.
*
* @return TRUE if the register may be closed, FALSE if not.
**/
gboolean gnc_split_reg_check_close( GNCSplitReg *gsr );
void gnc_split_reg_raise( GNCSplitReg *gsr );
/**
+2 -2
View File
@@ -39,7 +39,7 @@
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">gnc-new-account</property>
<property name="label" translatable="no">gnc-new-account</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
@@ -860,7 +860,7 @@ click &quot;OK&quot;.</property>
<child>
<widget class="GtkLabel" id="msg_label">
<property name="visible">True</property>
<property name="label" translatable="yes">do not translate</property>
<property name="label" translatable="no">do not translate</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
+2 -2
View File
@@ -262,7 +262,7 @@ gnc_hbci_debug_outboxjob (GNCInteractor *inter, AB_JOB *job, gboolean verbose)
if (verbose) {
g_warning("gnc_hbci_debug_outboxjob: Job status: %s", AB_Job_Status2Char(AB_Job_GetStatus(job)));
g_warning(", result: %s", AB_Job_GetResultText(job));
g_warning(", result: %s", AB_Job_GetResultText(job) ? AB_Job_GetResultText(job) : "(none)");
g_warning("\n");
}
@@ -280,7 +280,7 @@ gnc_hbci_debug_outboxjob (GNCInteractor *inter, AB_JOB *job, gboolean verbose)
if (!verbose)
g_warning("gnc_hbci_debug_outboxjob: Job %s had an error: %s\n",
AB_Job_Type2Char(AB_Job_GetType(job)),
AB_Job_GetResultText(job));
AB_Job_GetResultText(job) ? AB_Job_GetResultText(job) : "(none)");
cause = 9000;
} else {
cause = 0;
@@ -1,5 +1,5 @@
/********************************************************************\
* dialog-account-picker.c -- window for picking a Gnucash account *
* dialog-account-picker.c -- window for picking a Gnucash account *
* from the QIF importer. *
* Copyright (C) 2000-2001 Bill Gribble <grib@billgribble.com> *
* Copyright (c) 2006 David Hampton <hampton@employees.org> *
@@ -46,16 +46,27 @@ struct _accountpickerdialog {
GtkWidget * dialog;
GtkTreeView * treeview;
QIFImportWindow * qif_wind;
SCM map_entry;
SCM map_entry;
gchar * selected_name;
};
/****************************************************************
* acct_tree_add_accts
*
* Given a Scheme list of accounts, this function populates a
* GtkTreeStore from them. If the search_name and reference
* parameters are provided, and an account is found whose full
* name matches search_name, then a GtkTreeRowReference* will be
* returned in the reference parameter.
****************************************************************/
static void
acct_tree_add_accts(SCM accts,
GtkTreeStore *store,
GtkTreeIter *parent,
GtkTreeStore *store,
GtkTreeIter *parent,
const char *base_name,
const char *selected_name,
const char *search_name,
GtkTreeRowReference **reference)
{
GtkTreeIter iter;
@@ -64,7 +75,7 @@ acct_tree_add_accts(SCM accts,
gboolean leafnode;
SCM current;
gboolean checked;
while(!SCM_NULLP(accts)) {
current = SCM_CAR(accts);
@@ -79,33 +90,33 @@ acct_tree_add_accts(SCM accts,
else
compname = "";
if(!SCM_NULLP(SCM_CADDR(current))) {
if (!SCM_NULLP(SCM_CADDR(current))) {
leafnode = FALSE;
}
else {
leafnode = TRUE;
}
/* compute full name */
if(base_name && *base_name) {
acctname = g_strjoin(gnc_get_account_separator_string(),
base_name, compname, (char *)NULL);
/* compute full name */
if (base_name && *base_name) {
acctname = g_strjoin(gnc_get_account_separator_string(),
base_name, compname, (char *)NULL);
}
else {
acctname = g_strdup(compname);
}
checked = (SCM_CADR (current) == SCM_BOOL_T);
checked = (SCM_CADR(current) == SCM_BOOL_T);
gtk_tree_store_append(store, &iter, parent);
gtk_tree_store_set(store, &iter,
ACCOUNT_COL_NAME, compname,
ACCOUNT_COL_FULLNAME, acctname,
ACCOUNT_COL_CHECK, checked,
-1);
ACCOUNT_COL_NAME, compname,
ACCOUNT_COL_FULLNAME, acctname,
ACCOUNT_COL_CHECK, checked,
-1);
if (reference && !*reference &&
selected_name && (g_utf8_collate(selected_name, acctname) == 0)) {
search_name && (g_utf8_collate(search_name, acctname) == 0)) {
GtkTreePath *path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter);
*reference = gtk_tree_row_reference_new(GTK_TREE_MODEL(store), path);
gtk_tree_path_free(path);
@@ -113,36 +124,54 @@ acct_tree_add_accts(SCM accts,
if(!leafnode) {
acct_tree_add_accts(SCM_CADDR(current), store, &iter, acctname,
selected_name, reference);
search_name, reference);
}
g_free(acctname);
accts = SCM_CDR(accts);
accts = SCM_CDR(accts);
}
}
/****************************************************************
* build_acct_tree
*
* This function refreshes the contents of the account tree.
****************************************************************/
static void
build_acct_tree(QIFAccountPickerDialog * picker, QIFImportWindow * import)
{
SCM get_accts = scm_c_eval_string("qif-import:get-all-accts");
SCM acct_tree = scm_call_1(get_accts,
gnc_ui_qif_import_druid_get_mappings(import));
SCM acct_tree;
GtkTreeStore *store;
GtkTreePath *path;
GtkTreeSelection* selection;
GtkTreeRowReference *reference = NULL;
gchar *name_to_select;
g_return_if_fail(picker && import);
/* Get an account tree with all existing and to-be-imported accounts. */
acct_tree = scm_call_1(get_accts,
gnc_ui_qif_import_druid_get_mappings(import));
/* Rebuild the store.
* NOTE: It is necessary to save a copy of the name to select, because
* when the store is cleared, everything becomes unselected. */
name_to_select = g_strdup(picker->selected_name);
store = GTK_TREE_STORE(gtk_tree_view_get_model(picker->treeview));
gtk_tree_store_clear(store);
acct_tree_add_accts(acct_tree, store, NULL, NULL, name_to_select, &reference);
g_free(name_to_select);
acct_tree_add_accts(acct_tree, store, NULL, NULL,
picker->selected_name, &reference);
/* Select and display the indicated account (if it was found). */
if (reference) {
selection = gtk_tree_view_get_selection(picker->treeview);
path = gtk_tree_row_reference_get_path(reference);
if (path) {
gtk_tree_view_expand_to_path(picker->treeview, path);
gtk_tree_selection_select_path(selection, path);
gtk_tree_path_free(path);
}
@@ -150,50 +179,66 @@ build_acct_tree(QIFAccountPickerDialog * picker, QIFImportWindow * import)
}
}
/****************************************************************
* gnc_ui_qif_account_picker_new_cb
*
* This handler is invoked when the user wishes to create a new
* account.
****************************************************************/
static void
gnc_ui_qif_account_picker_new_cb(GtkButton * w, gpointer user_data)
{
QIFAccountPickerDialog * wind = user_data;
SCM name_setter = scm_c_eval_string("qif-map-entry:set-gnc-name!");
const char *name;
int response;
char * fullname;
const gchar *name;
int response;
gchar *fullname;
GtkWidget *dlg, *entry;
dlg = gtk_message_dialog_new (GTK_WINDOW(wind->dialog),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_OK_CANCEL,
"%s", _("Enter a name for the account"));
/* Create a dialog to get the new account name. */
dlg = gtk_message_dialog_new(GTK_WINDOW(wind->dialog),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_OK_CANCEL,
"%s", _("Enter a name for the account"));
gtk_dialog_set_default_response(GTK_DIALOG(dlg), GTK_RESPONSE_OK);
entry = gtk_entry_new();
gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE);
gtk_entry_set_max_length(GTK_ENTRY(entry), 250);
gtk_widget_show(entry);
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dlg)->vbox), entry);
/* Run the dialog to get the new account name. */
response = gtk_dialog_run(GTK_DIALOG(dlg));
if (response == GTK_RESPONSE_OK) {
name = gtk_entry_get_text(GTK_ENTRY(entry));
if(wind->selected_name && (strlen(wind->selected_name) > 0)) {
name = gtk_entry_get_text(GTK_ENTRY(entry));
/* Did the user enter a name and click OK? */
if (response == GTK_RESPONSE_OK && name && *name) {
/* If an account is selected, this will be a new subaccount. */
if(wind->selected_name && *(wind->selected_name))
/* We have the short name; determine the full name. */
fullname = g_strjoin(gnc_get_account_separator_string(),
wind->selected_name, name, (char *)NULL);
}
else {
wind->selected_name, name, (char *)NULL);
else
fullname = g_strdup(name);
}
wind->selected_name = g_strdup(fullname);
/* Save the full name and update the map entry. */
g_free(wind->selected_name);
wind->selected_name = fullname;
scm_call_2(name_setter, wind->map_entry, scm_makfrom0str(fullname));
g_free(fullname);
}
gtk_widget_destroy(dlg);
/* Refresh the tree display and give it the focus. */
build_acct_tree(wind, wind->qif_wind);
gtk_widget_grab_focus(GTK_WIDGET(wind->treeview));
}
static void
gnc_ui_qif_account_picker_changed_cb (GtkTreeSelection *selection,
gpointer user_data)
gnc_ui_qif_account_picker_changed_cb(GtkTreeSelection *selection,
gpointer user_data)
{
QIFAccountPickerDialog * wind = user_data;
SCM name_setter = scm_c_eval_string("qif-map-entry:set-gnc-name!");
@@ -202,22 +247,26 @@ gnc_ui_qif_account_picker_changed_cb (GtkTreeSelection *selection,
g_free(wind->selected_name);
if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
gtk_tree_model_get(model, &iter, ACCOUNT_COL_FULLNAME, &wind->selected_name, -1);
scm_call_2(name_setter, wind->map_entry, scm_makfrom0str(wind->selected_name));
gtk_tree_model_get(model, &iter,
ACCOUNT_COL_FULLNAME, &wind->selected_name,
-1);
scm_call_2(name_setter, wind->map_entry,
scm_makfrom0str(wind->selected_name));
} else {
wind->selected_name = NULL;
}
}
static void
gnc_ui_qif_account_picker_row_activated_cb (GtkTreeView *view, GtkTreePath *path,
GtkTreeViewColumn *column,
gpointer user_data)
gnc_ui_qif_account_picker_row_activated_cb(GtkTreeView *view,
GtkTreePath *path,
GtkTreeViewColumn *column,
gpointer user_data)
{
QIFAccountPickerDialog *wind = user_data;
g_return_if_fail (wind);
g_return_if_fail(wind);
gtk_dialog_response (GTK_DIALOG (wind->dialog), GTK_RESPONSE_OK);
gtk_dialog_response(GTK_DIALOG(wind->dialog), GTK_RESPONSE_OK);
}
static int
@@ -232,44 +281,48 @@ gnc_ui_qif_account_picker_map_cb(GtkWidget * w, gpointer user_data)
return FALSE;
}
/****************************************************************
* qif_account_picker_dialog
* select an account from the ones that the engine knows about, plus
* the ones that will be created newly by the QIF import. this is
* sort of like fileBox... it returns a string for the account name or
* NULL on cancel. It's modal.
*
* Select an account from the ones that the engine knows about,
* plus those that will be created by the QIF import. If the
* user clicks OK, map_entry is changed and TRUE is returned.
* If the clicks Cancel instead, FALSE is returned. Modal.
****************************************************************/
SCM
gboolean
qif_account_picker_dialog(QIFImportWindow * qif_wind, SCM map_entry)
{
{
QIFAccountPickerDialog * wind;
SCM save_entry = scm_c_eval_string("qif-map-entry:clone");
SCM init_pick = scm_c_eval_string("qif-map-entry:gnc-name");
SCM saved_entry = scm_call_1(save_entry, map_entry);
SCM gnc_name = scm_c_eval_string("qif-map-entry:gnc-name");
SCM set_gnc_name = scm_c_eval_string("qif-map-entry:set-gnc-name!");
SCM orig_acct = scm_call_1(gnc_name, map_entry);
int response;
const gchar * scmname;
GladeXML *xml;
GtkWidget *button;
wind = g_new0(QIFAccountPickerDialog, 1);
xml = gnc_glade_xml_new ("qif.glade", "QIF Import Account Picker");
/* Save the map entry. */
wind->map_entry = map_entry;
scm_gc_protect_object(wind->map_entry);
glade_xml_signal_connect_data
(xml, "gnc_ui_qif_account_picker_new_cb",
G_CALLBACK (gnc_ui_qif_account_picker_new_cb), wind);
/* Set the initial account to be selected. */
wind->selected_name = g_strdup(SCM_STRING_CHARS(orig_acct));
wind->dialog = glade_xml_get_widget (xml, "QIF Import Account Picker");
wind->treeview = GTK_TREE_VIEW(glade_xml_get_widget (xml, "account_tree"));
xml = gnc_glade_xml_new("qif.glade", "QIF Import Account Picker");
glade_xml_signal_connect_data(xml,
"gnc_ui_qif_account_picker_new_cb",
G_CALLBACK(gnc_ui_qif_account_picker_new_cb),
wind);
wind->dialog = glade_xml_get_widget(xml, "QIF Import Account Picker");
wind->treeview = GTK_TREE_VIEW(glade_xml_get_widget(xml, "account_tree"));
wind->qif_wind = qif_wind;
wind->map_entry = map_entry;
scmname = SCM_STRING_CHARS(scm_call_1(init_pick, map_entry));
wind->selected_name = g_strdup(scmname);
scm_gc_protect_object(wind->map_entry);
{
GtkTreeStore *store;
@@ -278,40 +331,44 @@ qif_account_picker_dialog(QIFImportWindow * qif_wind, SCM map_entry)
GtkTreeSelection *selection;
store = gtk_tree_store_new(NUM_ACCOUNT_COLS, G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_BOOLEAN);
G_TYPE_BOOLEAN);
gtk_tree_view_set_model(wind->treeview, GTK_TREE_MODEL(store));
g_object_unref(store);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(_("Account"), renderer,
"text", ACCOUNT_COL_NAME,
NULL);
column = gtk_tree_view_column_new_with_attributes(_("Account"),
renderer,
"text",
ACCOUNT_COL_NAME,
NULL);
g_object_set(column, "expand", TRUE, NULL);
gtk_tree_view_append_column(wind->treeview, column);
renderer = gtk_cell_renderer_toggle_new();
g_object_set(renderer, "activatable", FALSE, NULL);
column = gtk_tree_view_column_new_with_attributes(_("New?"), renderer,
"active", ACCOUNT_COL_CHECK,
NULL);
column = gtk_tree_view_column_new_with_attributes(_("New?"),
renderer,
"active",
ACCOUNT_COL_CHECK,
NULL);
gtk_tree_view_append_column(wind->treeview, column);
selection = gtk_tree_view_get_selection(wind->treeview);
g_signal_connect(selection, "changed",
G_CALLBACK(gnc_ui_qif_account_picker_changed_cb), wind);
G_CALLBACK(gnc_ui_qif_account_picker_changed_cb), wind);
g_signal_connect(wind->treeview, "row-activated",
G_CALLBACK(gnc_ui_qif_account_picker_row_activated_cb),
wind);
G_CALLBACK(gnc_ui_qif_account_picker_row_activated_cb),
wind);
}
g_signal_connect_after(wind->dialog, "map",
G_CALLBACK(gnc_ui_qif_account_picker_map_cb),
wind);
button = glade_xml_get_widget (xml, "newbutton");
G_CALLBACK(gnc_ui_qif_account_picker_map_cb),
wind);
button = glade_xml_get_widget(xml, "newbutton");
gtk_button_set_use_stock(GTK_BUTTON(button), TRUE);
/* this is to get the checkmarks set up right.. it will get called
/* this is to get the checkmarks set up right.. it will get called
* again after the window is mapped. */
build_acct_tree(wind, wind->qif_wind);
@@ -324,10 +381,11 @@ qif_account_picker_dialog(QIFImportWindow * qif_wind, SCM map_entry)
g_free(wind->selected_name);
g_free(wind);
if (response == GTK_RESPONSE_OK) {
return map_entry;
}
else {
return saved_entry;
}
if (response == GTK_RESPONSE_OK)
return TRUE;
/* Restore the original mapping. */
scm_call_2(set_gnc_name, map_entry, orig_acct);
return FALSE;
}
@@ -28,7 +28,7 @@
#include "druid-qif-import.h"
SCM qif_account_picker_dialog(QIFImportWindow * wind, SCM initial_sel);
gboolean qif_account_picker_dialog(QIFImportWindow * wind, SCM initial_sel);
typedef struct _accountpickerdialog QIFAccountPickerDialog;
File diff suppressed because it is too large. Load diff
+82 -8
View File
@@ -224,7 +224,7 @@ W Private
General Notes:
Dates:
-----
------
Dates in US QIF files are usually in the format MM/DD/YY, although
four-digit years are not uncommon. Dates sometimes occur without the
@@ -238,19 +238,95 @@ European QIF files may have dates in the DD/MM/YY format.
Monetary Amounts:
-----------------
These may occur in either US or Euro format:
These typically occur in either US or European format:
10,000.00 Ten Thousand Dollars
10.000,00 Ten Thousand Francs
10,000.00 Ten Thousand Dollars (US format)
10.000,00 Ten Thousand Francs (European format)
Within a given QIF file, the usage of US or Euro numeric format
An apostrophe is also used in some cases:
10'000.00 Ten Thousand Dollars (Quicken 4)
10'000,00 Ten Thousand Francs (unconfirmed)
Within a given QIF file, the usage of a particular numeric format
appears to be consistent within a particular field but may be
different from one field to another. For example, the Share Amount
field can be in Euro format but the Split Amount in US. No
field can be in European format but the Split Amount in US. No
radix-point is required and no limit on decimal places is evident, so
it's possible to see the number "1,000" meaning "1 franc per share"
"1,000" meaning "one thousand shares" in the same transaction (!).
Investment Actions:
-------------------
The N line of investment transactions specifies the "action" of the
transaction. Although not a complete list, possible values include
the following:
QIF N Line Notes
============ =====
Aktab Same as ShrsOut.
AktSplit Same as StkSplit.
Aktzu Same as ShrsIn.
Buy Buy shares.
BuyX Buy shares. Used with an L line.
Cash Miscellaneous cash transaction. Used with an L line.
CGMid Mid-term capital gains.
CGMidX Mid-term capital gains. For use with an L line.
CGLong Long-term capital gains.
CGLongX Long-term capital gains. For use with an L line.
CGShort Short-term capital gains.
CGShortX Short-term capital gains. For use with an L line.
ContribX Same as XIn. Used for tax-advantaged accounts.
CvrShrt Buy shares to cover a short sale.
CvrShrtX Buy shares to cover a short sale. Used with an L line.
Div Dividend received.
DivX Dividend received. For use with an L line.
Errinerg Same as Reminder.
Exercise Exercise an option.
ExercisX Exercise an option. For use with an L line.
Expire Mark an option as expired. (Uses D, N, Y & M lines)
Grant Receive a grant of stock options.
Int Same as IntInc.
IntX Same as IntIncX.
IntInc Interest received.
IntIncX Interest received. For use with an L line.
K.gewsp Same as CGShort. (German)
K.gewspX Same as CGShortX. (German)
Kapgew Same as CGLong. Kapitalgewinnsteuer.(German)
KapgewX Same as CGLongX. Kapitalgewinnsteuer. (German)
Kauf Same as Buy. (German)
KaufX Same as BuyX. (German)
MargInt Margin interest paid.
MargIntX Margin interest paid. For use with an L line.
MiscExp Miscellaneous expense.
MiscExpX Miscellaneous expense. For use with an L line.
MiscInc Miscellaneous income.
MiscIncX Miscellaneous income. For use with an L line.
ReinvDiv Reinvested dividend.
ReinvInt Reinvested interest.
ReinvLG Reinvested long-term capital gains.
Reinvkur Same as ReinvLG.
Reinvksp Same as ReinvSh.
ReinvMd Reinvested mid-term capital gains.
ReinvSG Same as ReinvSh.
ReinvSh Reinvested short-term capital gains.
Reinvzin Same as ReinvDiv.
Reminder Reminder. (Uses D, N, C & M lines)
RtrnCap Return of capital.
RtrnCapX Return of capital. For use with an L line.
Sell Sell shares.
SellX Sell shares. For use with an L line.
ShtSell Short sale.
ShrsIn Deposit shares.
ShrsOut Withdraw shares.
StkSplit Stock split.
Verkauf Same as Sell. (German)
VerkaufX Same as SellX. (German)
Vest Mark options as vested. (Uses N, Y, Q, C & M lines)
WithDrwX Same as XOut. Used for tax-advantaged accounts.
XIn Transfer cash from another account.
XOut Transfer cash to another account.
Category/Transfer/Class line:
-----------------------------
@@ -274,5 +350,3 @@ separated by a '|', like so:
NMiscExpX
T1000.00
Lexpense category/expense class|[Transfer account]/transfer class
+272 -220
View File
@@ -1,9 +1,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; qif-dialog-utils.scm
;;; build qif->gnc account maps and put them in a displayable
;;; form.
;;; build qif->gnc account maps and put them in a displayable
;;; form.
;;;
;;; Bill Gribble <grib@billgribble.com> 20 Feb 2000
;;; Bill Gribble <grib@billgribble.com> 20 Feb 2000
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (default-stock-acct brokerage security)
@@ -14,15 +14,15 @@
brokerage (gnc-get-account-separator-string)
security))
(define (default-interest-acct brokerage security)
(define (default-interest-acct brokerage security)
(string-append (_ "Interest") (gnc-get-account-separator-string)
brokerage
(if (string=? security "")
""
(string-append (gnc-get-account-separator-string)
security))))
(if (string=? security "")
""
(string-append (gnc-get-account-separator-string)
security))))
(define (default-capital-return-acct brokerage security)
(define (default-capital-return-acct brokerage security)
(string-append (_ "Cap Return") (gnc-get-account-separator-string)
brokerage (gnc-get-account-separator-string)
security))
@@ -44,13 +44,13 @@
(define (default-equity-holding security) (_ "Retained Earnings"))
(define (default-equity-account) (_ "Retained Earnings"))
(define (default-equity-account) (_ "Retained Earnings"))
(define (default-commission-acct brokerage)
(define (default-commission-acct brokerage)
(string-append (_ "Commissions") (gnc-get-account-separator-string)
brokerage))
(define (default-margin-interest-acct brokerage)
(define (default-margin-interest-acct brokerage)
(string-append (_ "Margin Interest") (gnc-get-account-separator-string)
brokerage))
@@ -59,7 +59,7 @@
(define (qif-import:gnc-account-exists map-entry acct-list)
(let ((retval #f))
(for-each
(for-each
(lambda (acct)
(if (string=? (qif-map-entry:gnc-name map-entry)
(cadr acct))
@@ -73,16 +73,16 @@
;; xtns with that account name, and column 3 is the guess for the
;; translation. Sorted on # transactions, then alpha.
(define (qif-dialog:make-account-display qif-files acct-hash gnc-acct-info)
(define (qif-dialog:make-account-display qif-files acct-hash gnc-acct-info)
;; first, clear the "display" flags in the acct-hash and set up the
;; new-file? flags. If there's nothing to show any more, don't.
(hash-fold
(hash-fold
(lambda (k v p)
(qif-map-entry:set-display?! v #f)
#f)
#f acct-hash)
(let ((retval '()))
(let ((retval '()))
;; we want to make two passes here. The first pass picks the
;; explicit Account descriptions out of each file. These are the
;; best sources of info because we will have types and so on for
@@ -91,31 +91,31 @@
;; we'll have most of the accounts already located by that point.
;; Otherwise, we have to guess them.
;; acct-hash hashes the qif name to a <qif-map-entry> object.
;; acct-hash hashes the qif name to a <qif-map-entry> object.
;; guess-acct returns one.
(for-each
(for-each
(lambda (file)
;; first, get the explicit account references.
(for-each
;; first, get the explicit account references.
(for-each
(lambda (acct)
(let ((entry (hash-ref acct-hash (qif-acct:name acct))))
(if (not entry)
(set! entry
(qif-import:guess-acct (qif-acct:name acct)
(set! entry
(qif-import:guess-acct (qif-acct:name acct)
(qif-acct:type acct)
gnc-acct-info)))
(qif-map-entry:set-description! entry (qif-acct:description acct))
(hash-set! acct-hash (qif-acct:name acct) entry)))
(qif-file:accounts file)))
qif-files)
;; now make the second pass through the files, looking at the
;; now make the second pass through the files, looking at the
;; transactions. Hopefully the accounts are all there already.
;; stock accounts can have both a category/account and another
;; account ref from the security name.
(for-each
;; account ref from the security name.
(for-each
(lambda (file)
(for-each
(for-each
(lambda (xtn)
(let ((stock-acct (qif-xtn:security-name xtn))
(action (qif-xtn:action xtn))
@@ -123,7 +123,7 @@
(qif-account #f)
(qif-account-types #f)
(entry #f))
(if (and stock-acct action)
;; stock transactions are weird. there can be several
;; accounts associated with stock xtns: the security,
@@ -133,16 +133,16 @@
;; in the map.
(begin
;; first: figure out what the near-end account is.
;; it's generally the security account, but could be
;; it's generally the security account, but could be
;; an interest, dividend, or CG account.
(case action
((buy buyx sell sellx reinvint reinvdiv reinvsh reinvsg
((buy buyx sell sellx reinvint reinvdiv reinvsh reinvsg
reinvlg reinvmd shrsin shrsout stksplit)
(set! qif-account
(set! qif-account
(default-stock-acct from-acct stock-acct))
(set! qif-account-types (list GNC-STOCK-TYPE
(set! qif-account-types (list GNC-STOCK-TYPE
GNC-MUTUAL-TYPE)))
((div cgshort cgmid cglong intinc miscinc miscexp
((div cgshort cgmid cglong intinc miscinc miscexp
margint rtrncap xin xout)
(set! qif-account from-acct)
(set! qif-account-types (list GNC-BANK-TYPE
@@ -150,10 +150,10 @@
GNC-CASH-TYPE
GNC-ASSET-TYPE
GNC-LIABILITY-TYPE)))
((divx cgshortx cgmidx cglongx intincx margintx rtrncapx)
(set! qif-account
(qif-split:category
(set! qif-account
(qif-split:category
(car (qif-xtn:splits xtn))))
(set! qif-account-types (list GNC-BANK-TYPE
GNC-CCARD-TYPE
@@ -161,40 +161,40 @@
GNC-ASSET-TYPE
GNC-LIABILITY-TYPE)))
((miscincx miscexpx)
(set! qif-account
(qif-split:miscx-category
(set! qif-account
(qif-split:miscx-category
(car (qif-xtn:splits xtn))))
(set! qif-account-types (list GNC-BANK-TYPE
GNC-CCARD-TYPE
GNC-CASH-TYPE
GNC-ASSET-TYPE
GNC-LIABILITY-TYPE))))
;; now reference the near-end account
;; now reference the near-end account
(if qif-account
(begin
(set! entry (hash-ref acct-hash qif-account))
(if (not entry)
(set! entry
(set! entry
(qif-import:guess-acct qif-account
qif-account-types
gnc-acct-info)))
(qif-map-entry:set-display?! entry #t)
(hash-set! acct-hash qif-account entry)))
;; now figure out the other end of the transaction.
;; the far end will be the brokerage for buy, sell,
;; etc, or the "L"-referenced account for buyx,
;; sellx, etc, or an equity account for ShrsIn/ShrsOut
;; miscintx and miscexpx are very, very "special"
;; cases ... I'm not sure this is right.
;; miscintx and miscexpx are very, very "special"
;; cases ... I'm not sure this is right.
;; the L line looks like :
;; LCategory/class [Account]/class
;; so I assume near-acct is Account and far acct
;; is Category. This matches the intincx/divx
;; so I assume near-acct is Account and far acct
;; is Category. This matches the intincx/divx
;; behavior.
(set! qif-account #f)
(case action
((buy sell)
@@ -205,19 +205,19 @@
GNC-ASSET-TYPE
GNC-LIABILITY-TYPE)))
((buyx sellx xin xout)
(set! qif-account
(qif-split:category
(set! qif-account
(qif-split:category
(car (qif-xtn:splits xtn))))
(set! qif-account-types (list GNC-BANK-TYPE
GNC-CCARD-TYPE
GNC-CASH-TYPE
GNC-ASSET-TYPE
GNC-LIABILITY-TYPE)))
((stksplit)
(set! qif-account
(set! qif-account
(default-stock-acct from-acct stock-acct))
(set! qif-account-types (list GNC-STOCK-TYPE
(set! qif-account-types (list GNC-STOCK-TYPE
GNC-MUTUAL-TYPE
GNC-ASSET-TYPE
GNC-LIABILITY-TYPE)))
@@ -225,27 +225,27 @@
(set! qif-account
(default-cgshort-acct from-acct stock-acct))
(set! qif-account-types (list GNC-INCOME-TYPE)))
((cgmid cgmidx reinvmd)
(set! qif-account
(default-cgmid-acct from-acct stock-acct))
(set! qif-account-types (list GNC-INCOME-TYPE)))
((cglong cglongx reinvlg)
(set! qif-account
(default-cglong-acct from-acct stock-acct))
(set! qif-account-types (list GNC-INCOME-TYPE)))
((intinc intincx reinvint)
(set! qif-account
(default-interest-acct from-acct stock-acct))
(set! qif-account-types (list GNC-INCOME-TYPE)))
((div divx reinvdiv)
(set! qif-account
(default-dividend-acct from-acct stock-acct))
(set! qif-account-types (list GNC-INCOME-TYPE)))
((rtrncap rtrncapx)
(set! qif-account
(default-capital-return-acct from-acct stock-acct))
@@ -260,14 +260,14 @@
(set! qif-account
(default-margin-interest-acct from-acct))
(set! qif-account-types (list GNC-EXPENSE-TYPE)))
((miscinc miscexp miscincx miscexpx)
;; these reference a category on the other end
;; these reference a category on the other end
(set! qif-account #f)))
;; now reference the far-end account
(if qif-account
(begin
;; now reference the far-end account
(if qif-account
(begin
(set! entry (hash-ref acct-hash qif-account))
(if (not entry)
(set! entry (qif-import:guess-acct
@@ -276,23 +276,23 @@
(qif-map-entry:set-display?! entry #t)
(hash-set! acct-hash qif-account entry)))
;; if there's a commission, reference the
;; if there's a commission, reference the
;; commission account
(if (qif-xtn:commission xtn)
(begin
(set! qif-account
(if (qif-xtn:commission xtn)
(begin
(set! qif-account
(default-commission-acct from-acct))
(set! entry
(set! entry
(hash-ref acct-hash qif-account))
(if (not entry)
(set! entry
(qif-import:guess-acct
qif-account
(set! entry
(qif-import:guess-acct
qif-account
(list GNC-EXPENSE-TYPE)
gnc-acct-info)))
(qif-map-entry:set-display?! entry #t)
(hash-set! acct-hash qif-account entry))))
;; non-stock transactions. these are a bit easier.
;; the near-end account (from) is always in the
;; transaction, and the far end(s) are in the splits.
@@ -300,8 +300,8 @@
(set! entry (hash-ref acct-hash from-acct))
(if (not entry)
(set! entry (qif-import:guess-acct
from-acct
(list
from-acct
(list
GNC-BANK-TYPE
GNC-CCARD-TYPE
GNC-CASH-TYPE
@@ -310,22 +310,22 @@
gnc-acct-info)))
(qif-map-entry:set-display?! entry #t)
(hash-set! acct-hash from-acct entry)
;; iterate over the splits doing the same thing.
(for-each
;; iterate over the splits doing the same thing.
(for-each
(lambda (split)
(let ((xtn-is-acct (qif-split:category-is-account? split))
(xtn-acct #f)
(entry #f))
(if xtn-is-acct
(begin
(if xtn-is-acct
(begin
(set! xtn-acct (qif-split:category split))
(set! entry (hash-ref acct-hash xtn-acct))
(if (not entry)
(set! entry
(set! entry
(qif-import:guess-acct
xtn-acct
(list
xtn-acct
(list
GNC-BANK-TYPE
GNC-CCARD-TYPE
GNC-CASH-TYPE
@@ -337,35 +337,35 @@
(qif-xtn:splits xtn))))))
(qif-file:xtns file)))
qif-files)
;; now that the hash table is filled, make the display list
(hash-fold
;; now that the hash table is filled, make the display list
(hash-fold
(lambda (k v p)
(if (qif-map-entry:display? v)
(begin
(qif-map-entry:set-new-acct?!
(qif-map-entry:set-new-acct?!
v (not (qif-import:gnc-account-exists v gnc-acct-info)))
(set! retval (cons v retval))))
#f)
#f acct-hash)
;; sort by number of transactions with that account so the
;; sort by number of transactions with that account so the
;; most important are at the top
(set! retval
(sort retval
(set! retval
(sort retval
(lambda (a b)
(string<? (qif-map-entry:qif-name a)
(qif-map-entry:qif-name b)))))
retval))
;; the category display is similar to the Account display.
;; QIF category name, xtn count, then GNUcash account.
;; the category display is similar to the Account display.
;; QIF category name, xtn count, then GNUcash account.
(define (qif-dialog:make-category-display qif-files cat-hash gnc-acct-info)
;; first, clear the "display" flags in the cat-hash. If there's
;; nothing to show any more, don't.
(hash-fold
(define (qif-dialog:make-category-display qif-files cat-hash gnc-acct-info)
;; first, clear the "display" flags in the cat-hash. If there's
;; nothing to show any more, don't.
(hash-fold
(lambda (k v p)
(qif-map-entry:set-display?! v #f)
#f)
@@ -373,14 +373,14 @@
(let ((retval '())
(entry #f))
;; get the Cat entries from each file
(for-each
;; get the Cat entries from each file
(for-each
(lambda (file)
(for-each
(for-each
(lambda (cat)
(set! entry (hash-ref cat-hash (qif-cat:name cat)))
(if (not entry)
(set! entry
(set! entry
(qif-import:guess-acct (qif-cat:name cat)
(if (qif-cat:expense-cat cat)
(list GNC-EXPENSE-TYPE
@@ -388,31 +388,31 @@
(list GNC-INCOME-TYPE
GNC-EXPENSE-TYPE))
gnc-acct-info)))
(qif-map-entry:set-description!
(qif-map-entry:set-description!
entry (qif-cat:description cat))
(hash-set! cat-hash (qif-cat:name cat) entry))
(qif-file:cats file)))
qif-files)
;; now look at every transaction and increment the count
;; in the account slot if the string matches, or make a
;; now look at every transaction and increment the count
;; in the account slot if the string matches, or make a
;; new hash reference if not.
(for-each
(for-each
(lambda (qif-file)
(for-each
(for-each
(lambda (xtn)
;; iterate over the splits
(for-each
(for-each
(lambda (split)
(let ((xtn-is-acct (qif-split:category-is-account? split))
(xtn-cat #f)
(entry #f))
(if (not xtn-is-acct)
(begin
(set! xtn-cat (qif-split:category split))
(begin
(set! xtn-cat (qif-split:category split))
(set! entry (hash-ref cat-hash xtn-cat))
(if (not entry)
(set! entry
(set! entry
(qif-import:guess-acct
xtn-cat
(if (gnc-numeric-positive-p
@@ -425,47 +425,47 @@
(qif-xtn:splits xtn)))
(qif-file:xtns qif-file)))
qif-files)
;; now that the hash table is filled, make the display list
;; now that the hash table is filled, make the display list
(hash-fold
(lambda (k v p)
(if (qif-map-entry:display? v)
(begin
(qif-map-entry:set-new-acct?!
(begin
(qif-map-entry:set-new-acct?!
v (not (qif-import:gnc-account-exists v gnc-acct-info)))
(set! retval (cons v retval))))
#f)
#f cat-hash)
;; sort by qif account name
(set! retval (sort retval
(set! retval (sort retval
(lambda (a b)
(string<? (qif-map-entry:qif-name a)
(qif-map-entry:qif-name b)))))
retval))
;; this one's like the other display builders, it just looks at the
;; payee and memo too.
;; payee and memo too.
(define (qif-dialog:make-memo-display qif-files memo-hash gnc-acct-info)
(let ((retval '()))
;; clear the display flags for existing items
(hash-fold
;; clear the display flags for existing items
(hash-fold
(lambda (k v p)
(qif-map-entry:set-display?! v #f)
#f)
#f memo-hash)
;; iterate over every imported transaction. If there's no
;; category in the transaction, look at the payee to get a clue.
;; of there's no payee, look at the split memo.
(for-each
(lambda (file)
(for-each
(for-each
(lambda (file)
(for-each
(lambda (xtn)
(let ((payee (qif-xtn:payee xtn))
(splits (qif-xtn:splits xtn)))
(for-each
(for-each
(lambda (split)
(let ((cat (qif-split:category split))
(memo (qif-split:memo split))
@@ -473,7 +473,7 @@
;; for each split: if there's a category, do nothing.
;; if there's a payee, use that as the
;; key otherwise, use the split memo.
(cond ((and cat
(cond ((and cat
(or (not (string? cat))
(not (string=? cat ""))))
(set! key-string #f))
@@ -481,25 +481,25 @@
(set! key-string payee))
(memo
(set! key-string memo)))
(if key-string
(if key-string
(let ((entry (hash-ref memo-hash key-string)))
(if (not entry)
(begin
(begin
(set! entry (make-qif-map-entry))
(qif-map-entry:set-qif-name! entry key-string)
(qif-map-entry:set-gnc-name!
entry (default-unspec-acct))
(qif-map-entry:set-allowed-types!
entry
entry
(if (gnc-numeric-positive-p
(qif-split:amount split))
(list GNC-INCOME-TYPE GNC-EXPENSE-TYPE
GNC-BANK-TYPE GNC-CCARD-TYPE
GNC-BANK-TYPE GNC-CCARD-TYPE
GNC-LIABILITY-TYPE GNC-ASSET-TYPE
GNC-STOCK-TYPE GNC-MUTUAL-TYPE)
(list GNC-EXPENSE-TYPE GNC-INCOME-TYPE
GNC-BANK-TYPE GNC-CCARD-TYPE
GNC-BANK-TYPE GNC-CCARD-TYPE
GNC-LIABILITY-TYPE GNC-ASSET-TYPE
GNC-STOCK-TYPE GNC-MUTUAL-TYPE)))))
(qif-map-entry:set-display?! entry #t)
@@ -507,28 +507,28 @@
splits)))
(qif-file:xtns file)))
qif-files)
;; build display list
(hash-fold
;; build display list
(hash-fold
(lambda (k v p)
(if (qif-map-entry:display? v)
(begin
(qif-map-entry:set-new-acct?!
(begin
(qif-map-entry:set-new-acct?!
v (not (qif-import:gnc-account-exists v gnc-acct-info)))
(set! retval (cons v retval))))
#f)
#f memo-hash)
;; sort by qif memo/payee name
(set! retval (sort retval
;; sort by qif memo/payee name
(set! retval (sort retval
(lambda (a b)
(string<? (qif-map-entry:qif-name a)
(qif-map-entry:qif-name b)))))
retval))
(define (qif-dialog:qif-file-loaded? filename list-of-files)
(let ((status (map
(define (qif-dialog:qif-file-loaded? filename list-of-files)
(let ((status (map
(lambda (file)
(string=? filename (qif-file:path file)))
list-of-files)))
@@ -539,11 +539,11 @@
(define (qif-dialog:unload-qif-file oldfile list-of-files)
(delq oldfile list-of-files))
(define (qif-import:any-new-accts? hash-table)
(define (qif-import:any-new-accts? hash-table)
(let ((retval #f))
(for-each
(for-each
(lambda (bin)
(for-each
(for-each
(lambda (elt)
(if (and (qif-map-entry:new-acct? (cdr elt))
(qif-map-entry:display? (cdr elt)))
@@ -552,8 +552,8 @@
(vector->list hash-table))
retval))
(define (qif-import:fix-from-acct qif-file new-acct-name)
(for-each
(define (qif-import:fix-from-acct qif-file new-acct-name)
(for-each
(lambda (xtn)
(if (not (qif-xtn:from-acct xtn))
(qif-xtn:set-from-acct! xtn new-acct-name)))
@@ -580,13 +580,35 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; qif-dialog:default-namespace
;;
;; For a given commodity symbol, return a default namespace.
;; Given a security's QIF symbol and type, along with all
;; previously seen security mapping preferences, return a
;; default namespace.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (qif-dialog:default-namespace s)
(if (string? s)
(define (qif-dialog:default-namespace qif-symbol qif-type prefs)
;; Guess a namespace based on the symbol alone.
(define (guess-by-symbol s)
(if (string? s)
(let ((l (string-length s))
(d (string-index s #\.)))
(d (string-index s #\.))
(pref-match
(if (list? prefs)
(find (lambda (elt)
;; Does the symbol match, and is the namespace
;; compatible with the QIF type?
(and (string=? s (caddr elt))
(not (and (string? qif-type)
(string=? GNC_COMMODITY_NS_MUTUAL
(cadr elt))
(or (string-ci=? qif-type "stock")
(string-ci=? qif-type "etf"))))))
prefs)
#f)))
(cond
;; If a preferences match was found, use its namespace.
(pref-match
(cadr pref-match))
;; Guess NYSE for symbols of 1-3 characters.
((< l 4)
GNC_COMMODITY_NS_NYSE)
@@ -606,72 +628,102 @@
;; Otherwise it's probably a fund.
(else
GNC_COMMODITY_NS_MUTUAL)))
;; There's no symbol. Default to a fund.
GNC_COMMODITY_NS_MUTUAL))
;; Was a QIF type given?
(if (string? qif-type)
;; Yes. We might be able to definitely determine the namespace.
(cond
;; Mutual fund
((string-ci=? qif-type "mutual fund")
GNC_COMMODITY_NS_MUTUAL)
;; Index
((string-ci=? qif-type "index")
;; This QIF type must be wrong; indexes aren't tradable!
GNC_COMMODITY_NS_MUTUAL)
(else
(guess-by-symbol qif-symbol)))
;; No QIF type was given, so guess a
;; default namespace by symbol alone.
(guess-by-symbol qif-symbol)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; qif-import:update-stock-hash
;; qif-import:update-security-hash
;;
;; make new commodities for each new stock in acct-hash that isn't
;; already in stock-hash. Return a list of the QIF names of the
;; new stocks or #f if none.
;; For each QIF security in acct-hash, find a matching
;; GnuCash security or create a new one, then add it to the
;; security-hash table. Return a list of security-hash keys
;; for all newly created GnuCash securities, or #f if none.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (qif-import:update-stock-hash stock-hash ticker-map acct-hash)
(define (qif-import:update-security-hash security-hash ticker-map
acct-hash sec-prefs)
(let ((names '()))
(hash-fold
(hash-fold
(lambda (qif-name map-entry p)
(let ((stock-name (qif-import:get-account-name qif-name)))
;; is it: a stock or mutual fund and displayed and not already in
;; the stock-hash?
(if (and
stock-name
(let ((security-name (qif-import:get-account-name qif-name)))
;; Is this account going to be imported, is it security-denominated,
;; and is the security not already in the security hash table?
(if (and
security-name
(qif-map-entry:display? map-entry)
(or (memv GNC-STOCK-TYPE
(or (memv GNC-STOCK-TYPE
(qif-map-entry:allowed-types map-entry))
(memv GNC-MUTUAL-TYPE
(memv GNC-MUTUAL-TYPE
(qif-map-entry:allowed-types map-entry)))
(not (hash-ref stock-hash stock-name)))
(let* ((separator (string-ref (gnc-get-account-separator-string) 0))
(existing-gnc-acct
(gnc-account-lookup-by-full-name
(not (hash-ref security-hash security-name)))
(let ((existing-gnc-acct
(gnc-account-lookup-by-full-name
(gnc-get-current-root-account)
(qif-map-entry:gnc-name map-entry)))
(book (gnc-account-get-book (gnc-get-current-root-account)))
(existing-type
(xaccAccountGetType existing-gnc-acct)))
(if (and (not (null? existing-gnc-acct))
(memv existing-type (list GNC-STOCK-TYPE
GNC-MUTUAL-TYPE)))
;; gnc account already exists... we *know* what the
;; security is supposed to be
(let ((commodity
(book (gnc-account-get-book (gnc-get-current-root-account))))
;; Are we importing to an existing, security-denominated account?
(if (and (not (null? existing-gnc-acct))
(memv (xaccAccountGetType existing-gnc-acct)
(list GNC-STOCK-TYPE GNC-MUTUAL-TYPE)))
;; Yes, so that security is the one to use. Add it
;; to the security hash table.
(let ((commodity
(xaccAccountGetCommodity existing-gnc-acct)))
(hash-set! stock-hash stock-name commodity))
;; we know nothing about this security.. we need to
;; ask about it
(let ((ticker-symbol
(qif-ticker-map:lookup-ticker ticker-map
stock-name))
(namespace GNC_COMMODITY_NS_MUTUAL))
(hash-set! security-hash security-name commodity))
(if (not ticker-symbol)
(set! ticker-symbol stock-name)
(set! namespace
(qif-dialog:default-namespace ticker-symbol)))
(set! names (cons stock-name names))
(hash-set!
stock-hash stock-name
(gnc-commodity-new book
stock-name
namespace
ticker-symbol
""
100000))))))
;; Otherwise, since we can't definitively match this QIF
;; security to a GnuCash security, create a new one with
;; some (hopefully) intelligent defaults.
(let* ((qif-symbol
(qif-ticker-map:lookup-symbol ticker-map
security-name))
(qif-type
(qif-ticker-map:lookup-type ticker-map
security-name))
(namespace (qif-dialog:default-namespace qif-symbol
qif-type
sec-prefs)))
;; If no symbol has been provided, default to the name.
(if (not qif-symbol)
(set! qif-symbol security-name))
;; Create the new security and add it to the hash table.
(hash-set! security-hash
security-name
(gnc-commodity-new book
security-name
namespace
qif-symbol
""
100000))
;; Add the hash key to the list to be returned.
(set! names (cons security-name names))))))
#f))
#f acct-hash)
(if (not (null? names))
(sort names string<?)
#f)))
@@ -679,19 +731,19 @@
;; this is used within the dialog to get a list of all the new
;; accounts the importer thinks it's going to make. Passed to the
;; account picker.
;;
;;
;; returned is a tree-structured list of all the old and new accounts
;; like so : (name new? children). trees are sorted alphabetically.
;; This should probably change but it's beeter than no sort at all.
(define (qif-import:get-all-accts extra-maps)
(define (qif-import:get-all-accts extra-maps)
(define (cvt-to-tree path new?)
(if (null? path)
'()
(list (car path) new?
(list (car path) new?
(if (null? (cdr path)) '()
(list (cvt-to-tree (cdr path) new?))))))
(define (merge-into-tree tree path new?)
(if (null? path)
tree
@@ -705,58 +757,58 @@
(set! newtree
(cons (list (car path)
(and new? (cadr tree-elt))
(merge-into-tree
(merge-into-tree
old-children (cdr path) new?))
(append newtree tree-left))))
(begin
(begin
(set! newtree (cons tree-elt newtree))
(if (not (null? tree-left))
(loop (car tree-left) (cdr tree-left))
(set! newtree (cons (cvt-to-tree path new?)
newtree))))))
(sort newtree (lambda (a b) (string<? (car a) (car b))))))))
(let ((accts '())
(acct-tree '())
(separator (string-ref (gnc-get-account-separator-string) 0)))
;; get the new accounts from the account map
(for-each
(for-each
(lambda (acctmap)
(if acctmap
(if acctmap
(hash-fold
(lambda (k v p)
(if (qif-map-entry:display? v)
(set! accts
(cons
(cons (string-split (qif-map-entry:gnc-name v)
(set! accts
(cons
(cons (string-split (qif-map-entry:gnc-name v)
separator)
(qif-map-entry:new-acct? v))
accts)))
#f)
#f acctmap)))
extra-maps)
;; get the old accounts from the current account group
(for-each
(for-each
(lambda (acct)
(set! accts
(cons
(cons (string-split
(set! accts
(cons
(cons (string-split
(gnc-account-get-full-name acct)
separator)
#f)
accts)))
(gnc-account-get-descendants-sorted (gnc-get-current-root-account)))
;; now build a tree structure
(for-each
;; now build a tree structure
(for-each
(lambda (acct)
(set! acct-tree
(merge-into-tree acct-tree (car acct) (cdr acct))))
accts)
;; we're done
;; we're done
acct-tree))
(define (qif-import:refresh-match-selection matches item)
@@ -765,7 +817,7 @@
(for-each
(lambda (match)
(if (= i item)
(if (cdr match)
(if (cdr match)
(set-cdr! match #f)
(set-cdr! match #t))
(set-cdr! match #f))
+72 -40
View File
@@ -33,7 +33,8 @@
;; - a hash of QIF category to gnucash account info
;; - a hash of QIF memo/payee to gnucash account info
;; (older saved prefs may not have this one)
;; - a hash of QIF stock name to gnc-commodity*
;; - a hash of QIF security name to gnc-commodity*
;; - a list of all previously saved security mappings
;; (older saved prefs may not have this one)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -80,18 +81,18 @@
(let ((qif-account-list #f)
(qif-cat-list #f)
(qif-memo-list #f)
(qif-stock-list #f)
(qif-security-list #f)
(qif-account-hash #f)
(qif-cat-hash #f)
(qif-memo-hash #f)
(qif-stock-hash #f)
(qif-security-hash #f)
(saved-sep #f))
;; Read the mapping file.
(set! qif-account-list (safe-read))
(set! qif-cat-list (safe-read))
(set! qif-memo-list (safe-read))
(set! qif-stock-list (safe-read))
(set! qif-security-list (safe-read))
(set! saved-sep (safe-read))
;; Process the QIF account mapping.
@@ -114,22 +115,24 @@
saved-sep)))
;; Process the QIF security mapping.
(if (not (list? qif-stock-list))
(set! qif-stock-hash (make-hash-table 20))
(set! qif-stock-hash (qif-import:read-commodities
qif-stock-list)))
(if (not (list? qif-security-list))
(set! qif-security-hash (make-hash-table 20))
(set! qif-security-hash (qif-import:read-securities
qif-security-list)))
;; Put all the mappings together in a list.
(set! results (list qif-account-hash
qif-cat-hash
qif-memo-hash
qif-stock-hash)))))
qif-security-hash
qif-security-list)))))
;; Otherwise, we can't get any saved mappings. Use empty tables.
(set! results (list (make-hash-table 20)
(make-hash-table 20)
(make-hash-table 20)
(make-hash-table 20))))
(make-hash-table 20)
'())))
;; Build the list of all known account names.
(let* ((all-accounts (gnc-get-current-root-account))
@@ -180,20 +183,22 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; qif-import:read-commodities
;; qif-import:read-securities
;;
;; This procedure examines a list of previously seen commodities
;; and returns a hash table of them, if they still exist.
;; This procedure examines a list of previously seen security
;; mappings and returns a hash table pairing QIF security names
;; with existing GnuCash commodities.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (qif-import:read-commodities commlist)
(define (qif-import:read-securities security-list)
(let ((table (make-hash-table 20)))
(for-each
(lambda (entry)
(if (and (list? entry)
(= 3 (length entry)))
;; The saved information about each commodity is a
;; list of three items: name, namespace, and mnemonic.
;; The saved information about each security mapping is a
;; list of three items: the QIF name, and the GnuCash
;; namespace and mnemonic (symbol) to which it maps.
;; Example: ("McDonald's" "NYSE" "MCD")
(let ((commodity (gnc-commodity-table-lookup
(gnc-commodity-table-get-table
@@ -201,26 +206,47 @@
(cadr entry)
(caddr entry))))
(if (and commodity (not (null? commodity)))
;; The commodity is defined in GnuCash.
;; There is an existing GnuCash commodity for this
;; combination of namespace and symbol.
(hash-set! table (car entry) commodity)))))
commlist)
security-list)
table))
(define (qif-import:write-commodities hashtab)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; qif-import:write-securities
;;
;; This procedure writes a mapping QIF security names to
;; GnuCash commodity namespaces and mnemonics (symbols).
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (qif-import:write-securities security-hash security-prefs)
(let ((table '()))
;; For each security that has been paired with an existing
;; GnuCash commodity, create a list containing the QIF name
;; and the commodity's namespace and mnemonic (symbol).
(hash-fold
(lambda (key value p)
;;FIXME: we used to type-check the values, like:
;; (gw:wcp-is-of-type? <gnc:commodity*> value)
(if (and value #t)
(set! table
(cons (list key
(gnc-commodity-get-namespace value)
(gnc-commodity-get-mnemonic value))
table))
(gnc:warn "qif-import:write-commodities:"
" something funny in hash table."))
#f) #f hashtab)
(lambda (key value p)
;;FIXME: we used to type-check the values, like:
;; (gw:wcp-is-of-type? <gnc:commodity*> value)
(if (and value #t)
(set! table (cons (list key
(gnc-commodity-get-namespace value)
(gnc-commodity-get-mnemonic value))
table))
(gnc:warn "qif-import:write-securities:"
" something funny in hash table."))
#f)
#f security-hash)
;; Add on the rest of the saved security mapping preferences.
(for-each
(lambda (m)
(if (not (hash-ref security-hash (car m)))
(set! table (cons m table))))
security-prefs)
;; Write out the mappings.
(write table)))
@@ -233,7 +259,8 @@
;; user cancels the import instead.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (qif-import:save-map-prefs acct-map cat-map memo-map stock-map)
(define (qif-import:save-map-prefs acct-map cat-map memo-map
security-map security-prefs)
(let* ((pref-filename (gnc-build-dotgnucash-path "qif-accounts-map")))
;; does the file exist? if not, create it; in either case,
;; make sure it's a directory and we have write and execute
@@ -241,26 +268,31 @@
(with-output-to-file pref-filename
(lambda ()
(display ";;; qif-accounts-map\n")
(display ";;; automatically generated by GNUcash. DO NOT EDIT\n")
(display ";;; (unless you really, really want to).\n")
(display ";;; Automatically generated by GnuCash. DO NOT EDIT.\n")
(display ";;; (Unless you really, really want to.)\n")
(display ";;; map from QIF accounts to GNC accounts") (newline)
(display ";;; Map QIF accounts to GnuCash accounts")
(newline)
(qif-import:write-map acct-map)
(newline)
(display ";;; map from QIF categories to GNC accounts") (newline)
(display ";;; Map QIF categories to GnuCash accounts")
(newline)
(qif-import:write-map cat-map)
(newline)
(display ";;; map from QIF payee/memo to GNC accounts") (newline)
(display ";;; Map QIF payee/memo to GnuCash accounts")
(newline)
(qif-import:write-map memo-map)
(newline)
(display ";;; map from QIF stock name to GNC commodity") (newline)
(qif-import:write-commodities stock-map)
(display ";;; Map QIF security names to GnuCash commodities")
(newline)
(qif-import:write-securities security-map security-prefs)
(newline)
(display ";;; GnuCash separator used in these mappings") (newline)
(display ";;; GnuCash separator used in these mappings")
(newline)
(write (string-ref (gnc-get-account-separator-string) 0))
(newline)))))
+11 -10
View File
@@ -1,8 +1,8 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; qif-import.scm
;;; virtual loader for QIF import facility
;;; virtual loader for QIF import facility
;;;
;;; Bill Gribble <grib@billgribble.com> 20 Feb 2000
;;; Bill Gribble <grib@billgribble.com> 20 Feb 2000
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-module (gnucash import-export qif-import))
@@ -24,25 +24,26 @@
(gnc:module-load "gnucash/app-utils" 0)
(gnc:module-load "gnucash/gnome-utils" 0)
(load-from-path "qif-import/qif-objects.scm") ;; class definitions
(load-from-path "qif-import/qif-objects.scm") ;; class definitions
(load-from-path "qif-import/qif-parse.scm") ;; string-to-value
(load-from-path "qif-import/qif-utils.scm")
(load-from-path "qif-import/qif-file.scm") ;; actual file reading
(load-from-path "qif-import/qif-dialog-utils.scm") ;; build displays
(load-from-path "qif-import/qif-utils.scm")
(load-from-path "qif-import/qif-file.scm") ;; actual file reading
(load-from-path "qif-import/qif-dialog-utils.scm") ;; build displays
(load-from-path "qif-import/qif-guess-map.scm") ;; build acct mappings
(load-from-path "qif-import/qif-to-gnc.scm") ;; conv QIF xtns to GNC
(load-from-path "qif-import/qif-merge-groups.scm") ;; merge into user's acct
(load-from-path "qif-import/qif-to-gnc.scm") ;; conv QIF xtns to GNC
(load-from-path "qif-import/qif-merge-groups.scm") ;; merge into user's acct
(export make-qif-file)
(export make-ticker-map)
(export qif-import:qif-to-gnc)
(export qif-import:get-all-accts)
(export qif-import:fix-from-acct)
(export qif-import:any-new-accts?)
(export qif-import:update-stock-hash)
(export qif-import:update-security-hash)
(export qif-import:refresh-match-selection)
(export qif-import:save-map-prefs)
(export qif-import:load-map-prefs)
(export qif-import:qif-to-gnc)
(export qif-import:qif-to-gnc-undo)
(export qif-map-entry:gnc-name)
(export qif-map-entry:set-gnc-name!)
+13 -1
View File
@@ -661,7 +661,7 @@
ticker-map
(cons stock-symbol (qif-ticker-map:ticker-map ticker-map))))
(define (qif-ticker-map:lookup-ticker ticker-map name)
(define (qif-ticker-map:lookup-symbol ticker-map name)
(let ((retval #f))
(for-each
(lambda (symbol)
@@ -673,3 +673,15 @@
(qif-ticker-map:ticker-map ticker-map))
retval))
(define (qif-ticker-map:lookup-type ticker-map name)
(let ((retval #f))
(for-each
(lambda (symbol)
(if (string=? name (qif-stock-symbol:name symbol))
(begin
(set! retval (qif-stock-symbol:type symbol))
(if (string=? retval "")
(set! retval #f)))))
(qif-ticker-map:ticker-map ticker-map))
retval))
+30 -39
View File
@@ -19,11 +19,11 @@
(define decimal-radix-regexp
(make-regexp
"^ *\\$?[+-]?\\$?[0-9]+$|^ *\\$?[+-]?\\$?[0-9]?[0-9]?[0-9]?(,[0-9][0-9][0-9])*(\\.[0-9]*)? *$|^ *\\$?[+-]?\\$?[0-9]+\\.[0-9]* *$"))
"^ *\\$?[+-]?\\$?[0-9]+$|^ *\\$?[+-]?\\$?[0-9]?[0-9]?[0-9]?([,'][0-9][0-9][0-9])*(\\.[0-9]*)? *$|^ *\\$?[+-]?\\$?[0-9]+\\.[0-9]* *$"))
(define comma-radix-regexp
(make-regexp
"^ *\\$?[+-]?\\$?[0-9]+$|^ *\\$?[+-]?\\$?[0-9]?[0-9]?[0-9]?(\\.[0-9][0-9][0-9])*(,[0-9]*)? *$|^ *\\$?[+-]?\\$?[0-9]+,[0-9]* *$"))
"^ *\\$?[+-]?\\$?[0-9]+$|^ *\\$?[+-]?\\$?[0-9]?[0-9]?[0-9]?([\\.'][0-9][0-9][0-9])*(,[0-9]*)? *$|^ *\\$?[+-]?\\$?[0-9]+,[0-9]* *$"))
(define integer-regexp (make-regexp "^\\$?[+-]?\\$?[0-9]+ *$"))
@@ -89,26 +89,26 @@
(set! fixed-string
(substring year-string 2 (string-length year-string))))
(set! fixed-string year-string))
;; now the string should just have a number in it plus some
;; optional trailing space.
(set! post-read-value
(with-input-from-string fixed-string
(lambda () (read))))
(cond
;; 2-digit numbers less than the window size are interpreted to
;; be post-2000.
((and (integer? post-read-value)
(< post-read-value y2k-threshold))
(set! y2k-fixed-value (+ 2000 post-read-value)))
;; there's a common bug in printing post-2000 dates that
;; prints 2000 as 19100 etc.
((and (integer? post-read-value)
(> post-read-value 19000))
(set! y2k-fixed-value (+ 1900 (- post-read-value 19000))))
;; normal dates represented in unix years (i.e. year-1900, so
;; 2000 => 100.) We also want to allow full year specifications,
;; (i.e. 1999, 2001, etc) and there's a point at which you can't
@@ -120,11 +120,11 @@
((and (integer? post-read-value)
(< post-read-value 1902))
(set! y2k-fixed-value (+ 1900 post-read-value)))
;; this is a normal, 4-digit year spec (1999, 2000, etc).
((integer? post-read-value)
(set! y2k-fixed-value post-read-value))
;; No idea what the string represents. Maybe a new bug in Quicken!
(#t
(gnc:warn "qif-file:fix-year: ay caramba! What is this? ["
@@ -326,14 +326,14 @@
(with-input-from-string elt
(lambda () (read))))
date-parts))
(let ((possibilities possible-formats)
(n1 (car numeric-date-parts))
(n2 (cadr numeric-date-parts))
(n3 (caddr numeric-date-parts))
(s1 (car date-parts))
(s3 (caddr date-parts)))
;; filter the possibilities to eliminate (hopefully)
;; all but one
(if (or (not (number? n1)) (> n1 12))
@@ -344,22 +344,22 @@
(set! possibilities (delq 'd-m-y possibilities)))
(if (or (not (number? n1)) (< n1 1))
(set! possibilities (delq 'm-d-y possibilities)))
(if (or (not (number? n2)) (> n2 12))
(begin
(set! possibilities (delq 'd-m-y possibilities))
(set! possibilities (delq 'y-m-d possibilities))))
(if (or (not (number? n2)) (> n2 31))
(begin
(set! possibilities (delq 'm-d-y possibilities))
(set! possibilities (delq 'y-d-m possibilities))))
(if (or (not (number? n3)) (> n3 12))
(set! possibilities (delq 'y-d-m possibilities)))
(if (or (not (number? n3)) (> n3 31))
(set! possibilities (delq 'y-m-d possibilities)))
(if (or (not (number? n3)) (< n3 1))
(set! possibilities (delq 'y-m-d possibilities)))
(if (or (not (number? n3)) (< n3 1))
@@ -449,14 +449,14 @@
(match:substring m 2)
(match:substring m 3)))))
))))
;; get the strings into numbers (but keep the strings around)
(set! numeric-date-parts
(map (lambda (elt)
(with-input-from-string elt
(lambda () (read))))
date-parts))
;; if the date parts list doesn't have 3 parts, we're in
;; trouble
(if (not (eq? 3 (length date-parts)))
@@ -473,7 +473,7 @@
(gnc:warn "qif-parse:parse-date/format: "
"format is d/m/y, but date is ["
date-string "]."))))
((m-d-y)
(let ((m (car numeric-date-parts))
(d (cadr numeric-date-parts))
@@ -484,7 +484,7 @@
(gnc:warn "qif-parse:parse-date/format: "
"format is m/d/y, but date is ["
date-string "]."))))
((y-m-d)
(let ((y (qif-parse:fix-year (car date-parts) 50))
(m (cadr numeric-date-parts))
@@ -495,7 +495,7 @@
(gnc:warn "qif-parse:parse-date/format: "
"format is y/m/d, but date is ["
date-string "]."))))
((y-d-m)
(let ((y (qif-parse:fix-year (car date-parts) 50))
(d (cadr numeric-date-parts))
@@ -553,13 +553,9 @@
(define (qif-parse:parse-number/format value-string format)
(case format
((decimal)
(let* ((filtered-string
(string-remove-char
(string-remove-char value-string #\,)
#\$))
(read-val
(with-input-from-string filtered-string
(lambda () (read)))))
(let* ((filtered-string (string-remove-chars value-string ",$'"))
(read-val (with-input-from-string filtered-string
(lambda () (read)))))
(if (number? read-val)
(double-to-gnc-numeric
(+ 0.0 read-val) GNC-DENOM-AUTO
@@ -568,15 +564,11 @@
GNC-RND-ROUND))
(gnc-numeric-zero))))
((comma)
(let* ((filtered-string
(string-remove-char
(string-replace-char!
(string-remove-char value-string #\.)
#\, #\.)
#\$))
(read-val
(with-input-from-string filtered-string
(lambda () (read)))))
(let* ((filtered-string (string-replace-char
(string-remove-chars value-string ".$'")
#\, #\.))
(read-val (with-input-from-string filtered-string
(lambda () (read)))))
(if (number? read-val)
(double-to-gnc-numeric
(+ 0.0 read-val) GNC-DENOM-AUTO
@@ -585,10 +577,9 @@
GNC-RND-ROUND))
(gnc-numeric-zero))))
((integer)
(let ((read-val
(with-input-from-string
(string-remove-char value-string #\$)
(lambda () (read)))))
(let ((read-val (with-input-from-string (string-remove-char value-string
#\$)
(lambda () (read)))))
(if (number? read-val)
(double-to-gnc-numeric
(+ 0.0 read-val) 1 GNC-RND-ROUND)
+32 -4
View File
@@ -6,6 +6,8 @@
;;; Copyright 2000-2001 Bill Gribble <grib@billgribble.com>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(use-modules (srfi srfi-13))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; qif-import:find-or-make-acct
@@ -195,8 +197,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; qif-import:qif-to-gnc
;; this is the top-level of the back end conversion from
;; QIF to GNC. all the account mappings and so on should be
;;
;; This is the top-level of the back end conversion from QIF
;; to GnuCash. All the account mappings and so on should be
;; done before this is called.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -325,7 +328,7 @@
(splitloop (cdr splits))))))
(qif-file:xtns qif-file)))
qif-files-list)
(if (> work-to-do 100)
(begin
(set! progress-dialog (gnc-progress-dialog-new window #f))
@@ -349,7 +352,7 @@
(qif-import:mark-matching-xtns xtn rest))
(if (not (null? (cdr rest)))
(xloop (car rest) (cdr rest)))))
;; iterate over files. Going in the sort order by number of
;; transactions should give us a small speed advantage.
(for-each
@@ -745,6 +748,12 @@
(xaccSplitSetParent commission-split gnc-xtn)
(xaccSplitSetAccount commission-split
commission-acct)))))))
;; QIF indicates a void transaction by starting the payee with "**VOID**".
(if (and (string? qif-payee)
(string-prefix? "**VOID**" qif-payee))
(xaccTransVoid gnc-xtn "QIF"))
;; return the modified transaction (though it's ignored).
gnc-xtn))
@@ -1170,3 +1179,22 @@
(loop (cdr splits)))))
(if all-marked
(qif-xtn:set-mark! xtn #t))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; qif-import:qif-to-gnc-undo
;;
;; Cancel the import by removing all newly created accounts,
;; splits, and transactions.
;;
;; NOTE: Any new commodities should be destroyed by the druid.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (qif-import:qif-to-gnc-undo root)
(if root
(let ((txns (gnc:account-tree-get-transactions root)))
;; Destroy all the transactions and their splits.
(for-each (lambda (elt) (xaccTransDestroy elt)) txns)
;; Destroy the accounts
(xaccAccountBeginEdit root)
(xaccAccountDestroy root))))
@@ -5,6 +5,9 @@
;;; Bill Gribble <grib@billgribble.com> 20 Feb 2000
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(use-modules (srfi srfi-13))
(define (simple-filter pred list)
(let ((retval '()))
(map (lambda (elt)
@@ -45,10 +48,34 @@
(make-string 1 char)))))
(regexp-substitute/global #f rexpstr str 'pre 'post)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; string-remove-chars
;;
;; Removes all characters in string "chars" from string "str".
;; Example: (string-remove-chars "abcd" "cb") returns "ad".
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (string-remove-chars str chars)
(string-delete str (lambda (c) (string-index chars c))))
(define (string-char-count str char)
(length (simple-filter (lambda (elt) (eq? elt char))
(string->list str))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; string-replace-char
;;
;; Replaces all occurrences of char "old" with char "new".
;; Example: (string-replace-char "foo" #\o #\c) returns "fcc".
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (string-replace-char str old new)
(string-map (lambda (c) (if (char=? c old) new c)) str))
(define (string-replace-char! str old new)
(let ((rexpstr
(if (not (eq? old #\.))
+376 -118
View File
@@ -38,7 +38,7 @@
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">gnc-new-account</property>
<property name="label" translatable="no">gnc-new-account</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
@@ -87,12 +87,31 @@
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkFrame" id="frame1">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0.5</property>
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
<child>
<widget class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="label" translatable="yes">_Select or add a GnuCash account:</property>
<property name="use_underline">Yes</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">5</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">account_tree</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">5</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow24">
@@ -117,36 +136,6 @@
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="label" translatable="yes">Select or add a GnuCash account</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
@@ -675,7 +664,7 @@ Note that GnuCash will be creating many accounts that did not exist on your othe
<property name="visible">True</property>
<property name="title" translatable="yes">Match QIF accounts with GnuCash accounts</property>
<property name="title_foreground">#f5f5f5f5f5f5</property>
<signal name="prepare" handler="gnc_ui_qif_import_accounts_prepare_cb"/>
<signal name="prepare" handler="gnc_ui_qif_import_account_prepare_cb"/>
<signal name="next" handler="gnc_ui_qif_import_generic_next_cb"/>
<signal name="back" handler="gnc_ui_qif_import_generic_back_cb"/>
@@ -684,7 +673,33 @@ Note that GnuCash will be creating many accounts that did not exist on your othe
<property name="border_width">25</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<property name="spacing">5</property>
<child>
<widget class="GtkLabel" id="label7609">
<property name="visible">True</property>
<property name="label" translatable="yes">_Select the matchings you want to change:</property>
<property name="use_underline">Yes</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">5</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">account_page_view</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">5</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow11">
@@ -717,25 +732,81 @@ Note that GnuCash will be creating many accounts that did not exist on your othe
</child>
<child>
<widget class="GtkLabel" id="label828">
<widget class="GtkHBox" id="hbox7609">
<property name="visible">True</property>
<property name="label" translatable="yes">Click &quot;Forward&quot; to check matchings for QIF categories. </property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="label7610">
<property name="visible">True</property>
<property name="label" translatable="yes">Matchings selected:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="account_page_count">
<property name="visible">True</property>
<property name="label" translatable="no">0</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">3</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="account_page_change">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Change GnuCash _Account...</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="gnc_ui_qif_import_account_rematch_cb"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">3</property>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
@@ -798,8 +869,8 @@ If you change your mind later, you can reorganize the account structure safely w
<property name="visible">True</property>
<property name="title" translatable="yes">Match QIF categories with GnuCash accounts</property>
<property name="title_foreground">#f5f5f5f5f5f5</property>
<signal name="prepare" handler="gnc_ui_qif_import_categories_prepare_cb"/>
<signal name="next" handler="gnc_ui_qif_import_categories_next_cb"/>
<signal name="prepare" handler="gnc_ui_qif_import_category_prepare_cb"/>
<signal name="next" handler="gnc_ui_qif_import_category_next_cb"/>
<signal name="back" handler="gnc_ui_qif_import_generic_back_cb"/>
<child internal-child="vbox">
@@ -807,7 +878,33 @@ If you change your mind later, you can reorganize the account structure safely w
<property name="border_width">25</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<property name="spacing">5</property>
<child>
<widget class="GtkLabel" id="label7611">
<property name="visible">True</property>
<property name="label" translatable="yes">_Select the matchings you want to change:</property>
<property name="use_underline">Yes</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">5</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">category_page_view</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">5</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow12">
@@ -839,25 +936,81 @@ If you change your mind later, you can reorganize the account structure safely w
</child>
<child>
<widget class="GtkLabel" id="label829">
<widget class="GtkHBox" id="hbox7612">
<property name="visible">True</property>
<property name="label" translatable="yes">Click &quot;Forward&quot; to enter information about the currency used in your QIF files.</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="label7613">
<property name="visible">True</property>
<property name="label" translatable="yes">Matchings selected:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="category_page_count">
<property name="visible">True</property>
<property name="label" translatable="no">0</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">3</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="category_page_change">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Change GnuCash _Account...</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="gnc_ui_qif_import_category_rematch_cb"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">3</property>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
@@ -929,6 +1082,32 @@ In the following page, you will see the text that appears in the Payee and Memo
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="label7614">
<property name="visible">True</property>
<property name="label" translatable="yes">_Select the matchings you want to change:</property>
<property name="use_underline">Yes</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">5</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">memo_page_view</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">5</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow12">
<property name="visible">True</property>
@@ -957,6 +1136,87 @@ In the following page, you will see the text that appears in the Payee and Memo
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox7615">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="label7616">
<property name="visible">True</property>
<property name="label" translatable="yes">Matchings selected:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="memo_page_count">
<property name="visible">True</property>
<property name="label" translatable="no">0</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">3</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="memo_page_change">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Change GnuCash _Account...</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="gnc_ui_qif_import_memo_rematch_cb"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
@@ -980,50 +1240,8 @@ In the following page, you will see the text that appears in the Payee and Memo
<child>
<widget class="GtkLabel" id="label831">
<property name="visible">True</property>
<property name="label" translatable="yes">The QIF importer cannot currently handle multi-currency QIF files. All the accounts in the QIF file(s) you are importing must be denominated in the same currency. This limitation should be removed soon.
Select the currency to use for transactions imported from your QIF files:
<property name="label" translatable="yes">The QIF importer cannot currently handle multi-currency QIF files. All the accounts you are importing must be denominated in the same currency.
</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkComboBoxEntry" id="currency_comboboxentry">
<property name="visible">True</property>
<property name="items">Dummy currency entry</property>
<property name="add_tearoffs">False</property>
<property name="has_frame">True</property>
<property name="focus_on_click">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label832">
<property name="visible">True</property>
<property name="label" translatable="yes">Click &quot;Forward&quot; to enter information about stocks and mutual funds in the imported data.</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
@@ -1042,7 +1260,47 @@ Select the currency to use for transactions imported from your QIF files:
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label832">
<property name="visible">True</property>
<property name="label" translatable="yes">_Select the currency to use for all imported transactions:</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">4</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">currency_comboboxentry</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkComboBoxEntry" id="currency_comboboxentry">
<property name="visible">True</property>
<property name="items">Dummy currency entry</property>
<property name="add_tearoffs">False</property>
<property name="has_frame">True</property>
<property name="focus_on_click">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
+42 -17
View File
@@ -36,31 +36,48 @@ gncpixmap_DATA = \
stock_split_title.png \
stock_split_watermark.png
gncnormalicondir = ${datadir}/icons/hicolor/48x48/apps
gncnormalicon_DATA = 48x48/gnucash-icon.png
48x48/gnucash-icon.png: gnucash-icon-48x48.png
-mkdir -p 48x48
cp ${srcdir}/gnucash-icon-48x48.png 48x48/gnucash-icon.png
gnclargeicondir = ${datadir}/icons/hicolor/48x48/apps
gnclargeicon_DATA = 48x48/gnucash-icon.png
gncmediumicondir = ${datadir}/icons/hicolor/32x32/apps
gncmediumicon_DATA = 32x32/gnucash-icon.png
32x32/gnucash-icon.png: gnucash-icon-32x32.png
-mkdir -p 32x32
cp ${srcdir}/gnucash-icon-32x32.png 32x32/gnucash-icon.png
gncsmallicondir = ${datadir}/icons/hicolor/16x16/apps
gncsmallicon_DATA = 16x16/gnucash-icon.png
16x16/gnucash-icon.png: gnucash-icon-16x16.png
-mkdir -p 16x16
cp ${srcdir}/gnucash-icon-16x16.png 16x16/gnucash-icon.png
gncsmalltwfouricondir = ${datadir}/icons/hicolor/24x24/apps
gncsmalltwfouricon_DATA = 24x24/gnucash-icon.png
gncsmalltwtwoicondir = ${datadir}/icons/hicolor/22x22/apps
gncsmalltwtwoicon_DATA = 22x22/gnucash-icon.png
gncextrasmallicondir = ${datadir}/icons/hicolor/16x16/apps
gncextrasmallicon_DATA = 16x16/gnucash-icon.png
gncscalableicondir = ${datadir}/icons/hicolor/scalable/apps
gncscalableicon_DATA = scalable/gnucash-icon.svg
if BUILDING_FROM_SVN
scalable/gnucash-icon.svg: ${top_srcdir}/art/icon.svgz
48x48/gnucash-icon.png: gnucash-icon-48x48.png
-mkdir -p 48x48
cp ${srcdir}/gnucash-icon-48x48.png 48x48/gnucash-icon.png
32x32/gnucash-icon.png: ${top_srcdir}/art/tango/32x32/gnucash.png
-mkdir -p 32x32
cp ${top_srcdir}/art/tango/32x32/gnucash.png 32x32/gnucash-icon.png
24x24/gnucash-icon.png: ${top_srcdir}/art/tango/22x22/gnucash-24x24.png
-mkdir -p 24x24
cp ${top_srcdir}/art/tango/22x22/gnucash-24x24.png 24x24/gnucash-icon.png
22x22/gnucash-icon.png: ${top_srcdir}/art/tango/22x22/gnucash-22x22.png
-mkdir -p 22x22
cp ${top_srcdir}/art/tango/22x22/gnucash-22x22.png 22x22/gnucash-icon.png
16x16/gnucash-icon.png: ${top_srcdir}/art/tango/16x16/gnucash.png
-mkdir -p 16x16
cp ${top_srcdir}/art/tango/16x16/gnucash.png 16x16/gnucash-icon.png
scalable/gnucash-icon.svg: ${top_srcdir}/art/tango/scalable/gnucash.svg
-mkdir -p scalable
gzip -cd ${top_srcdir}/art/icon.svgz > scalable/gnucash-icon.svg
cp ${top_srcdir}/art/tango/scalable/gnucash.svg scalable/gnucash-icon.svg
endif
# As suggested by <http://live.gnome.org/GnomeGoals/AppIcon>
@@ -80,7 +97,15 @@ endif
EXTRA_DIST = \
${gncpixmap_DATA} \
${gncnormalicon_DATA} ${gncmediumicon_DATA} ${gncsmallicon_DATA} ${gncscalableicon_DATA}
${gnclargeicon_DATA} \
${gncmediumicon_DATA} \
${gncsmalltwfouricon_DATA} \
${gncsmalltwtwoicon_DATA} \
${gncextrasmallicon_DATA} \
${gncscalableicon_DATA}
# Only clean up if we're building from SVN
if BUILDING_FROM_SVN
clean-local:
-rm -rf 48x48 32x32 16x16 scalable
-rm -rf 48x48 32x32 24x24 22x22 16x16 scalable
endif
+20 -15
View File
@@ -302,14 +302,15 @@ gnc_split_register_load (SplitRegister *reg, GList * slist,
find_trans = blank_trans;
find_split = NULL;
find_trans_split = blank_split;
find_class = CURSOR_CLASS_SPLIT;
}
else
{
find_trans = info->cursor_hint_trans;
find_split = info->cursor_hint_split;
find_trans_split = info->cursor_hint_trans_split;
find_class = info->cursor_hint_cursor_class;
}
find_class = info->cursor_hint_cursor_class;
save_loc = table->current_cursor_loc;
@@ -362,26 +363,30 @@ gnc_split_register_load (SplitRegister *reg, GList * slist,
}
}
/* set the completion character for the xfer cells */
gnc_combo_cell_set_complete_char(
(ComboCell *) gnc_table_layout_get_cell(table->layout, MXFRM_CELL),
gnc_get_account_separator());
gnc_combo_cell_set_complete_char(
(ComboCell *) gnc_table_layout_get_cell(table->layout, XFRM_CELL),
gnc_get_account_separator());
/* set the confirmation callback for the reconcile cell */
gnc_recn_cell_set_confirm_cb(
(RecnCell *) gnc_table_layout_get_cell(table->layout, RECN_CELL),
gnc_split_register_recn_cell_confirm, reg);
/* load up account names into the transfer combobox menus */
gnc_split_register_load_xfer_cells (reg, default_account);
gnc_split_register_load_recn_cells (reg);
gnc_split_register_load_type_cells (reg);
}
if (info->separator_changed) {
info->separator_changed = FALSE;
/* set the completion character for the xfer cells */
gnc_combo_cell_set_complete_char(
(ComboCell *) gnc_table_layout_get_cell(table->layout, MXFRM_CELL),
gnc_get_account_separator());
gnc_combo_cell_set_complete_char(
(ComboCell *) gnc_table_layout_get_cell(table->layout, XFRM_CELL),
gnc_get_account_separator());
/* set the confirmation callback for the reconcile cell */
gnc_recn_cell_set_confirm_cb(
(RecnCell *) gnc_table_layout_get_cell(table->layout, RECN_CELL),
gnc_split_register_recn_cell_confirm, reg);
}
table->model->dividing_row = -1;
// Ensure that the transaction and splits being edited are in the split
@@ -108,6 +108,9 @@ struct sr_info
char *credit_str;
char *tdebit_str;
char *tcredit_str;
/* true if the account separator has changed */
gboolean separator_changed;
};
@@ -55,6 +55,7 @@ gnc_split_register_init_info (SplitRegister *reg)
info->first_pass = TRUE;
info->full_refresh = TRUE;
info->separator_changed = TRUE;
reg->sr_info = info;
}
+24 -10
View File
@@ -1400,7 +1400,7 @@ gnc_split_register_save (SplitRegister *reg, gboolean do_commit)
g_assert(xaccTransIsOpen(trans));
/* If we are committing the blank split, add it to the account now */
if (trans == blank_trans)
if (split == blank_split && !info->blank_split_edited)
{
account = gnc_split_register_get_default_account(reg);
if (account)
@@ -2149,6 +2149,7 @@ split_register_gconf_changed (GConfEntry *entry, gpointer user_data)
SplitRegister * reg = user_data;
SRInfo *info;
g_return_if_fail(entry && entry->key);
if (reg == NULL)
return;
@@ -2156,16 +2157,23 @@ split_register_gconf_changed (GConfEntry *entry, gpointer user_data)
if (!info)
return;
/* Release current strings. Will be reloaded at next reference. */
g_free (info->debit_str);
g_free (info->tdebit_str);
g_free (info->credit_str);
g_free (info->tcredit_str);
if (g_str_has_suffix(entry->key, KEY_ACCOUNTING_LABELS)) {
/* Release current strings. Will be reloaded at next reference. */
g_free (info->debit_str);
g_free (info->tdebit_str);
g_free (info->credit_str);
g_free (info->tcredit_str);
info->debit_str = NULL;
info->tdebit_str = NULL;
info->credit_str = NULL;
info->tcredit_str = NULL;
info->debit_str = NULL;
info->tdebit_str = NULL;
info->credit_str = NULL;
info->tcredit_str = NULL;
} else if (g_str_has_suffix(entry->key, KEY_ACCOUNT_SEPARATOR)) {
info->separator_changed = TRUE;
} else {
g_warning("split_register_gconf_changed: Unknown gconf key %s", entry->key);
}
}
static void
@@ -2184,6 +2192,9 @@ gnc_split_register_init (SplitRegister *reg,
gnc_gconf_general_register_cb(KEY_ACCOUNTING_LABELS,
split_register_gconf_changed,
reg);
gnc_gconf_general_register_cb(KEY_ACCOUNT_SEPARATOR,
split_register_gconf_changed,
reg);
reg->sr_info = NULL;
@@ -2415,6 +2426,9 @@ gnc_split_register_destroy (SplitRegister *reg)
gnc_gconf_general_remove_cb(KEY_ACCOUNTING_LABELS,
split_register_gconf_changed,
reg);
gnc_gconf_general_remove_cb(KEY_ACCOUNT_SEPARATOR,
split_register_gconf_changed,
reg);
gnc_split_register_cleanup (reg);
gnc_table_destroy (reg->table);
@@ -385,7 +385,7 @@
accounts
(lambda (acct) (gnc:account-get-comm-balance-at-date
acct beforebegindate #f))
gnc-reverse-balance))
(lambda (x) #f)))
(gnc:report-percent-done 50)
(set! startbal
+3 -1
View File
@@ -39,7 +39,9 @@
;;;; Private
(define (gnc:txf-get-code-info categories code index)
(vector-ref (cdr (assv code categories)) index))
(let ((category (assv code categories)))
(and category
(vector-ref (cdr category) index))))
(define txf-help-categories
(list
+3 -1
View File
@@ -30,7 +30,9 @@
;;;; Private
(define (gnc:txf-get-code-info categories code index)
(vector-ref (cdr (assv code categories)) index))
(let ((category (assv code categories)))
(and category
(vector-ref (cdr category) index))))
(define txf-help-categories
(list
+13 -4
View File
@@ -54,22 +54,31 @@ then
fi
fi
if test $OSTYPE == "msys"
then
svk_name="svk.bat"
svk_cmd="cmd \/c svk"
else
svk_name="svk"
svk_cmd="svk"
fi
# Maybe it's SVK? First, check if we've got 'svk' in the path. If not,
# then exit with an error code of 1..
which svk >/dev/null 2>&1
which $svk_name >/dev/null 2>&1
if test $? != 0 ; then exit 1 ; fi
# Okay, we have 'svk'. Now see if $real_srcdir is an svk checkout
# Note that the 'echo n' is to protect against having svk installed
# without having configured the depotmap.
svkinfo=`echo n | svk info "$real_srcdir" 2>&1`
svkinfo=`echo n | $svk_cmd info "$real_srcdir" 2>&1`
if test $? != 0 ; then exit 1 ; fi
# If we got here, then $real_srcdir is an svk checkout. Parse out
# the revision info, print it out, and then output 0. Just combine
# all the revision numbers into a single string by combining them
# with periods.
svkinfo=`svk info "$real_srcdir" | grep Rev | head -5 | sed -e 's/^.* \([0-9:]*\)$/\1/'`
echo $svkinfo | sed -e 's/\s/./g'
svkinfo=`$svk_cmd info "$real_srcdir" | grep Rev | head -5 | sed -e 's/^.* \([0-9:]*\)$/\1/'`
echo $svkinfo | sed -e 's/ /./g'
exit 0