Allow to select saved report on print invoice button

This change was inspired by mildred's #PR1247 and uses the new
GncReportCombo to allow selection of 'Saved Invoice reports' when the
invoice print button is used or when printing multiple invoices.

This change presents a dialog with the default for the report combo set
to the properties setting. This dialog has a timeout which is
adjustable under properties and will stop if a key is pressed or combo
popped so that a different report template can be selected and used.
There is also an 'OK' button that stops the time out and prints and a
'Cancel' button which cancels the print.
This commit is contained in:
Robert Fewell committed 2023-02-02 14:05:53 +00:00
1 parent b41e491ec5
commit 07f3f536cc
6 files changed
+328 -11

No files matched your search

+15
View File
@@ -1098,6 +1098,21 @@ qof_book_get_default_invoice_report_name (const QofBook *book)
return report_name;
}
gdouble
qof_book_get_default_invoice_report_timeout (const QofBook *book)
{
double ret = 0;
KvpFrame *root = qof_instance_get_slots (QOF_INSTANCE(book));
KvpValue *value = root->get_slot ({KVP_OPTION_PATH,
OPTION_SECTION_BUSINESS,
OPTION_NAME_DEFAULT_INVOICE_REPORT_TIMEOUT});
if (value)
ret = {value->get<double>()};
return ret;
}
/* Note: this will fail if the book slots we're looking for here are flattened at some point !
* When that happens, this function can be removed. */
static Path opt_name_to_path (const char* opt_name)