Fix: La mise a jour du code fournisseur etait sauvé dans le code client
This commit is contained in:
parent
fb3c25139e
commit
0cdee454cf
@ -207,23 +207,40 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
|
|||||||
|
|
||||||
if ($step==1 && defined("COMPANY_CREATE_TWO_STEPS"))
|
if ($step==1 && defined("COMPANY_CREATE_TWO_STEPS"))
|
||||||
{
|
{
|
||||||
print '<tr><td width="140">'.$langs->trans('Country').'</td><td colspan="3">';
|
print '<tr><td width="25%">'.$langs->trans('Country').'</td><td colspan="3">';
|
||||||
$form->select_pays($soc->pays_id);
|
$form->select_pays($soc->pays_id);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<input type="hidden" name="step" value="'.$step.'">';
|
print '<input type="hidden" name="step" value="'.$step.'">';
|
||||||
print '<input type="hidden" name="action" value="create">';
|
print '<input type="hidden" name="action" value="create">';
|
||||||
print '<tr><td colspan="4" align="center"><input type="submit" name="createnextstep" value="'.$langs->trans('NextStep').'"></td></tr>'."\n";
|
print '<tr><td colspan="4" align="center"><input type="submit" class="button" name="createnextstep" value="'.$langs->trans('NextStep').'"></td></tr>'."\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
if ($step==2 || ! defined("COMPANY_CREATE_TWO_STEPS")) {
|
if ($step==2 || ! defined("COMPANY_CREATE_TWO_STEPS")) {
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans('CustomerCode').'</td><td colspan="3"><input size="16" type="text" name="code_client" maxlength="15" value="'.$soc->code_client.'"></td>';
|
// Client / Prospect
|
||||||
print '<tr><td>'.$langs->trans('SupplierCode').'</td><td colspan="3"><input size="16" type="text" name="code_fournisseur" maxlength="15" value="'.$soc->code_fournisseur.'"></td>';
|
print '<tr><td width="25%">'.$langs->trans('ProspectCustomer').'</td><td width="25%"><select class="flat" name="client">';
|
||||||
|
print '<option value="2"'.($soc->client==2?' selected':'').'>'.$langs->trans('Prospect').'</option>';
|
||||||
|
print '<option value="1"'.($soc->client==1?' selected':'').'>'.$langs->trans('Customer').'</option>';
|
||||||
|
print '<option value="0"'.($soc->client==0?' selected':'').'>Ni client, ni prospect</option>';
|
||||||
|
print '</select></td>';
|
||||||
|
print '<td width="25%">'.$langs->trans('CustomerCode').'</td><td width="25%">';
|
||||||
|
print '<input type="text" name="code_client" size="16" value="'.$soc->code_client.'" maxlength="15">';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Fournisseur
|
||||||
|
print '<tr>';
|
||||||
|
print '<td>'.$langs->trans('Supplier').'</td><td>';
|
||||||
|
$form->selectyesnonum("fournisseur",$soc->fournisseur);
|
||||||
|
print '</td>';
|
||||||
|
print '<td>'.$langs->trans('SupplierCode').'</td><td>';
|
||||||
|
print '<input type="text" name="code_fournisseur" size="16" value="'.$soc->code_fournisseur.'" maxlength="15">';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|
||||||
if (defined("COMPANY_CREATE_TWO_STEPS"))
|
if (defined("COMPANY_CREATE_TWO_STEPS"))
|
||||||
{
|
{
|
||||||
print '<tr><td width="140">'.$langs->trans('Country').'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">';
|
||||||
print $soc->pays;
|
print $soc->pays;
|
||||||
print '<input type="hidden" name="pays_id" value="'.$soc->pays_id.'">';
|
print '<input type="hidden" name="pays_id" value="'.$soc->pays_id.'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -282,22 +299,12 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
|
|||||||
print ' '.$langs->trans("VATIntraCheckableOnEUSite");
|
print ' '.$langs->trans("VATIntraCheckableOnEUSite");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans('ProspectCustomer').'</td><td><select class="flat" name="client">';
|
|
||||||
print '<option value="2"'.($soc->client==2?' selected':'').'>'.$langs->trans('Prospect').'</option>';
|
|
||||||
print '<option value="1"'.($soc->client==1?' selected':'').'>'.$langs->trans('Customer').'</option>';
|
|
||||||
print '<option value="0"'.($soc->client==0?' selected':'').'>'.$langs->trans('NorProspectNorCustomer').'</option>';
|
|
||||||
print '</select></td>'."\n";
|
|
||||||
|
|
||||||
print '<td>'.$langs->trans('Supplier').'</td><td>'."\n";
|
|
||||||
$form->selectyesnonum("fournisseur",$soc->fournisseur);
|
|
||||||
print '</td></tr>'."\n";
|
|
||||||
|
|
||||||
print '<tr><td colspan="4" align="center">';
|
print '<tr><td colspan="4" align="center">';
|
||||||
if (defined("COMPANY_CREATE_TWO_STEPS"))
|
if (defined("COMPANY_CREATE_TWO_STEPS"))
|
||||||
{
|
{
|
||||||
print '<input type="submit" name="createpreviousstep" value="'.$langs->trans('PreviousStep').'"> ';
|
print '<input type="submit" class="button" name="createpreviousstep" value="'.$langs->trans('PreviousStep').'"> ';
|
||||||
}
|
}
|
||||||
print '<input type="submit" value="'.$langs->trans('AddCompany').'"></td></tr>'."\n";
|
print '<input type="submit" class="button" value="'.$langs->trans('AddCompany').'"></td></tr>'."\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -337,13 +344,19 @@ elseif ($_GET["action"] == 'edit')
|
|||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
print '<tr><td width="140">'.$langs->trans('Name').'</td><td colspan="3"><input type="text" size="40" name="nom" value="'.$soc->nom.'"></td></tr>';
|
print '<tr><td>'.$langs->trans('Name').'</td><td colspan="3"><input type="text" size="40" name="nom" value="'.$soc->nom.'"></td></tr>';
|
||||||
|
|
||||||
print '<td>'.$langs->trans("Prefix").'</td><td colspan="3">';
|
print '<td>'.$langs->trans("Prefix").'</td><td colspan="3">';
|
||||||
print '<input type="text" size="5" name="prefix_comm" value="'.$soc->prefix_comm.'">';
|
print '<input type="text" size="5" name="prefix_comm" value="'.$soc->prefix_comm.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans('CustomerCode').'</td><td colspan="3">';
|
// Client / Prospect
|
||||||
|
print '<tr><td width="25%">'.$langs->trans('ProspectCustomer').'</td><td width="25%"><select class="flat" name="client">';
|
||||||
|
print '<option value="2"'.($soc->client==2?' selected':'').'>'.$langs->trans('Prospect').'</option>';
|
||||||
|
print '<option value="1"'.($soc->client==1?' selected':'').'>'.$langs->trans('Customer').'</option>';
|
||||||
|
print '<option value="0"'.($soc->client==0?' selected':'').'>Ni client, ni prospect</option>';
|
||||||
|
print '</select></td>';
|
||||||
|
print '<td width="25%">'.$langs->trans('CustomerCode').'</td><td width="25%">';
|
||||||
if ($soc->codeclient_modifiable == 1)
|
if ($soc->codeclient_modifiable == 1)
|
||||||
{
|
{
|
||||||
print '<input type="text" name="code_client" size="16" value="'.$soc->code_client.'" maxlength="15">';
|
print '<input type="text" name="code_client" size="16" value="'.$soc->code_client.'" maxlength="15">';
|
||||||
@ -352,18 +365,23 @@ elseif ($_GET["action"] == 'edit')
|
|||||||
{
|
{
|
||||||
print $soc->code_client;
|
print $soc->code_client;
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans('SupplierCode').'</td><td colspan="3">';
|
// Fournisseur
|
||||||
|
print '<tr>';
|
||||||
|
print '<td>'.$langs->trans('Supplier').'</td><td>';
|
||||||
|
$form->selectyesnonum("fournisseur",$soc->fournisseur);
|
||||||
|
print '</td>';
|
||||||
|
print '<td>'.$langs->trans('SupplierCode').'</td><td>';
|
||||||
if ($soc->codefournisseur_modifiable == 1)
|
if ($soc->codefournisseur_modifiable == 1)
|
||||||
{
|
{
|
||||||
print '<input type="text" name="code_client" size="16" value="'.$soc->code_fournisseur.'" maxlength="15">';
|
print '<input type="text" name="code_fournisseur" size="16" value="'.$soc->code_fournisseur.'" maxlength="15">';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $soc->code_fournisseur;
|
print $soc->code_fournisseur;
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans('Address').'</td><td colspan="3"><textarea name="adresse" cols="40" rows="3" wrap="soft">';
|
print '<tr><td valign="top">'.$langs->trans('Address').'</td><td colspan="3"><textarea name="adresse" cols="40" rows="3" wrap="soft">';
|
||||||
print $soc->adresse;
|
print $soc->adresse;
|
||||||
@ -408,16 +426,6 @@ elseif ($_GET["action"] == 'edit')
|
|||||||
$form->select_array("effectif_id",$soc->effectif_array(), $soc->effectif_id);
|
$form->select_array("effectif_id",$soc->effectif_array(), $soc->effectif_id);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans('ProspectCustomer').'</td><td><select class="flat" name="client">';
|
|
||||||
print '<option value="2"'.($soc->client==2?' selected':'').'>'.$langs->trans('Prospect').'</option>';
|
|
||||||
print '<option value="1"'.($soc->client==1?' selected':'').'>'.$langs->trans('Customer').'</option>';
|
|
||||||
print '<option value="0"'.($soc->client==0?' selected':'').'>Ni client, ni prospect</option>';
|
|
||||||
print '</select></td>';
|
|
||||||
|
|
||||||
print '<td>'.$langs->trans('Supplier').'</td><td>';
|
|
||||||
$form->selectyesnonum("fournisseur",$soc->fournisseur);
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
print '<tr><td align="center" colspan="4"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>';
|
print '<tr><td align="center" colspan="4"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -426,6 +434,10 @@ elseif ($_GET["action"] == 'edit')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* Fiche société en mode visu
|
||||||
|
*/
|
||||||
|
|
||||||
if ($no_reload <> 1)
|
if ($no_reload <> 1)
|
||||||
{
|
{
|
||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
@ -481,9 +493,6 @@ else
|
|||||||
|
|
||||||
dolibarr_fiche_head($head, 0, $soc->nom);
|
dolibarr_fiche_head($head, 0, $soc->nom);
|
||||||
|
|
||||||
/*
|
|
||||||
* Fiche société en mode visu
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Confirmation de la suppression de la facture
|
// Confirmation de la suppression de la facture
|
||||||
if ($_GET["action"] == 'delete')
|
if ($_GET["action"] == 'delete')
|
||||||
@ -525,8 +534,8 @@ else
|
|||||||
|
|
||||||
print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."</td></tr>";
|
print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."</td></tr>";
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans('Zip').'</td><td>'.$soc->cp."</td>";
|
print '<tr><td width="25%">'.$langs->trans('Zip').'</td><td width="25%">'.$soc->cp."</td>";
|
||||||
print '<td>'.$langs->trans('Town').'</td><td>'.$soc->ville."</td></tr>";
|
print '<td width="25%">'.$langs->trans('Town').'</td><td width="25%">'.$soc->ville."</td></tr>";
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'.$soc->pays.'</td>';
|
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'.$soc->pays.'</td>';
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user