mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 00:52:01 +01:00
New: Customer and supplier codes can be automatically generated
This commit is contained in:
@@ -40,7 +40,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes
|
||||
var $error = '';
|
||||
var $nom = 'Saphir';
|
||||
|
||||
|
||||
|
||||
/** \brief Renvoi la description du modele de num<75>rotation
|
||||
* \return string Texte descripif
|
||||
*/
|
||||
@@ -49,23 +49,29 @@ class mod_commande_saphir extends ModeleNumRefCommandes
|
||||
global $conf,$langs;
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
|
||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
$texte.= '<input type="hidden" name="action" value="updateMask">';
|
||||
$texte.= '<input type="hidden" name="maskconstorder" value="COMMANDE_SAPHIR_MASK">';
|
||||
$texte.= '<table class="nobordernopadding" width="100%">';
|
||||
|
||||
// Parametrage du prefix des factures
|
||||
|
||||
$tooltip=$langs->trans("GenericMaskCodes",$langs->transnoentities("Order"));
|
||||
$tooltip.=$langs->trans("GenericMaskCodes2");
|
||||
$tooltip.=$langs->trans("GenericMaskCodes3");
|
||||
$tooltip.=$langs->trans("GenericMaskCodes4a",$langs->transnoentities("Order"),$langs->transnoentities("Order"));
|
||||
$tooltip.=$langs->trans("GenericMaskCodes5");
|
||||
|
||||
// Parametrage du prefix
|
||||
$texte.= '<tr><td>'.$langs->trans("Mask").':</td>';
|
||||
$texte.= '<td align="right">'.$form->textwithhelp('<input type="text" class="flat" size="24" name="maskorder" value="'.$conf->global->COMMANDE_SAPHIR_MASK.'">',$langs->trans("GenericMaskCodes",$langs->transnoentities("Order"),$langs->transnoentities("Order"),$langs->transnoentities("Order")),1,1).'</td>';
|
||||
$texte.= '<td align="right">'.$form->textwithhelp('<input type="text" class="flat" size="24" name="maskorder" value="'.$conf->global->COMMANDE_SAPHIR_MASK.'">',$tooltip,1,1).'</td>';
|
||||
|
||||
$texte.= '<td align="left" rowspan="2"> <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>';
|
||||
|
||||
$texte.= '</tr>';
|
||||
|
||||
|
||||
$texte.= '</table>';
|
||||
$texte.= '</form>';
|
||||
|
||||
@@ -78,12 +84,12 @@ class mod_commande_saphir extends ModeleNumRefCommandes
|
||||
function getExample()
|
||||
{
|
||||
global $conf,$langs,$mysoc;
|
||||
|
||||
|
||||
$old_code_client=$mysoc->code_client;
|
||||
$mysoc->code_client='CCCCCCCCCC';
|
||||
$numExample = $this->getNextValue($mysoc,'');
|
||||
$mysoc->code_client=$old_code_client;
|
||||
|
||||
|
||||
if (! $numExample)
|
||||
{
|
||||
$numExample = $langs->trans('NotConfigured');
|
||||
@@ -101,22 +107,22 @@ class mod_commande_saphir extends ModeleNumRefCommandes
|
||||
global $db,$conf;
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT ."/lib/functions2.lib.php");
|
||||
|
||||
|
||||
// We get cursor rule
|
||||
$mask=$conf->global->COMMANDE_SAPHIR_MASK;
|
||||
|
||||
if (! $mask)
|
||||
|
||||
if (! $mask)
|
||||
{
|
||||
$this->error='NotConfigured';
|
||||
return 0;
|
||||
}
|
||||
|
||||
$numFinal=get_next_value($db,$mask,'commande','ref','',$objsoc->code_client,$commande->date);
|
||||
|
||||
|
||||
return $numFinal;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/** \brief Return next free value
|
||||
* \param objsoc Object third party
|
||||
* \param objforref Object for number to search
|
||||
@@ -126,7 +132,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes
|
||||
{
|
||||
return $this->getNextValue($objsoc,$objforref);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user