Duplicate entry '1' for key 'uk_facture_fourn_ref'

Hello,

I’m using Dolibarr 3.4.0.
I’m trying to input a new supplier invoice and when I click on the “Validate” button, I get the error message “Duplicate entry ‘1’ for key ‘uk_facture_fourn_ref’”.
I am therefore unable to validate the supplier invoice.

Anyone has any idea what could be wrong?

Thank you.

I am getting this on all supplier invoices that I’m trying to create.

Please help.

Thank you.

Hello,

Anyone can help please?

Thanks

Same problem here,

after update dolibarr to 3.4 same error when trying to validate supplier invoices, theres no info related in the forum but must be a bug in this stable version.

Is urgent please !!

Someone could help us?

Now I know where is the error, but don´t know the solution, just a patch.

3 Days ago I create , related to a bug in the suppliers invoice counter, as it has been changed in 3.4.0 with out prior notice and new suppliers invoices, after upgrade, where validated using a new counter, breaking my prior order or ID number…

When tried to modify manually the supplier invoice counter, as mentiones in , Dolibarr said the changes were saved, but data where not saved, for example {yyyy}-0000, and are not showed, not persistent as seen in the image, (red square). In other counters at Dolibarr that works great, propal and others.

After that, when trying to validate the supplier invoice, get the error of this post “Duplicate entry ‘1’ for key ‘uk_facture_fourn_ref’”, don´t know why, hope Eldy or someone with knowledge of dolibarr could give a solution for this problem soon, but this could help you netsyspro, now i can validate suppliers invoices, letting the default new counter for this documents activated,b as said, it totally breaks the prior order of my suppliers invoices, but it works.

Regards

Call page
/install/repair.php
then try again.

If it fails, i hope 3.4.1 will solve this (soon available).

I found the solution on the French version of the forum at http://www.dolibarr.fr/forum/8-mise-a-jour/43901-numerotation-facture-fournisseur

If you don’t understand French or are unable to translate it cia Google Translate, please let me know: I’ll try to translate for you.

Thanks.

Hi netsyspro,

i tried to modify that lines of code explained by atm-maxim in github:

After that everithing still going wrong, no solution for me.

Could you please explain what is the solution to make the counter work again like it does before, it will help me a lot.

Thank you Eldy, but don´t know what will do /install/repair.php, tried to find some information about it but found nothing, will try the solution from netsyspro first when could be translates or aclarated, but thank you for your great help.

Thanks

Hi planpc,

What’s the last right supplier invoice counter?

Hello ndrosis,

sorry but I don´t understand your question, could you be more especific please?

Regards

Last Ref. for invoice supplier

Untitled-20130924.jpg

I think this should be fixed with 3.4.1 that should be released very soon

Bonjour,

J’avais le même bug sur la 4.0.3 après avoir chercher dans la table llx_facture_fourn j’ai trouvé qu’une facture a le champs ref vide, j’ai y copier la valeur du champs rowid et ça marche !

218labs.ma

Hello all,

6 years after the original post in this thread, I am getting the same error message with version 10.0.3.
This time, I am trying to validate a supplier credit note & using the canelle template.

Anyone has any idea?

Thank you

Hi,

I’m running Version 10.0.2 and just tried to create a second credit note for an invoice and got the same error message. I will try to find the cause of this issue and let you know how far I get with it.

BR
Phillip

The value for the ref column of the table llx_facture_fourn doesn’t get set correctly.
I’m not sure how to fix this but the new document number is empty.
The first credit note works but once a second one should be created the UNIQUE Index will fail.

Pretty easy once you know where to look at.
The numbering mask for supplier credit notes was not set.
I guess the mask for credit notes was inserted in one of the updates and I never noticed that I have to set this mask, because I never created a supplier credit note.

1 Like