[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem entering new VAT rates





On Tue, Sep 25, 2012 at 5:29 AM, Jos Geluk <..hidden..> wrote:
Chris Travers schreef op 25-09-12 13:41:

> You will probably want to also:
>
> CREATE UNIQUE INDEX tax_chart_id_current_u ON tax(chart_id) WHERE
> validto IS NULL;

That gives me:
ERROR: could not create unique index "tax_chart_id_current_u"
DETAIL: Key (chart_id)=(10153) is duplicated.

Which it is. In fact the column chart_id doesn't make much sense to me:

my-database=# select * from tax;
  chart_id | rate | taxnumber |  validto   | pass | taxmodule_id
----------+------+-----------+------------+------+--------------
     10155 | 0.19 |           | 2012-09-30 |    0 |            1
     10155 | 0.21 |           |            |    0 |            1
     10157 | 0.06 |           |            |    0 |            1
     10151 | 0.19 |           | 2012-09-30 |    0 |            1
     10153 | 0.21 |           |            |    0 |            1
     10153 | 0.06 |           |            |    0 |            1
(6 rows)

There are two high rates and one low rate, which is OK, and one each for
buying and one for selling. However, the new high rate has the same
chart_id (10153) as the old low rate.

Is this how it should be? Or should it be changed manually?

No, not right.  Expire your old rate by assigning a date it is valid to.

Best Wishes ,
Chris Travers

J.

--
www.ardispark.nl
tel. 06 5341 4670

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ledger-smb-users mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-users