Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
156479cda3
@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
if (!empty($conf->categorie->enabled)) {
|
||||
if (isModEnabled('categorie')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ if (!empty($conf->categorie->enabled)) {
|
||||
$langs->loadLangs(array("companies", "compta", "accountancy", "products"));
|
||||
|
||||
// Security check
|
||||
if (empty($conf->accounting->enabled)) {
|
||||
if (!isModEnabled('accounting')) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->bind->write)) {
|
||||
@ -522,7 +522,7 @@ if ($resql) {
|
||||
|
||||
// Filter on categories
|
||||
$moreforfilter = '';
|
||||
if (!empty($conf->categorie->enabled) && $user->hasRight('categorie', 'lire')) {
|
||||
if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) {
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"');
|
||||
$categoriesProductArr = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', '', 64, 0, 1);
|
||||
@ -533,7 +533,7 @@ if ($resql) {
|
||||
}
|
||||
|
||||
//Show/hide child products. Hidden by default
|
||||
if (!empty($conf->variants->enabled) && !empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) {
|
||||
if (isModEnabled('variants') && !empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) {
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= '<input type="checkbox" id="search_show_childproducts" name="search_show_childproducts"'.($show_childproducts ? 'checked="checked"' : '').'>';
|
||||
$moreforfilter .= ' <label for="search_show_childproducts">'.$langs->trans('ShowChildProducts').'</label>';
|
||||
|
||||
@ -867,7 +867,7 @@ class AccountingJournal extends CommonObject
|
||||
}
|
||||
}
|
||||
//
|
||||
// if (!$error_for_line && !empty($conf->asset->enabled) && $this->nature == 1 && $bookkeeping->fk_doc > 0) {
|
||||
// if (!$error_for_line && isModEnabled('asset') && $this->nature == 1 && $bookkeeping->fk_doc > 0) {
|
||||
// // Set last cumulative depreciation
|
||||
// require_once DOL_DOCUMENT_ROOT . '/asset/class/asset.class.php';
|
||||
// $asset = new Asset($this->db);
|
||||
|
||||
@ -39,14 +39,14 @@ if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
/*
|
||||
if (empty($conf->accounting->enabled)) {
|
||||
if (!isModEnabled('accounting')) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||
accessforbidden();
|
||||
}
|
||||
*/
|
||||
if (empty($conf->comptabilite->enabled) && empty($conf->accounting->enabled) && empty($conf->asset->enabled) && empty($conf->intracommreport->enabled)) {
|
||||
if (!isModEnabled('comptabilite') && !isModEnabled('accounting') && !isModEnabled('asset') && !isModEnabled('intracommreport')) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (!$user->hasRight('compta', 'resultat', 'lire') && !$user->hasRight('accounting', 'comptarapport', 'lire') && !$user->hasRight('accounting', 'mouvements', 'lire') && !$user->hasRight('asset', 'read') && !$user->hasRight('intracommreport', 'read')) {
|
||||
@ -86,7 +86,7 @@ if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_S
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("SorryThisModuleIsNotCompatibleWithTheExperimentalFeatureOfSituationInvoices")."</span>\n";
|
||||
print "<br>";
|
||||
} elseif (!empty($conf->accounting->enabled)) {
|
||||
} elseif (isModEnabled('accounting')) {
|
||||
$step = 0;
|
||||
|
||||
$resultboxes = FormOther::getBoxesArea($user, "27"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb)
|
||||
@ -165,7 +165,7 @@ if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_S
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
|
||||
if (!empty($conf->tax->enabled)) {
|
||||
if (isModEnabled('tax')) {
|
||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=7&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong></a>';
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, '{s}');
|
||||
@ -173,7 +173,7 @@ if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_S
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
}
|
||||
if (!empty($conf->expensereport->enabled)) { // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
||||
if (isModEnabled('expensereport')) { // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '{s}');
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=17&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong></a>', $s);
|
||||
@ -212,7 +212,7 @@ if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_S
|
||||
print $s;
|
||||
print "<br>\n";
|
||||
|
||||
if (!empty($conf->expensereport->enabled) || !empty($conf->deplacement->enabled)) {
|
||||
if (isModEnabled('expensereport')|| isModEnabled('deplacement')) {
|
||||
$step++;
|
||||
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("ExpenseReports"), '{s}')."\n";
|
||||
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/expensereport/index.php"><strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong></a>', $s);
|
||||
|
||||
@ -179,7 +179,7 @@ abstract class ActionsAdherentCardCommon
|
||||
|
||||
if ($action == 'view' || $action == 'edit' || $action == 'delete') {
|
||||
// Emailing
|
||||
if (!empty($conf->mailing->enabled)) {
|
||||
if (isModEnabled('mailing')) {
|
||||
$langs->load("mails");
|
||||
$this->tpl['nb_emailing'] = $this->object->getNbOfEMailings();
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ $userid = GETPOST('userid', 'int');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
|
||||
if (!empty($conf->mailmanspip->enabled)) {
|
||||
if (isModEnabled('mailmanspip')) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
|
||||
|
||||
$langs->load('mailmanspip');
|
||||
@ -475,7 +475,7 @@ if (empty($reshook)) {
|
||||
$object->phone_perso = $phone_perso;
|
||||
$object->phone_mobile = $phone_mobile;
|
||||
$object->socialnetworks = array();
|
||||
if (!empty($conf->socialnetworks->enabled)) {
|
||||
if (isModEnabled('socialnetworks')) {
|
||||
foreach ($socialnetworks as $key => $value) {
|
||||
if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') {
|
||||
$object->socialnetworks[$key] = GETPOST("member_".$key, 'alphanohtml');
|
||||
@ -1089,7 +1089,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td>';
|
||||
print '<td>'.img_picto('', 'object_phoning_mobile', 'class="pictofixedwidth"').'<input type="text" name="phone_mobile" size="20" value="'.(GETPOSTISSET('phone_mobile') ? GETPOST('phone_mobile', 'alpha') : $object->phone_mobile).'"></td></tr>';
|
||||
|
||||
if (!empty($conf->socialnetworks->enabled)) {
|
||||
if (isModEnabled('socialnetworks')) {
|
||||
foreach ($socialnetworks as $key => $value) {
|
||||
if (!$value['active']) {
|
||||
break;
|
||||
@ -1110,7 +1110,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Categories
|
||||
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
||||
if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
|
||||
print '<tr><td>'.$form->editfieldkey("Categories", 'memcats', '', $object, 0).'</td><td>';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, 'parent', null, null, 1);
|
||||
print img_picto('', 'category').$form->multiselectarray('memcats', $cate_arbo, GETPOST('memcats', 'array'), null, null, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
|
||||
@ -1331,7 +1331,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td>';
|
||||
print '<td>'.img_picto('', 'object_phoning_mobile', 'class="pictofixedwidth"').'<input type="text" name="phone_mobile" value="'.(GETPOSTISSET("phone_mobile") ? GETPOST("phone_mobile") : $object->phone_mobile).'"></td></tr>';
|
||||
|
||||
if (!empty($conf->socialnetworks->enabled)) {
|
||||
if (isModEnabled('socialnetworks')) {
|
||||
foreach ($socialnetworks as $key => $value) {
|
||||
if (!$value['active']) {
|
||||
break;
|
||||
@ -1359,7 +1359,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Categories
|
||||
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
||||
if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
|
||||
print '<tr><td>'.$form->editfieldkey("Categories", 'memcats', '', $object, 0).'</td>';
|
||||
print '<td>';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, null, null, null, 1);
|
||||
@ -1376,7 +1376,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
|
||||
// Third party Dolibarr
|
||||
if (!empty($conf->societe->enabled)) {
|
||||
if (isModEnabled('societe')) {
|
||||
print '<tr><td>'.$langs->trans("LinkedToDolibarrThirdParty").'</td><td colspan="2" class="valeur">';
|
||||
if ($object->socid) {
|
||||
$company = new Societe($db);
|
||||
@ -1449,12 +1449,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
$formquestion = array(
|
||||
array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login)
|
||||
);
|
||||
if (!empty($conf->societe->enabled) && $object->socid > 0) {
|
||||
if (isModEnabled('societe') && $object->socid > 0) {
|
||||
$object->fetch_thirdparty();
|
||||
$formquestion[] = array('label' => $langs->trans("UserWillBe"), 'type' => 'radio', 'name' => 'internalorexternal', 'default'=>'external', 'values' => array('external'=>$langs->trans("External").' - '.$langs->trans("LinkedToDolibarrThirdParty").' '.$object->thirdparty->getNomUrl(1, '', 0, 1), 'internal'=>$langs->trans("Internal")));
|
||||
}
|
||||
$text = '';
|
||||
if (!empty($conf->societe->enabled) && $object->socid <= 0) {
|
||||
if (isModEnabled('societe') && $object->socid <= 0) {
|
||||
$text .= $langs->trans("UserWillBeInternalUser").'<br>';
|
||||
}
|
||||
$text .= $langs->trans("ConfirmCreateLogin");
|
||||
@ -1541,10 +1541,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
if ($object->email) {
|
||||
$formquestion[] = array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => (getDolGlobalString('ADHERENT_DEFAULT_SENDINFOBYMAIL') ? true : false));
|
||||
}
|
||||
if (!empty($conf->mailman->enabled) && !empty($conf->global->ADHERENT_USE_MAILMAN)) {
|
||||
if (isModEnabled('mailman') && !empty($conf->global->ADHERENT_USE_MAILMAN)) {
|
||||
$formquestion[] = array('type'=>'other', 'label'=>$langs->transnoentitiesnoconv("SynchroMailManEnabled"), 'value'=>'');
|
||||
}
|
||||
if (!empty($conf->mailman->enabled) && !empty($conf->global->ADHERENT_USE_SPIP)) {
|
||||
if (isModEnabled('mailman') && !empty($conf->global->ADHERENT_USE_SPIP)) {
|
||||
$formquestion[] = array('type'=>'other', 'label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"), 'value'=>'');
|
||||
}
|
||||
print $form->formconfirm("card.php?rowid=".$id, $langs->trans("ValidateMember"), $langs->trans("ConfirmValidateMember"), "confirm_valid", $formquestion, 'yes', 1, 220);
|
||||
@ -1692,7 +1692,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
||||
$rowspan++;
|
||||
}
|
||||
if (!empty($conf->societe->enabled)) {
|
||||
if (isModEnabled('societe')) {
|
||||
$rowspan++;
|
||||
}
|
||||
|
||||
@ -1783,7 +1783,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<table class="border tableforfield centpercent">';
|
||||
|
||||
// Tags / Categories
|
||||
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
||||
if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
|
||||
print '<tr><td>'.$langs->trans("Categories").'</td>';
|
||||
print '<td colspan="2">';
|
||||
print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1);
|
||||
@ -1813,7 +1813,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
// Third party Dolibarr
|
||||
if (!empty($conf->societe->enabled)) {
|
||||
if (isModEnabled('societe')) {
|
||||
print '<tr><td>';
|
||||
$editenable = $user->rights->adherent->creer;
|
||||
print $form->editfieldkey('LinkedToDolibarrThirdParty', 'thirdparty', '', $object, $editenable);
|
||||
@ -1951,7 +1951,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
|
||||
// Create third party
|
||||
if (!empty($conf->societe->enabled) && !$object->socid) {
|
||||
if (isModEnabled('societe') && !$object->socid) {
|
||||
if ($user->rights->societe->creer) {
|
||||
if (Adherent::STATUS_DRAFT != $object->statut) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=create_thirdparty" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrThirdPartyDesc")).'">'.$langs->trans("CreateDolibarrThirdParty").'</a>'."\n";
|
||||
@ -1977,7 +1977,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
|
||||
// Action SPIP
|
||||
if (!empty($conf->mailmanspip->enabled) && !empty($conf->global->ADHERENT_USE_SPIP)) {
|
||||
if (isModEnabled('mailmanspip') && !empty($conf->global->ADHERENT_USE_SPIP)) {
|
||||
$isinspip = $mailmanspip->is_in_spip($object);
|
||||
|
||||
if ($isinspip == 1) {
|
||||
@ -2034,7 +2034,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
*/
|
||||
|
||||
// Show online payment link
|
||||
$useonlinepayment = (!empty($conf->paypal->enabled) || !empty($conf->stripe->enabled) || !empty($conf->paybox->enabled));
|
||||
$useonlinepayment = (isModEnabled('paypal') || isModEnabled('stripe') || isModEnabled('paybox'));
|
||||
|
||||
if ($useonlinepayment) {
|
||||
print '<br>';
|
||||
|
||||
@ -89,7 +89,7 @@ $arrayfields = array(
|
||||
'd.firstname'=>array('label'=>"Firstname", 'checked'=>1),
|
||||
'd.login'=>array('label'=>"Login", 'checked'=>1),
|
||||
't.libelle'=>array('label'=>"Label", 'checked'=>1),
|
||||
'd.bank'=>array('label'=>"BankAccount", 'checked'=>1, 'enabled'=>(!empty($conf->banque->enabled))),
|
||||
'd.bank'=>array('label'=>"BankAccount", 'checked'=>1, 'enabled'=>(isModEnabled('banque'))),
|
||||
/*'d.note_public'=>array('label'=>"NotePublic", 'checked'=>0),
|
||||
'd.note_private'=>array('label'=>"NotePrivate", 'checked'=>0),*/
|
||||
'c.dateadh'=>array('label'=>"DateSubscription", 'checked'=>1, 'position'=>100),
|
||||
|
||||
@ -184,7 +184,7 @@ if (!empty($triggers)) {
|
||||
}
|
||||
|
||||
//print 'module='.$module.' code='.$trigger['code'].'<br>';
|
||||
if (!empty($conf->$module->enabled)) {
|
||||
if (isModEnabled('module')) {
|
||||
// Discard special case: If option FICHINTER_CLASSIFY_BILLED is not set, we discard both trigger FICHINTER_CLASSIFY_BILLED and FICHINTER_CLASSIFY_UNBILLED
|
||||
if ($trigger['code'] == 'FICHINTER_CLASSIFY_BILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED)) {
|
||||
continue;
|
||||
|
||||
@ -206,7 +206,7 @@ $job->fetch(0, 'ActionComm', 'sendEmailsReminder');
|
||||
// AGENDA REMINDER EMAIL
|
||||
print '<tr class="oddeven">'."\n";
|
||||
print '<td>'.$langs->trans('AGENDA_REMINDER_EMAIL', $langs->transnoentities("Module2300Name"));
|
||||
if (!empty($conf->cron->enabled)) {
|
||||
if (isModEnabled('cron')) {
|
||||
if (!empty($conf->global->AGENDA_REMINDER_EMAIL)) {
|
||||
if ($job->id > 0) {
|
||||
if ($job->status == $job::STATUS_ENABLED) {
|
||||
@ -219,7 +219,7 @@ print '</td>'."\n";
|
||||
print '<td class="center"> </td>'."\n";
|
||||
print '<td class="right nowraponall">'."\n";
|
||||
|
||||
if (empty($conf->cron->enabled)) {
|
||||
if (!isModEnabled('cron')) {
|
||||
print '<span class="opacitymedium">'.$langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("Module2300Name")).'</span>';
|
||||
} else {
|
||||
if (empty($conf->global->AGENDA_REMINDER_EMAIL)) {
|
||||
|
||||
@ -835,7 +835,11 @@ class FormSetupItem
|
||||
} elseif ($this->type== 'color') {
|
||||
$out.= $this->generateInputFieldColor();
|
||||
} elseif ($this->type == 'yesno') {
|
||||
$out.= $this->form->selectyesno($this->confKey, $this->fieldValue, 1);
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
$out.= ajax_constantonoff($this->confKey);
|
||||
} else {
|
||||
$out.= $this->form->selectyesno($this->confKey, $this->fieldValue, 1);
|
||||
}
|
||||
} elseif (preg_match('/emailtemplate:/', $this->type)) {
|
||||
$out.= $this->generateInputFieldEmailTemplate();
|
||||
} elseif (preg_match('/category:/', $this->type)) {
|
||||
@ -1032,7 +1036,7 @@ class FormSetupItem
|
||||
*/
|
||||
public function generateOutputField()
|
||||
{
|
||||
global $conf, $user;
|
||||
global $conf, $user, $langs;
|
||||
|
||||
if (!empty($this->fieldOverride)) {
|
||||
return $this->fieldOverride;
|
||||
@ -1057,7 +1061,15 @@ class FormSetupItem
|
||||
} elseif ($this->type== 'color') {
|
||||
$out.= $this->generateOutputFieldColor();
|
||||
} elseif ($this->type == 'yesno') {
|
||||
$out.= ajax_constantonoff($this->confKey);
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
$out.= ajax_constantonoff($this->confKey);
|
||||
} else {
|
||||
if ($this->fieldValue == 1) {
|
||||
$out.= $langs->trans('yes');
|
||||
} else {
|
||||
$out.= $langs->trans('no');
|
||||
}
|
||||
}
|
||||
} elseif (preg_match('/emailtemplate:/', $this->type)) {
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($this->db);
|
||||
|
||||
@ -416,7 +416,7 @@ function dol_print_object_info($object, $usetable = 0)
|
||||
} else {
|
||||
print ': ';
|
||||
}
|
||||
if (is_object($object->user_approve)) {
|
||||
if (!empty($object->user_approve) && is_object($object->user_approve)) {
|
||||
if ($object->user_approve->id) {
|
||||
print $object->user_approve->getNomUrl(-1, '', 0, 0, 0);
|
||||
} else {
|
||||
|
||||
@ -1315,10 +1315,10 @@ if ($action == 'create') {
|
||||
|
||||
$detail = '';
|
||||
$detail .= $langs->trans("Batch").': '.$dbatch->batch;
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY) && !empty($dbatch->sellby)) {
|
||||
$detail .= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day");
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY) && !empty($dbatch->eatby)) {
|
||||
$detail .= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day");
|
||||
}
|
||||
$detail .= ' - '.$langs->trans("Qty").': '.$dbatch->qty;
|
||||
@ -1526,6 +1526,12 @@ if ($action == 'create') {
|
||||
} else {
|
||||
print 'TableLotIncompleteRunRepairWithParamStandardEqualConfirmed';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY) && !empty($dbatch->sellby)) {
|
||||
print ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day");
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY) && !empty($dbatch->eatby)) {
|
||||
print ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day");
|
||||
}
|
||||
print ' ('.$dbatch->qty.')';
|
||||
$quantityToBeDelivered -= $deliverableQty;
|
||||
if ($quantityToBeDelivered < 0) {
|
||||
|
||||
@ -2084,6 +2084,10 @@ if ($action == 'create') {
|
||||
|
||||
// Date
|
||||
if ($object->methode_commande_id > 0) {
|
||||
$usehourmin = 0;
|
||||
if (!empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) {
|
||||
$usehourmin = 1;
|
||||
}
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Date").'</td><td>';
|
||||
print $object->date_commande ? dol_print_date($object->date_commande, $usehourmin ? 'dayhour' : 'day') : '';
|
||||
if ($object->hasDelay() && !empty($object->date_delivery) && !empty($object->date_commande)) {
|
||||
|
||||
@ -41,6 +41,19 @@ if (empty($id)) {
|
||||
$id = $object->id;
|
||||
}
|
||||
|
||||
$pdluoid = GETPOST('pdluoid', 'int');
|
||||
|
||||
$pdluo = new Productbatch($db);
|
||||
|
||||
if ($pdluoid > 0) {
|
||||
$result = $pdluo->fetch($pdluoid);
|
||||
if ($result > 0) {
|
||||
$pdluoid = $pdluo->id;
|
||||
} else {
|
||||
dol_print_error($db, $pdluo->error, $pdluo->errors);
|
||||
}
|
||||
}
|
||||
|
||||
print '<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
function init_price()
|
||||
@ -82,6 +95,9 @@ print dol_get_fiche_head();
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="correct_stock">';
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
if ($pdluoid) {
|
||||
print '<input type="hidden" name="pdluoid" value="'.$pdluoid.'">';
|
||||
}
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
// Warehouse or product
|
||||
@ -128,26 +144,34 @@ if (!empty($conf->global->PRODUIT_SOUSPRODUITS) && $object->element == 'product'
|
||||
}
|
||||
|
||||
// Serial / Eat-by date
|
||||
if (!empty($conf->productbatch->enabled) &&
|
||||
if (ismodEnabled('productbatch') &&
|
||||
(($object->element == 'product' && $object->hasbatch())
|
||||
|| ($object->element == 'stock'))
|
||||
) {
|
||||
print '<tr>';
|
||||
print '<td'.($object->element == 'stock' ? '' : ' class="fieldrequired"').'>'.$langs->trans("batch_number").'</td><td colspan="3">';
|
||||
print '<input type="text" name="batch_number" class="minwidth300" value="'.GETPOST("batch_number").'">';
|
||||
if ($pdluoid > 0) {
|
||||
// If form was opened for a specific pdluoid, field is disabled
|
||||
print '<input type="text" name="batch_number_bis" size="40" disabled="disabled" value="'.(GETPOST('batch_number') ?GETPOST('batch_number') : $pdluo->batch).'">';
|
||||
print '<input type="hidden" name="batch_number" value="'.(GETPOST('batch_number') ?GETPOST('batch_number') : $pdluo->batch).'">';
|
||||
} else {
|
||||
print '<input type="text" name="batch_number" class="minwidth300" value="'.(GETPOST('batch_number') ? GETPOST('batch_number') : $pdluo->batch).'">';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '<tr>';
|
||||
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
||||
print '<td>'.$langs->trans("SellByDate").'</td><td>';
|
||||
$sellbyselected = dol_mktime(0, 0, 0, GETPOST('sellbymonth'), GETPOST('sellbyday'), GETPOST('sellbyyear'));
|
||||
print $form->selectDate($sellbyselected, 'sellby', '', '', 1, "");
|
||||
// If form was opened for a specific pdluoid, field is disabled
|
||||
print $form->selectDate(($pdluo->id > 0 ? $pdluo->sellby : $sellbyselected), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0));
|
||||
print '</td>';
|
||||
}
|
||||
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
|
||||
print '<td>'.$langs->trans("EatByDate").'</td><td>';
|
||||
$eatbyselected = dol_mktime(0, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear'));
|
||||
print $form->selectDate($eatbyselected, 'eatby', '', '', 1, "");
|
||||
// If form was opened for a specific pdluoid, field is disabled
|
||||
print $form->selectDate(($pdluo->id > 0 ? $pdluo->eatby : $eatbyselected), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0));
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user