... 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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
* 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.
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.
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