mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Don't let users post negative invoices. (#166864)
Pop up an error dialog and prevent the post. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13304 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -53,6 +53,10 @@
|
||||
- Prefer QUERY_AND and QUERY_OR over NAND, NOR, XOR
|
||||
- Don't randomly generate a gnc_numeric with a 0 denominator.
|
||||
|
||||
* src/business/business-gnome/dialog-invoice.c:
|
||||
Don't let users post negative invoices. (#166864)
|
||||
Pop up an error dialog and prevent the post.
|
||||
|
||||
2006-02-18 Derek Atkins <derek@ihtfp.com>
|
||||
|
||||
* intl-scm/xgettext.scm: remove the absolute path from filenames
|
||||
|
||||
@@ -610,6 +610,20 @@ gnc_invoice_window_postCB (GtkWidget *widget, gpointer data)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Make sure that the invoice has a positive balance */
|
||||
if (gnc_numeric_negative_p(gncInvoiceGetTotal(invoice))) {
|
||||
gnc_error_dialog(iw_get_window(iw),
|
||||
_("You may not post an invoice with a negative total value."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (iw->total_cash_label &&
|
||||
gnc_numeric_negative_p(gncInvoiceGetTotalOf(invoice, GNC_PAYMENT_CASH))) {
|
||||
gnc_error_dialog(iw_get_window(iw),
|
||||
_("You may not post an expense voucher with a negative total cash value."));
|
||||
return;
|
||||
}
|
||||
|
||||
/* Ok, we can post this invoice. Ask for verification, set the due date,
|
||||
* post date, and posted account
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user