Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherlam committed Feb 13, 2023
2 parents 3f3460f + 851b51d commit d53f3e6
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 74 deletions.
33 changes: 33 additions & 0 deletions bindings/guile/business-core.scm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
(export gnc:owner-get-name-and-address-dep)
(export gnc:owner-get-owner-id)
(export gnc:split->owner)
(export gnc:make-split->owner)

(define (gnc:owner-get-address owner)
(let ((type (gncOwnerGetType owner)))
Expand Down Expand Up @@ -110,6 +111,8 @@
(define gnc:split->owner
(let ((ht (make-hash-table)))
(lambda (split)
(issue-deprecation-warning
"gnc:split->owner is deprecated in 4.x. use gnc:make-split->owner instead.")
(cond
((not split)
(hash-for-each (lambda (k v) (gncOwnerFree v)) ht)
Expand All @@ -125,3 +128,33 @@
owner))
(hash-set! ht (gncSplitGetGUID split) owner)
owner))))))

(define owner-guardian (make-guardian))

(define (reclaim-owners)
(let ((owner (owner-guardian)))
(when owner
(gncOwnerFree owner)
(reclaim-owners))))

(add-hook! after-gc-hook reclaim-owners)

;; Create a function which helps find a split's gncOwner. It will
;; allocate and memoize the owners in a hash table because
;; gncOwnerGetOwnerFromLot is slow. When the function is out of scope,
;; and gc is run, the hash table is destroyed and the above hook will
;; run, releasing the owners via gncOwnerFree.
(define (gnc:make-split->owner)
(let ((ht (make-hash-table)))
(lambda (split)
(or (hash-ref ht (gncSplitGetGUID split))
(let ((lot (xaccSplitGetLot split))
(owner (gncOwnerNew)))
(unless (gncOwnerGetOwnerFromLot lot owner)
(gncOwnerCopy (gncOwnerGetEndOwner
(gncInvoiceGetOwner
(gncInvoiceGetInvoiceFromLot lot)))
owner))
(hash-set! ht (gncSplitGetGUID split) owner)
(owner-guardian owner)
owner)))))
21 changes: 9 additions & 12 deletions gnucash/report/reports/standard/new-aging.scm
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,6 @@ exist but have no suitable transactions."))
(not (or (eqv? type TXN-TYPE-INVOICE)
(eqv? type TXN-TYPE-PAYMENT)))))

(define (split-has-owner? split owner)
(gncOwnerEqual (gnc:split->owner split) owner))

(define (split-owner-is-invalid? split)
(not (gncOwnerIsValid (gnc:split->owner split))))

(define (split-from-acct? split acct)
(equal? acct (xaccSplitGetAccount split)))

Expand All @@ -170,6 +164,14 @@ exist but have no suitable transactions."))
(define (op-value section name)
(gnc-optiondb-lookup-value options section name))

(define split->owner (gnc:make-split->owner))

(define (split-has-owner? split owner)
(gncOwnerEqual (split->owner split) owner))

(define (split-owner-is-invalid? split)
(not (gncOwnerIsValid (split->owner split))))

(define make-heading-list
(list (G_ "Company")
(G_ "Pre-Payment")
Expand Down Expand Up @@ -226,10 +228,6 @@ exist but have no suitable transactions."))
(let* ((splits (xaccQueryGetSplitsUniqueTrans query)))
(qof-query-destroy query)

;; split->owner hashtable should be empty at the start of
;; report renderer. clear it anyway.
(gnc:split->owner #f)

;; loop into each APAR account
(let loop ((accounts accounts)
(splits splits)
Expand Down Expand Up @@ -311,7 +309,6 @@ exist but have no suitable transactions."))
acc-totals)))))
(reverse accounts-and-owners))

(gnc:split->owner #f) ;free the gncOwners
(gnc:html-document-add-object! document table)

(unless (null? invalid-splits)
Expand Down Expand Up @@ -368,7 +365,7 @@ exist but have no suitable transactions."))
owners-and-aging))

((this . _)
(match-let* ((owner (gnc:split->owner this))
(match-let* ((owner (split->owner this))
((owner-splits . other-owner-splits)
(list-split acc-splits split-has-owner? owner))
(aging (gnc:owner-splits->aging-list
Expand Down
12 changes: 5 additions & 7 deletions gnucash/report/reports/standard/new-owner-report.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1218,13 +1218,11 @@ and do not match the transaction."))))))))

(define (gnc:owner-report-create-internal
account split query journal? double? title debit-string credit-string)

(let* ((owner (gnc:split->owner split))
(res (if (gncOwnerIsValid owner)
(owner-report-create-with-enddate owner account #f)
-1)))
(gnc:split->owner #f)
res))
(let* ((split->owner (gnc:make-split->owner))
(owner (split->owner split)))
(if (gncOwnerIsValid owner)
(owner-report-create-with-enddate owner account #f)
-1)))

(gnc:register-report-hook ACCT-TYPE-RECEIVABLE #t gnc:owner-report-create-internal)
(gnc:register-report-hook ACCT-TYPE-PAYABLE #t gnc:owner-report-create-internal)
Expand Down
64 changes: 29 additions & 35 deletions po/cs.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,24 @@
# Miloslav Trmac <mitr@volny.cz>, 2002, 2003, 2004, 2007.
# Petr Pisar <petr.pisar@atlas.cz>, 2012.
# Tomáš Václavík <t3vaclavik@gmail.com>, 2022.
# Kryštof Černý <cleverline1mc@gmail.com>, 2023.
msgid ""
msgstr ""
"Project-Id-Version: GnuCash 4.13-pre1\n"
"Report-Msgid-Bugs-To: https://bugs.gnucash.org/enter_bug.cgi?"
"product=GnuCash&component=Translations\n"
"Report-Msgid-Bugs-To: https://bugs.gnucash.org/enter_bug."
"cgi?product=GnuCash&component=Translations\n"
"POT-Creation-Date: 2022-12-04 19:47-0800\n"
"PO-Revision-Date: 2022-03-14 23:55+0000\n"
"Last-Translator: Tomáš Václavík <t3vaclavik@gmail.com>\n"
"PO-Revision-Date: 2023-02-04 21:01+0000\n"
"Last-Translator: Kryštof Černý <cleverline1mc@gmail.com>\n"
"Language-Team: Czech <https://hosted.weblate.org/projects/gnucash/gnucash/cs/"
">\n"
"Language: cs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Weblate 4.12-dev\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Weblate 4.16-dev\n"
"X-Bugs: Report translation errors to the Language-Team address.\n"

#: borrowed/goffice/go-charmap-sel.c:70
Expand Down Expand Up @@ -7289,7 +7290,7 @@ msgstr "je menší než"
#: gnucash/gnome-search/search-int64.c:188
#: gnucash/gnome-search/search-numeric.c:221
msgid "is less than or equal to"
msgstr "je menší nebo rovný "
msgstr "je menší nebo rovný"

#: gnucash/gnome-search/search-double.c:187
#: gnucash/gnome-search/search-int64.c:189
Expand Down Expand Up @@ -8048,7 +8049,7 @@ msgstr "Zvolte obrázek"

#: gnucash/gnome-utils/dialog-options.c:2881
msgid "Select an image file."
msgstr "Zvolte soubor obrázku"
msgstr "Zvolte soubor obrázku."

#: gnucash/gnome-utils/dialog-options.c:3061
msgid "Pixels"
Expand Down Expand Up @@ -10464,7 +10465,7 @@ msgstr "%s, Celkem neměnové komodity:"
#: gnucash/gnome-utils/window-main-summarybar.c:315
#, c-format
msgid "%s, Grand Total:"
msgstr "%s, Úplný součet"
msgstr "%s, Úplný součet:"

#: gnucash/gnome-utils/window-main-summarybar.c:319
#, c-format
Expand Down Expand Up @@ -12487,7 +12488,7 @@ msgstr "Naposledy otevřený soubor"

#: gnucash/gschemas/org.gnucash.GnuCash.history.gschema.xml.in:11
msgid "This field contains the full path of the most recently opened file."
msgstr "Toto pole obsahuje úplnou cestu k naposledy otevřenému souboru"
msgstr "Toto pole obsahuje úplnou cestu k naposledy otevřenému souboru."

#: gnucash/gschemas/org.gnucash.GnuCash.history.gschema.xml.in:15
#: gnucash/gschemas/org.gnucash.GnuCash.history.gschema.xml.in:20
Expand All @@ -12512,7 +12513,7 @@ msgstr "Další naposledy otevřený soubor"
#: gnucash/gschemas/org.gnucash.GnuCash.history.gschema.xml.in:56
msgid ""
"This field contains the full path of the next most recently opened file."
msgstr "Toto pole obsahuje úplnou cestu k dalšímu naposledy otevřenému souboru"
msgstr "Toto pole obsahuje úplnou cestu k dalšímu naposledy otevřenému souboru."

#: gnucash/gschemas/org.gnucash.GnuCash.warnings.gschema.xml.in:9
#: gnucash/gschemas/org.gnucash.GnuCash.warnings.gschema.xml.in:132
Expand Down Expand Up @@ -13343,9 +13344,8 @@ msgstr ""

#: gnucash/gtkbuilder/assistant-csv-price-import.glade:193
#: gnucash/gtkbuilder/assistant-csv-trans-import.glade:183
#, fuzzy
msgid "<b>Load and Save Settings</b>"
msgstr "Spořicí účet"
msgstr "<b>Načíst a uložit nastavení</b>"

#: gnucash/gtkbuilder/assistant-csv-price-import.glade:242
#: gnucash/gtkbuilder/assistant-csv-trans-import.glade:231
Expand Down Expand Up @@ -15040,8 +15040,6 @@ msgid ""
msgstr ""

#: gnucash/gtkbuilder/dialog-account.glade:1517
#, fuzzy
#| msgid "Opening Balance"
msgid "Opening balance"
msgstr "Počáteční zůstatek"

Expand Down Expand Up @@ -17014,7 +17012,7 @@ msgstr "Zobrazovat _úvodní obrazovku"

#: gnucash/gtkbuilder/dialog-preferences.glade:1780
msgid "Show splash screen at startup."
msgstr "Zobrazovat úvodní obrazovku při spouštění"
msgstr "Zobrazovat úvodní obrazovku při spouštění."

#: gnucash/gtkbuilder/dialog-preferences.glade:1795
msgid "Auto-save time _interval"
Expand Down Expand Up @@ -17268,7 +17266,7 @@ msgstr "_Automaticky zvýšit seznamy"

#: gnucash/gtkbuilder/dialog-preferences.glade:2799
msgid "Automatically raise the list of accounts or actions during input."
msgstr "Automaticky při vstupu zvýšit seznam účtů nebo akcí"
msgstr "Při vstupu automaticky zvýšit seznam účtů nebo akcí."

#: gnucash/gtkbuilder/dialog-preferences.glade:2811
msgid "Tab order in_cludes Transfer on Memorised Transactions"
Expand Down Expand Up @@ -17521,7 +17519,7 @@ msgstr "Přesunout _nedávnou použitou záložku dopředu"

#: gnucash/gtkbuilder/dialog-preferences.glade:3885
msgid "<b>Tab Position</b>"
msgstr "<b>Umístění záložek</b>"
msgstr "<b>Umístění karet</b>"

#: gnucash/gtkbuilder/dialog-preferences.glade:3974
#, fuzzy
Expand Down Expand Up @@ -17874,11 +17872,11 @@ msgstr "_Otočení"

#: gnucash/gtkbuilder/dialog-print-check.glade:1031
msgid "The origin point is the upper left-hand corner of the page."
msgstr "Bod počátku je levý horní roh stránky"
msgstr "Bod počátku je levý horní roh stránky."

#: gnucash/gtkbuilder/dialog-print-check.glade:1044
msgid "The origin point is the lower left-hand corner of the page."
msgstr "Bod počátku je levý dolní roh stránky"
msgstr "Bod počátku je levý dolní roh stránky."

#: gnucash/gtkbuilder/dialog-print-check.glade:1057
msgid "Degrees"
Expand Down Expand Up @@ -19282,9 +19280,8 @@ msgid "Save the sort order for this register."
msgstr "Upravit hlavní účet této účetní knihy"

#: gnucash/gtkbuilder/gnc-plugin-page-register.glade:1069
#, fuzzy
msgid "_Reverse Order"
msgstr "Pořadí účetní knihy"
msgstr "_Obrátit pořadí"

#: gnucash/gtkbuilder/gnc-plugin-page-register.glade:1073
msgid "Sort in descending order."
Expand All @@ -19310,7 +19307,7 @@ msgstr ""

#: gnucash/gtkbuilder/gnc-recurrence.glade:50
msgid "Every "
msgstr "Každých"
msgstr "Každých "

#: gnucash/gtkbuilder/gnc-recurrence.glade:62
msgid ""
Expand Down Expand Up @@ -21559,14 +21556,12 @@ msgid "Import Customers from csv"
msgstr "Exportovat zákazníky do XML"

#: gnucash/import-export/customer-import/dialog-customer-import-gui.c:188
#, fuzzy
msgid "customers"
msgstr "Zákazník"
msgstr "zákazníci"

#: gnucash/import-export/customer-import/dialog-customer-import-gui.c:189
#, fuzzy
msgid "vendors"
msgstr "Dodavatel"
msgstr "dodavatelé"

#: gnucash/import-export/customer-import/dialog-customer-import-gui.c:197
#, c-format
Expand All @@ -21582,9 +21577,8 @@ msgid ""
msgstr ""

#: gnucash/import-export/customer-import/gnc-plugin-customer-import.c:59
#, fuzzy
msgid "Import _Customers & Vendors..."
msgstr "Exportovat zákazníky do XML"
msgstr "Importovat _zákazníky a dodavatele..."

#: gnucash/import-export/customer-import/gnc-plugin-customer-import.c:59
#, fuzzy
Expand Down Expand Up @@ -22335,8 +22329,8 @@ msgid ""
"You are missing some needed Perl libraries.\n"
"Run 'gnc-fq-update' as root to install them."
msgstr ""
"Chybí vám některé potřebné knihovny Perlu. Nainstalujte je spuštěním 'gnc-fq-"
"update' jako root."
"Chybí vám některé potřebné knihovny Perlu.\n"
"Nainstalujte je spuštěním 'gnc-fq-update' jako root."

#: gnucash/price-quotes.scm:461
#, scheme-format
Expand Down Expand Up @@ -23901,7 +23895,7 @@ msgstr "Zobrazit tabulku"
#: gnucash/report/reports/standard/category-barchart.scm:180
#: gnucash/report/reports/standard/net-charts.scm:134
msgid "Display a table of the selected data."
msgstr "Zobrazit tabulku vybraných dat"
msgstr "Zobrazit tabulku vybraných dat."

#: gnucash/report/reports/example/average-balance.scm:121
#: gnucash/report/reports/example/average-balance.scm:302
Expand All @@ -23910,7 +23904,7 @@ msgstr "Zobrazit graf"

#: gnucash/report/reports/example/average-balance.scm:122
msgid "Display a graph of the selected data."
msgstr "Zobrazit graf vybraných dat"
msgstr "Zobrazit graf vybraných dat."

#: gnucash/report/reports/example/average-balance.scm:126
#: gnucash/report/reports/example/average-balance.scm:301
Expand Down Expand Up @@ -24976,7 +24970,7 @@ msgstr "Používat pod čáry pod sloupci sečtených čísel, jak to dělají
#: gnucash/report/reports/standard/income-statement.scm:85
#: gnucash/report/reports/standard/trial-balance.scm:125
msgid "Display accounts as hyperlinks"
msgstr "Zobrazovat účty jako odkazy?"
msgstr "Zobrazovat účty jako odkazy"

#: gnucash/report/reports/standard/account-summary.scm:116
#: gnucash/report/reports/standard/balance-sheet.scm:111
Expand Down
8 changes: 4 additions & 4 deletions po/glossary/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
# Thomas Jungers <thomasjungers@gmail.com>, 2021.
# Maxime Leroy <lisacintosh@gmail.com>, 2021.
# Sébastien Ray <sebastien.ray@normalesup.org>, 2022.
# aleksej0R <omolice@hotmail.fr>, 2022.
# aleksej0R <omolice@hotmail.fr>, 2022, 2023.
msgid ""
msgstr ""
"Project-Id-Version: GnuCash 4.8\n"
"Report-Msgid-Bugs-To: https://bugs.gnucash.org/enter_bug."
"cgi?product=GnuCash&component=Translations\n"
"POT-Creation-Date: 2021-12-05 20:11+0100\n"
"PO-Revision-Date: 2022-12-19 23:55+0000\n"
"PO-Revision-Date: 2023-02-03 18:38+0000\n"
"Last-Translator: aleksej0R <omolice@hotmail.fr>\n"
"Language-Team: French <https://hosted.weblate.org/projects/gnucash/glossary/"
"fr/>\n"
Expand All @@ -27,7 +27,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 4.15.1-dev\n"
"X-Generator: Weblate 4.16-dev\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!)"
Expand Down Expand Up @@ -265,7 +265,7 @@ msgstr "Livre"

#. "Completing the records of financial affairs for a specific time period, e.g. at the end of the year."
msgid "book closing"
msgstr "fermeture du livre"
msgstr "clôture des comptes"

#. "An estimate or plan of the money available to somebody and how it will be spent over a period of time."
msgid "Budget"
Expand Down

0 comments on commit d53f3e6

Please sign in to comment.