On Wed, Nov 30, 2011 at 2:12 AM, herman vierendeels
<[email protected]> wrote:
> Hello,
>
>
> Can anyone figure out what subroutine  update  in  bin/am.pl is meant to do?
> This subroutine is triggered by button update in form generated from
> template  UI/am-taxes.html.
>
> After clicking the button different times, depending on the initial
> number of tax-accounts displayed,
> you get a form where each initial line is followed by an empty line.
>
> When clicking Save button, one gets:
>
> ERROR: duplicate key value violates unique constraint "tax_pkey"
> DETAIL: Key (chart_id, validto)=(53, infinity) already exists.
> CONTEXT: SQL statement "INSERT INTO tax(chart_id, validto, rate,
> taxnumber, pass, taxmodule_id)
> VALUES (in_chart_id, in_validto, in_rate, in_taxnumber, in_pass,
> in_taxmodule_id)"
> PL/pgSQL function "account__save_tax" line 14 at SQL statement
>
> So, after the actual commit-freeze is lifted, i would disable that
> button, so that ons does not get frustrated by these errors.

Please don't disable the button.  This is necessary to allow tax rates
to be expired.

A better approach might be to change "save" to ignore lines where the
rate is not entered at all.  Note 0 is still a valid rate as it
indicates that the tax no longer applies.

Or handle the error better.

Longer explanation:

Tax rates sometimes change.  So we allow tax rates to expire, and
after that new tax rates occur.  Update allows us to add new data
entry lines. The problem occurs when we don't expire the previous
lines first.  However this workflow itself is flawed because you
likely only want to change one tax rate, not all tax rates.

Best Wishes,
Chris Travers

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Ledger-smb-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel

Reply via email to