Fix example of number for holiday

This commit is contained in:
Laurent Destailleur 2018-11-09 11:41:27 +01:00
parent f1193ad3dd
commit 773e2da4cc
2 changed files with 6 additions and 4 deletions

View File

@ -75,8 +75,8 @@ else if ($action == 'specimen') // For contract
{ {
$modele= GETPOST('module','alpha'); $modele= GETPOST('module','alpha');
$contract = new Contrat($db); $holiday = new Holiday($db);
$contract->initAsSpecimen(); $holiday->initAsSpecimen();
// Search template files // Search template files
$file=''; $classname=''; $filefound=0; $file=''; $classname=''; $filefound=0;
@ -98,7 +98,7 @@ else if ($action == 'specimen') // For contract
$module = new $classname($db); $module = new $classname($db);
if ($module->write_file($contract,$langs) > 0) if ($module->write_file($holiday,$langs) > 0)
{ {
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=holiday&file=SPECIMEN.pdf"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=holiday&file=SPECIMEN.pdf");
return; return;
@ -271,7 +271,7 @@ foreach ($dirmodels as $reldir)
// Info // Info
$htmltooltip=''; $htmltooltip='';
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>'; $htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
$nextval=$module->getNextValue($mysoc,$contract); $nextval=$module->getNextValue($mysoc,$holiday);
if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
$htmltooltip.=''.$langs->trans("NextValue").': '; $htmltooltip.=''.$langs->trans("NextValue").': ';
if ($nextval) { if ($nextval) {

View File

@ -2171,8 +2171,10 @@ class Holiday extends CommonObject
$this->description='SPECIMEN description'; $this->description='SPECIMEN description';
$this->date_debut=dol_now(); $this->date_debut=dol_now();
$this->date_fin=dol_now()+(24*3600); $this->date_fin=dol_now()+(24*3600);
$this->date_valid=dol_now();
$this->fk_validator=1; $this->fk_validator=1;
$this->halfday=0; $this->halfday=0;
$this->fk_type=1; $this->fk_type=1;
$this->statut=Holiday::STATUS_VALIDATED;
} }
} }