clean code (#29800)
* clean code * clean code * clean code * clean code * clean code * clean code * Update adherent.class.php --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
parent
d0b183f12a
commit
bae0c17811
5 changed files with 10 additions and 8 deletions
|
|
@ -2362,6 +2362,7 @@ class Adherent extends CommonObject
|
|||
$linkend = '</a>';
|
||||
|
||||
$result .= $linkstart;
|
||||
|
||||
if ($withpictoimg) {
|
||||
$paddafterimage = '';
|
||||
if (abs($withpictoimg) == 1 || abs($withpictoimg) == 4) {
|
||||
|
|
@ -2394,6 +2395,7 @@ class Adherent extends CommonObject
|
|||
$result .= '</span>';
|
||||
}
|
||||
}
|
||||
|
||||
$result .= $linkend;
|
||||
|
||||
if ($addlinktonotes) {
|
||||
|
|
|
|||
|
|
@ -1636,7 +1636,7 @@ class Facture extends CommonInvoice
|
|||
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
|
||||
if ($date > (dol_get_last_hour(dol_now('tzuserrel')) + (!getDolGlobalString('INVOICE_MAX_FUTURE_DELAY') ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) {
|
||||
if ($date > (dol_get_last_hour(dol_now('tzuserrel')) + getDolGlobalInt('INVOICE_MAX_FUTURE_DELAY'))) {
|
||||
$origin->error = 'ErrorDateIsInFuture';
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ if (empty($reshook)) {
|
|||
$result = $object->setPaymentMethods(GETPOSTINT('mode_reglement_id'));
|
||||
} elseif ($action == 'setdatef' && $usercancreate) {
|
||||
$newdate = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear'), 'tzserver');
|
||||
if ($newdate > (dol_now('tzuserrel') + (!getDolGlobalString('INVOICE_MAX_FUTURE_DELAY') ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) {
|
||||
if ($newdate > (dol_now('tzuserrel') + getDolGlobalInt('INVOICE_MAX_FUTURE_DELAY'))) {
|
||||
if (!getDolGlobalString('INVOICE_MAX_FUTURE_DELAY')) {
|
||||
setEventMessages($langs->trans("WarningInvoiceDateInFuture"), null, 'warnings');
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -477,7 +477,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
} elseif ($action == 'setdatef' && $usercancreate) {
|
||||
$newdate = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear'), 'tzserver');
|
||||
if ($newdate > (dol_now('tzuserrel') + (!getDolGlobalString('INVOICE_MAX_FUTURE_DELAY') ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) {
|
||||
if ($newdate > (dol_now('tzuserrel') + getDolGlobalInt('INVOICE_MAX_FUTURE_DELAY'))) {
|
||||
if (!getDolGlobalString('INVOICE_MAX_FUTURE_DELAY')) {
|
||||
setEventMessages($langs->trans("WarningInvoiceDateInFuture"), null, 'warnings');
|
||||
} else {
|
||||
|
|
@ -803,7 +803,7 @@ if (empty($reshook)) {
|
|||
$action = 'create';
|
||||
//$_GET['socid'] = $_POST['socid'];
|
||||
$error++;
|
||||
} elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + (!getDolGlobalString('INVOICE_MAX_FUTURE_DELAY') ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) {
|
||||
} elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + getDolGlobalInt('INVOICE_MAX_FUTURE_DELAY'))) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorDateIsInFuture"), null, 'errors');
|
||||
$action = 'create';
|
||||
|
|
@ -869,7 +869,7 @@ if (empty($reshook)) {
|
|||
$action = 'create';
|
||||
//$_GET['socid'] = $_POST['socid'];
|
||||
$error++;
|
||||
} elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + (!getDolGlobalString('INVOICE_MAX_FUTURE_DELAY') ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) {
|
||||
} elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + getDolGlobalInt('INVOICE_MAX_FUTURE_DELAY'))) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorDateIsInFuture"), null, 'errors');
|
||||
$action = 'create';
|
||||
|
|
@ -981,7 +981,7 @@ if (empty($reshook)) {
|
|||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
|
||||
$action = 'create';
|
||||
} elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + (!getDolGlobalString('INVOICE_MAX_FUTURE_DELAY') ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) {
|
||||
} elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + getDolGlobalInt('INVOICE_MAX_FUTURE_DELAY'))) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorDateIsInFuture"), null, 'errors');
|
||||
$action = 'create';
|
||||
|
|
@ -1037,7 +1037,7 @@ if (empty($reshook)) {
|
|||
$action = 'create';
|
||||
//$_GET['socid'] = $_POST['socid'];
|
||||
$error++;
|
||||
} elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + (!getDolGlobalString('INVOICE_MAX_FUTURE_DELAY') ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) {
|
||||
} elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + getDolGlobalInt('INVOICE_MAX_FUTURE_DELAY'))) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorDateIsInFuture"), null, 'errors');
|
||||
$action = 'create';
|
||||
|
|
|
|||
|
|
@ -872,7 +872,7 @@ class Mos extends DolibarrApi
|
|||
// Update status of MO
|
||||
dol_syslog("consumptioncomplete = " . (string) $consumptioncomplete . " productioncomplete = " . (string) $productioncomplete);
|
||||
//var_dump("consumptioncomplete = ".$consumptioncomplete." productioncomplete = ".$productioncomplete);
|
||||
if ($consumptioncomplete && $productioncomplete) {
|
||||
if ($consumptioncomplete && $productioncomplete) {
|
||||
$result = $this->mo->setStatut(Mo::STATUS_PRODUCED, 0, '', 'MRP_MO_PRODUCED');
|
||||
} else {
|
||||
$result = $this->mo->setStatut(Mo::STATUS_INPROGRESS, 0, '', 'MRP_MO_PRODUCED');
|
||||
|
|
|
|||
Loading…
Reference in a new issue