Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add swedish chart of accounts (K1 MINI) #10907

Closed
wants to merge 1 commit into from

Conversation

swedebugia
Copy link

Are the rowids correct?

@swedebugia
Copy link
Author

psql complains like this when I try to insert it:
ERROR: value too long for type character varying(20)
ERROR: value too long for type character varying(20)
ERROR: value too long for type character varying(20)
ERROR: value too long for type character varying(20)
ERROR: value too long for type character varying(20)
ERROR: value too long for type character varying(20)
ERROR: value too long for type character varying(20)
ERROR: value too long for type character varying(20)
ERROR: value too long for type character varying(20)
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
ERROR: value too long for type character varying(20)
ERROR: value too long for type character varying(20)
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1

So I'm guessing some of the swedish account names are longer than expected.

@swedebugia
Copy link
Author

I issued this command to find the culprit:
dolibarr=> select * from llx_accounting_account \gdesc
Column | Type
------------------------+-----------------------------
rowid | integer
entity | integer
datec | timestamp without time zone
tms | timestamp without time zone
fk_pcg_version | character varying(32)
pcg_type | character varying(20)
pcg_subtype | character varying(20)
account_number | character varying(32)
account_parent | integer
label | character varying(100)
fk_accounting_category | integer
fk_user_author | integer
fk_user_modif | integer
active | smallint
import_key | character varying(14)
extraparams | character varying(255)
(16 rows)

pcg_type | character varying(20) <-- this is too short for swedish category names it seems.

After changing this with:
dolibarr=> alter table llx_accounting_account
alter column pcg_type type varchar (50);

It imported the rest just fine :)

@eldy
Copy link
Member

eldy commented Mar 26, 2019

The field pcg_type is dedicated to store a hard coded constant among this list:
CAPIT
IMMO
STOCK
THIRDPARTY
FINAN
EXPENSE
INCOME
OTHER

Currently, some files doe not follow this. This is not important because only "EXPENSE" and "INCOME" are used for some report but to be ready for future, it would be great if you can edit your file to use this codes into your submitted file. Can you try to fix this ?

@eldy eldy added the PR to fix or conflict to solve PR needs to be fixed to be integrated (except for conflicts, a comment describes the fix to do) label Mar 26, 2019
@swedebugia
Copy link
Author

Is this okay?
llx_accounting_account_se.sql.txt

@eldy eldy closed this in d1fdd11 Dec 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR to fix or conflict to solve PR needs to be fixed to be integrated (except for conflicts, a comment describes the fix to do)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants