Default Prospect is an individual?

Is there any way to change Dolibarr so that new Prospects are by default individuals and not companies?

Rgds
Petras

Is this so difficult that it takes more than a month to find the answer?

Rgds
Petras

Is there no developer that can tell me how to do this?

Frustrated
Petras

No way in 3.2. But it will be possible in 3.3 (beginning of 2013)

It is possible in 3.2

however it takes access to PHPmyadmin

here’s how…

Log into phpmyadmin

go to YOURPREFIX_c_typent (commonly llx_c_typent)

click browse… Here you will see the full list of prospect types

by default UNKNOWN has a ID of 0

change the ID of unknown to another number like 10 and then change the ID of TE_PRIVATE to 0

now by default the prospect type is automatically set to Private Individual

as always be SAFE!!! make sure to backup your database completely prior to making any changes!!!

Also… Being that Dolibarr generally uses ID rather than label for item properties, by changing the ID of TE_PRIVATE may effect existing prospects you have set as private individuals

I’ll do a test tonight and see what happens

Let me know if this helps

Ok… I can confirm that by changing the ID it does blank out the Prospect type in existing prospects. (only the ones where you changed the ID)

However because it is now set as the default all you have to do is hit modify then save and it fixes the existing prospect…

Its a pain if you have hundreds of prospects

I understand that the procedure you describe will update existing Prospects/Customers.

However, I was looking for a method to create NEW Prospects/Customers as individuals and not companies by default.

I expected a developer to point me to the appropriate PHP script and the lines that need changing.

It looks like I will have to wait for version 3.3 :frowning:

Thanks for the reply
Petras

Right…

When in the add new Prospect window you want the default listing to be “Private Individual” correct?

In the drop down under “Third Party Type” right?

like in the attached image?

Screenshot_from_2012_11_22_164542.png

The procedure I described changes the default listing in the new prospect window… There is no PHP code to edit as the PHP code only calls the database… The database is what determines what Prospect types exist and in what order… By changing the ID of “Unknown” from “0” to something else and updating the ID of “Private Individual” to “0” it sets “Private Individual” as the default for all new prospects…

Like I said it does have it drawbacks… When you change the ID of any list item the existing prospects loose their type field…

Basically Dolibarr is calling ID 8 and ID 8 no longer exists… Its now 0… so to correct you have to open each existing prospect hit modify then save…

You could (and it seems what will be available in 2013) create a php code that allows you to change the default order within Dolibarr but it ends up doing the exact same thing I described… Just an easier way to do it

Ok… Now I think I know what your talking about…

On the top of the Prospect window you want the radio button by default to select

“Private individual (Will create automatically a physical contact with same informations)”

Sorry for the confusion…

I will work on this tonight and let you know what code you have to edit to change the default radio button

Ok… so I started working on this last night…

Its a little tricky, The file that needs to be edited in soc.php

Its easy enough getting the default radio button checked by below that when Private individual is selected as default some of the fields remain the same as company until you click private individual again

Its weird

Got It!!!

Well a workaround anyways…

try this…

replace your url for a test to this

http://www.YOURWEBSITE/societe/soc.php?leftmenu=prospects&action=create&private=1

by changing “create&type=c” (Or whatever it is) to “create&private=1”

Tells the system that its a Private individual and the proper form is displayed…

Now to just edit the left menu with the correct url and its all finished

ok so here it is…

edit

htdocs/core/menus/standard/eldy.lib.php

Change line 757 from

$newmenu->add("/societe/soc.php?leftmenu=prospects&action=create&type=p", $langs->trans(“MenuNewProspect”), 2, $user->rights->societe->creer);

to

$newmenu->add("/societe/soc.php?leftmenu=prospects&action=create&private=1", $langs->trans(“MenuNewProspect”), 2, $user->rights->societe->creer);

Thats It!!

Now your default landing page when you click new prospect will be
Private Individual

Good Luck!

Here’s a temporary fix in soc.php (See attached)

Rgds
Petras

Petra’s

That fix in soc.php doesn’t work… It only changes the radio icon

Notice in your screen shot how the name field still says “Third Party Name”

This is because although you have changed what the default radio icon is for that page is it still loads the form for Company instead of Private individual…

figuring this out via soc.php was where I started and once I noticed that even though it appears to be on Private Individual it is sadly however misleading

the only way to change the default form is to edit eldy.php by telling the menu to use private=1

try this…

with how you have it set…
Click on your left menu new prospect…
Notice Third Party name on the top field…
Now click on the private individual radio icon again
As you’ll see the form changes

now try this…

replace this in your url
societe/soc.php?leftmenu=prospects&action=create&private=1

or simply delete type=p at the end of your url and replace with private=1

Cheers

you could try this in soc.php though…

Change GETPOST(“Type”)==“P”

to

GETPOST(“private”)==“1”

this may tell Dolibarr that the default form is private individual vs company

As we require all of the name of new prospects to be entered in the “name” field e.g. “SMITH, Mr Peter”, the fix suits us fine.

The “extra” fields for an individual would only confuse our users.

Thanks for the effort.
Petras

Petra’s

My only concern is that with they way you currently have it setup in soc.php, to your users it only appears to be using the Private Individual form however even though upon entering that page via the “New Prospect” on the left menu your still filling in the Company/Foundation form not the private individual

The entire point of using the private individual form is that Dolibarr auto generates a user upon completion…

When using the company form no user is generated when completed

obviously its entirely up to you how you have it setup but under your current methods your users are still filling out the Company/Foundation form

Either way I’m glad you were able to work things out

Since it appears which form is filled in by your customers doesn’t matter wouldn’t it be better to simply change the name of the Company/Foundation form to something that makes more sense to your clients?

Thanks for your concern. Imagine how long it took me to explain that “Dolibarr” is a CRM system.

As for the “company” form - it suits us exactly because we do not want to generate a “user” for each new Prospect.

Using this quick fix eliminates the automatic generation of a “Contact” with identical information.

Thanks again
Petras