Fix: Correction plus complete de la possibilité de modifier le code client avec zebre.
This commit is contained in:
parent
79f9d585d9
commit
22e458971f
@ -172,10 +172,10 @@ if ($socid > 0)
|
|||||||
|
|
||||||
if ($objsoc->client)
|
if ($objsoc->client)
|
||||||
{
|
{
|
||||||
print '<tr><td>';
|
print '<tr><td nowrap>';
|
||||||
print $langs->trans('CustomerCode').'</td><td colspan="3">';
|
print $langs->trans('CustomerCode').'</td><td colspan="3">';
|
||||||
print $objsoc->code_client;
|
print $objsoc->code_client;
|
||||||
if ($objsoc->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode");
|
if ($objsoc->check_codeclient() <> 0) print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -127,7 +127,7 @@ if ($socid > 0)
|
|||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Name").'</td><td colspan="3">'.$societe->nom.'</td></tr>';
|
print '<tr><td width="100">'.$langs->trans("Name").'</td><td colspan="3">'.$societe->nom.'</td></tr>';
|
||||||
|
|
||||||
// Prefix
|
// Prefix
|
||||||
print '<tr><td>'.$langs->trans("Prefix").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("Prefix").'</td><td colspan="3">';
|
||||||
@ -137,7 +137,7 @@ if ($socid > 0)
|
|||||||
if ($societe->client)
|
if ($societe->client)
|
||||||
{
|
{
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td nowrap width="100">'.$langs->trans("CustomerCode"). '</td><td colspan="3">'. $societe->code_client . '</td>';
|
print '<td nowrap>'.$langs->trans("CustomerCode"). '</td><td colspan="3">'. $societe->code_client . '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td nowrap>'.$langs->trans("CustomerAccountancyCode").'</td><td colspan="3">'.$societe->code_compta.'</td>';
|
print '<td nowrap>'.$langs->trans("CustomerAccountancyCode").'</td><td colspan="3">'.$societe->code_compta.'</td>';
|
||||||
|
|||||||
@ -18,7 +18,6 @@
|
|||||||
* or see http://www.gnu.org/
|
* or see http://www.gnu.org/
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
* $Source$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -18,7 +18,6 @@
|
|||||||
* or see http://www.gnu.org/
|
* or see http://www.gnu.org/
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
* $Source$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -19,7 +19,6 @@
|
|||||||
* or see http://www.gnu.org/
|
* or see http://www.gnu.org/
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
* $Source$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -18,7 +18,6 @@
|
|||||||
* or see http://www.gnu.org/
|
* or see http://www.gnu.org/
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
* $Source$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -38,10 +37,10 @@ require_once(DOL_DOCUMENT_ROOT."/includes/modules/societe/modules_societe.class.
|
|||||||
class mod_codeclient_zebre extends ModeleThirdPartyCode
|
class mod_codeclient_zebre extends ModeleThirdPartyCode
|
||||||
{
|
{
|
||||||
var $nom; // Nom du modele
|
var $nom; // Nom du modele
|
||||||
var $code_modifiable; // Code modifiable
|
var $code_modifiable; // Can be changed if valid
|
||||||
var $code_modifiable_invalide; // Code modifiable si il est invalide
|
var $code_modifiable_invalide; // Can be changed if not valid
|
||||||
var $code_modifiable_null; // Code modifiables si il est null
|
var $code_modifiable_null; // Can be changed if not defined
|
||||||
var $code_null; // Code facultatif
|
var $code_null; // Can be undefined
|
||||||
var $version; // 'development', 'experimental', 'dolibarr'
|
var $version; // 'development', 'experimental', 'dolibarr'
|
||||||
var $code_auto; // Numérotation automatique
|
var $code_auto; // Numérotation automatique
|
||||||
|
|
||||||
@ -52,10 +51,10 @@ class mod_codeclient_zebre extends ModeleThirdPartyCode
|
|||||||
{
|
{
|
||||||
$this->nom = "Zèbre";
|
$this->nom = "Zèbre";
|
||||||
$this->version = "dolibarr";
|
$this->version = "dolibarr";
|
||||||
$this->code_modifiable = 0;
|
$this->code_modifiable = 0; // Can be changed if valid
|
||||||
$this->code_modifiable_invalide = 0;
|
$this->code_modifiable_invalide = 1; // Can be changed if not valid
|
||||||
$this->code_modifiable_null = 1;
|
$this->code_modifiable_null = 1; // Can be changed if not defined
|
||||||
$this->code_null = 0;
|
$this->code_null = 0; // Can be undefined
|
||||||
$this->code_auto = 0;
|
$this->code_auto = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,6 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
* $Source$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -673,7 +672,7 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
|
|||||||
print '<td width="25%">'.$langs->trans('CustomerCode').'</td><td width="25%">';
|
print '<td width="25%">'.$langs->trans('CustomerCode').'</td><td width="25%">';
|
||||||
|
|
||||||
print '<table class="nobordernopadding"><tr><td>';
|
print '<table class="nobordernopadding"><tr><td>';
|
||||||
if ($soc->codeclient_modifiable() || !$soc->code_client)
|
if ($soc->codeclient_modifiable())
|
||||||
{
|
{
|
||||||
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">';
|
||||||
}
|
}
|
||||||
@ -700,7 +699,7 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
|
|||||||
print '<td>'.$langs->trans('SupplierCode').'</td><td>';
|
print '<td>'.$langs->trans('SupplierCode').'</td><td>';
|
||||||
|
|
||||||
print '<table class="nobordernopadding"><tr><td>';
|
print '<table class="nobordernopadding"><tr><td>';
|
||||||
if ($soc->codefournisseur_modifiable() || !$soc->code_fournisseur)
|
if ($soc->codefournisseur_modifiable())
|
||||||
{
|
{
|
||||||
print '<input type="text" name="code_fournisseur" size="16" value="'.$soc->code_fournisseur.'" maxlength="15">';
|
print '<input type="text" name="code_fournisseur" size="16" value="'.$soc->code_fournisseur.'" maxlength="15">';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1418,7 +1418,8 @@ class Societe
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Verifie si un code client est modifiable dans configuration du module de controle des codes
|
* \brief Verifie si un code client est modifiable en fonction des parametres
|
||||||
|
* du module de controle des codes.
|
||||||
* \return int 0=Non, 1=Oui
|
* \return int 0=Non, 1=Oui
|
||||||
*/
|
*/
|
||||||
function codeclient_modifiable()
|
function codeclient_modifiable()
|
||||||
@ -1433,7 +1434,7 @@ class Societe
|
|||||||
$mod = new $var;
|
$mod = new $var;
|
||||||
|
|
||||||
dolibarr_syslog("Societe::codeclient_modifiable code_client=".$this->code_client." module=".$var);
|
dolibarr_syslog("Societe::codeclient_modifiable code_client=".$this->code_client." module=".$var);
|
||||||
if ($mod->code_modifiable_null && ! $this->code_fournisseur) return 1;
|
if ($mod->code_modifiable_null && ! $this->code_client) return 1;
|
||||||
if ($mod->code_modifiable_invalide && $this->check_codeclient() < 0) return 1;
|
if ($mod->code_modifiable_invalide && $this->check_codeclient() < 0) return 1;
|
||||||
if ($mod->code_modifiable) return 1; // A mettre en dernier
|
if ($mod->code_modifiable) return 1; // A mettre en dernier
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user