From 1575bb6cde6896dce328430a5847a1bd2680f430 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Sat, 14 Aug 2010 09:29:30 +0000 Subject: [PATCH] Allow negative tax percentages. This allows to model some tax rules for trade between European countries. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19424 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/business/dialog-tax-table/dialog-tax-table.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/business/dialog-tax-table/dialog-tax-table.c b/src/business/dialog-tax-table/dialog-tax-table.c index e950a10a16..06f03da20a 100644 --- a/src/business/dialog-tax-table/dialog-tax-table.c +++ b/src/business/dialog-tax-table/dialog-tax-table.c @@ -130,19 +130,13 @@ new_tax_table_ok_cb (NewTaxTable *ntt) } } - /* verify the amount */ + /* verify the amount. Note that negative values are allowed (required for European tax rules) */ amount = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (ntt->amount_entry)); - if (gnc_numeric_negative_p (amount)) - { - message = _("Negative amounts are not allowed."); - gnc_error_dialog (ntt->dialog, "%s", message); - return FALSE; - } if (ntt->type == GNC_AMT_TYPE_PERCENT && - gnc_numeric_compare (amount, + gnc_numeric_compare (gnc_numeric_abs (amount), gnc_numeric_create (100, 1)) > 0) { - message = _("Percentage amount must be between 0 and 100."); + message = _("Percentage amount must be between -100 and 100."); gnc_error_dialog (ntt->dialog, "%s", message); return FALSE; }