Commit Graph

21857 Commits

Author SHA1 Message Date
Christopher Lam
a63ba72624 [report-utilities] fix: gnc:owner-splits->aging-list uses APAR splits
... instead of payment splits to calculate payment amount, because
payment splits may be in a different currency. using APAR split total
minus invoice amounts is guaranteed to produce correct overpayment
amount in APAR currency.
2019-11-12 15:15:54 +08:00
Christopher Lam
346d2e24da [new-owner-report] use total-number-cell for monetaries
Previous would tag all cells as total-label-cell. Tag monetaries with
total-number-cell which leads to right-aligned period totals.
2019-11-11 22:08:41 +08:00
Christopher Lam
3d5d8191dd [report-utilities] fix: overpayments in gnc:owner-splits->aging-list
Previous algorithm had assumed all payments would match attached
invoices. This updated algorithm does not assume.

Invoice: add into appropriate bucket and save invoice+splits into
list.

Payment: scan payments from invoice+splits to find appropriate
invoice, and deduct from the transfer account. The remainder is an
pre/overpayment and added into prepayment bucket.

It will always assume that the splitlist being processed will *all*
belong to one owner.
2019-11-11 22:08:41 +08:00
Christopher Lam
980776f46f [new-owner-report] fix: overpayments must show prepayment row
If a payment exceeds the amounts from associated invoices, the amount
remaining must be considered a prepayment.
2019-11-11 22:08:41 +08:00
John Ralls
9189bcbe41 Bug 797078 - "Automatic decimal point" Should Not Cause 2 Different Behaviors
It's documented only for automatically inserting the decimal point
so remove the code that affects number display.
2019-11-10 12:33:20 -08:00
Christopher Lam
a482c25072 [new-aging] step 4 - prepended lists must be reversed
after building lists by prepending in b72052137 we need to process
them in reverse to obtain the original sorting of accounts and
owner-list.
2019-11-10 18:17:25 +08:00
Christopher Lam
6f7c6b9de3 [new-aging] step 3 - only render APAR details if APAR-accounts>1
This commit will hide the APAR account anchor if there's only one
found. So, for majority of users with single AP/AR accounts, the aging
report will be very similar to old one. For users with multi APAR
accounts, each one will be shown with header (and anchor) and
indenting to highlight grouping.
2019-11-10 08:51:38 +08:00
Christopher Lam
97798f9fd1 [new-aging] step 2 - reduce indentation level by 1
merge two let* together
2019-11-10 08:51:29 +08:00
Christopher Lam
b72052137b [new-aging] step 1 - split loops into processing vs building table
Instead of rendering html-table all incrementally, build
account-and-owners and owners-and-aging lists first, leaving building
the html-table for the end. tofree is a list of owners which are
generated and must be freed after use.
2019-11-10 08:50:11 +08:00
Christopher Lam
72c20a07c3 [new-owner-report] merge setup-query and setup-job-query
They were very similar.

and remove html-document-set-title! because the document headline will
override title in the renderer.
2019-11-09 15:11:02 +08:00
Christopher Lam
9f4677e346 [new-owner-report] apply total-label-cell to label
Previous used 'total-number-cell' thereby unnecessarily right-aligning
total label cells.

Also xaccTransGetAccountAmount is more appropriate than
xaccTransGetAccountValue because the latter may retrieve numbers in a
currency other than APAR currency.
2019-11-09 14:31:24 +08:00
Christopher Lam
f0701da868 [new-owner-report] modify report row->value accessor
Previously each owner-table row's value would access split's
amount. But this fails for payments spanning multiple invoices,
because these (with a single split to bank) will have a split for each
invoice. Hence split->amount gets only 1 invoice payment amount.

This change modifies to obtain the sum total of split->amounts in the
APAR account thus handles multi-invoice payments correctly.
2019-11-09 06:17:05 +08:00
John Ralls
a4773d2ba7 Ensure all uses of g_table_index are protected from NULL return values.
Including all of the convenience wrappers.

Also remove a few calls where the result is discarded, as it has no
side effects.
2019-11-08 13:12:05 -08:00
John Ralls
2bc7d314ed Bug 797481 - crash on close of unsaved tabs by pressing [X]
Pretty much the only place gnucash_sheet_get_block could crash is in
g_table_index, either because the GTable's GArray has been deleted or
the index is out of range. Add g_return_val_if_false tests for each
possibility.
2019-11-08 12:33:00 -08:00
Robert Fewell
32ff31fead Bug 796945 - Search dialog update - follow up
For some reason on Ubuntu 18.04 that uses Gtk3.22.30 and maybe others
we have to set the scroll window content min height after the dialog
has been shown to get the correct scroll window height
2019-11-08 14:53:29 +00:00
Christopher Lam
952c656144 [dialog-payment] instead of tooltip, render in gtklabel
The warning icon is used to show blocking and non-blocking warnings in
a payment. Increase visibility by showing the warning as a gtklabel
instead of a tooltip.
2019-11-08 18:43:57 +08:00
Christopher Lam
ee19108321 [dialog-payment] tooltip warning if payment is unattached
Completing a payment for a customer without associating with an open
invoice is allowable and is used for prepayments.

Previously this was done silently.

This commit will enable a warning to inform that the payment does not
have an invoice/bill document attached. This warning does not block
the payment however.
2019-11-08 18:42:27 +08:00
Christopher Lam
21d608038e Addendum to UI Jump to Invoice at 535632b02
Previous trans->invoice strategy was flawed. A payment for multiple
invoices would always return the first invoice found.

A safer approach is to find split->invoice -- this enables a split
from a payment for multiple invoices to retrieve the corresponding
invoice.

The disadvantage is that we cannot jump from bank split to invoice
split anymore; this is acceptable because a payment which covers
multiple invoices would lead to ambiguity and would require UI to
select the invoice for jump.
2019-11-06 06:45:55 +08:00
John Ralls
e991fe853c Bug 797086 - Import customer dialog – headers not translated 2019-11-05 09:14:43 -08:00
John Ralls
910cdbfddc Fix compile error, missing return value.
And a condition, !(!inv) to cast inv as a bool is a bit too clever.
inv != NULL more clearly conveys the intent.
2019-11-05 09:14:43 -08:00
Christopher Lam
1a9825febc [new-owner-report] job-reports reverse according to ownertype
Previously job-report assumed owner was customer and assumed use of
A/Receivable account.

This fix ensures the payable? boolean must be derived dynamically from
owner-type rather than from report-type. This commit will check
whether owner is vendor/employee and uses a/payable; otherwise uses
a/receivable.
2019-11-05 23:19:23 +08:00
Christopher Lam
d0743cd0fc [new-aging] restore html link to account register
Current aging-report includes a link to APAR account register. New
aging-report includes the APAR account prior to each section. Ensure
the link to register is offered.
2019-11-05 22:10:16 +08:00
Christopher Lam
1a404b8d76 [new-owner-report] fix signs for calling gnc:owner-splits->aging-list
gnc:owner-splits->aging-list revceives an argument 'receivable'
specifying whether the report is dealing with an AR-type account. The
renderers for the various business types (customer/vendor/employee)
define 'reverse?' to be #f for AR reports, and #t for AP
reports. Therefore we need to send '(not reverse?)' to
gnc:owner-splits->aging-list.

This commit performs 2 changes:
* rename 'reverse?' to 'payable?' to be more explicit throughout
* calls gnc:owner-splits->aging-list with '(not payable?)' instead of
the confusing '(not reverse?)'

The end result is that the signs for aging-list for
new-owner-report.scm is now fixed.
2019-11-05 22:02:02 +08:00
Robert Fewell
085aa76932 Bug 796945 - Search dialog update
Change the search dialog so that when adding search criteria, a max
number of 5 rows are presented before scrolling is required in the
search criteria scroll window so reducing the height required for the
this area and when the search is executed the scroll window is hidden
and the results window has the maximum space available.
2019-11-04 10:23:40 +00:00
Christopher Lam
491088b2f6 Revert "Bug 797468 - Receivable Aging report - phantom company with negative total"
This reverts commit 32a340350d.
2019-11-03 22:29:30 +08:00
Christopher Lam
535632b025 Bug 787295 - Allow UI jump from Business accounts to their relevant invoice/bill/voucher
This enables UI jump via Transaction or Right-click menu to open the
invoice for editing.
2019-11-03 21:06:32 +08:00
Christopher Lam
32a340350d Bug 797468 - Receivable Aging report - phantom company with negative total
usability fix - warn if no documents were selected
2019-11-03 21:06:32 +08:00
Christopher Lam
be4e452424 with-output-to-file -> call-with-output-file 2019-11-03 21:06:32 +08:00
Christopher Lam
977b1fcf9d [qif-guess-map] with-output-to-file -> call-with-output-file
with-output-to-file will redirect stdout to file.
call-with-output-file is better because it accepts a port for it. thus
stdout remains available to log tracefile.
2019-11-03 21:06:32 +08:00
Robert Fewell
0abc09cc4c Fix for previous commit 2ff91cf
When adding new accounts there is no need to clear cached values.
2019-11-03 11:27:26 +00:00
Christopher Lam
3f6c8478a4 [view-column] don't emit raw html, include captured-error 2019-11-03 10:45:07 +08:00
Christopher Lam
d56a47f17a [c-interface] gnc:backtrace-if-exception returns #f if error
previous would return *unspecified* when error was captured.
old code seems to expect #f to signal error
2019-11-03 10:44:50 +08:00
Christopher Lam
47030c7654 [hello-world] fix indenting and incorrect change
928f6145c had changed default list option '(good) to 'good - should be
a list of symbols
2019-11-03 10:24:02 +08:00
Christian Stimming
5870887f12
Merge pull request #597 from ingoha/purpose-encoding
Fix bug 797473, UTF-8 characters were not processed correctly with aqbanking6.
2019-11-02 23:30:54 +01:00
Christian Stimming
99dbb78898 Bug #797405: Fix hiding PIN entry window behind online banking log window
If there is a log window, make the PIN entry transient_for
that one instead of its parent.
2019-11-02 23:17:29 +01:00
Ingo Haschler
b04c494f24 Bug 797473 - UTF8 characters not processed correctly with aqbanking6 2019-11-02 14:12:15 +01:00
Christopher Lam
928f6145c7 cleanup (list->vector (list ...))
this is not an efficiency change, rather a readability change
especially for hello-world which aims to introduce new users to reports.
2019-11-02 20:15:53 +08:00
Christopher Lam
e27338b004 [html-utilities] more deprecations
* gnc:html-table-append-ruler/at! was flawed - the empty-cell defined
as '() would lead to invalid html-table element. it was never used
because colskip was always 0. inline and deprecate function.
2019-11-02 20:15:53 +08:00
Christopher Lam
b5ae8416a0 [new-owner-report] remove dependency on new-aging
because gnc:owner-splits->aging-list belongs to report-utilities.scm
2019-11-02 09:27:13 +08:00
Christopher Lam
158b5caf63 [new-aging] restore display of owner address 2019-11-02 09:05:22 +08:00
Christopher Lam
2df672bdb2 [gncOwner] i18n gncOwnerGetTypeString types 2019-11-02 09:05:22 +08:00
Christopher Lam
b1e32c8a9d [report-utilities] minor refinements 2019-11-01 19:36:08 +08:00
Christopher Lam
5f6413c6c5 [report-utilities] tiny reordering to remove unnecessary reference
instead of split->txn->invoice->lot->invoice
grab split->txn->invoice->lot directly
2019-11-01 19:30:17 +08:00
Christopher Lam
5688204118 [html-style-sheet] compact function using ice-9 match 2019-10-31 09:11:08 +08:00
Christopher Lam
5614cbbe42 [stylesheets] merge easy/fancy/footer stylesheets 2019-10-31 09:07:53 +08:00
Robert Fewell
f35a39c744 Change some spacing in the source files gnc-tree-model-account.* 2019-10-30 13:40:21 +00:00
Robert Fewell
2ff91cf4e1 Bug 797453 - Chart of Accounts is slow to update / redraw
The chart of Accounts tree view gets redrawn often and gets the data
from the model via gnc_tree_model_account_get_value(). As such the
numeric values are constantly being recalculated on every draw which is
not ideal. This change caches all the string values to a GHashTable for
retrieval which should be quicker than before.
Changes to an account will clear the cache for that account and its
parents so values can be updated. Changes to the preference negative
colour clears the whole cache.
2019-10-30 13:39:06 +00:00
Christopher Lam
e83938fdc2 [aging] update error reporting
This error handling was for transactions in APAR accounts whereby
Transaction Currency != Owner Currency. An example is a manually
entered transaction, then assigned as payment to a customer with a
different currency. Update to modern API calls. Show the culprit
split details.

Fixed example output:

IGNORING TRANSACTION!
Invoice Owner: [None:]
Transaction:Txn<d:28/10/19>
Splits are:
Split<d:28/10/19,acc:Current,amt:$150.00,val:£150.00>
Split<d:28/10/19,acc:AR,amt:$0.00,val:-£150.00>
Transaction Currency:GBP
Client Currency:AUD
2019-10-28 23:51:27 +08:00
Christopher Lam
2e1b87e01f [report-utilities] gnc:strify add lot printer 2019-10-28 20:18:47 +08:00
Christopher Lam
644cb4100e [gncOwner] add gncOwnerGetTypeString returns owner-type
* will have several uses
2019-10-28 20:18:47 +08:00