mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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
This commit is contained in:
parent
cf899c042c
commit
1575bb6cde
@ -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));
|
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 &&
|
if (ntt->type == GNC_AMT_TYPE_PERCENT &&
|
||||||
gnc_numeric_compare (amount,
|
gnc_numeric_compare (gnc_numeric_abs (amount),
|
||||||
gnc_numeric_create (100, 1)) > 0)
|
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);
|
gnc_error_dialog (ntt->dialog, "%s", message);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user