Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8
This commit is contained in:
commit
269fb87342
@ -292,6 +292,7 @@ $var=!$var;
|
||||
$this->NbRepeat = $tabConf[4];
|
||||
$this->WithoutAmbi = $tabConf[5];
|
||||
*/
|
||||
print '<br>';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3"> '.$langs->trans("PasswordPatternDesc").'</td>';
|
||||
@ -332,13 +333,17 @@ $var=!$var;
|
||||
print '<td>' . $langs->trans("NoAmbiCaracAutoGeneration")."</td>";
|
||||
print '<td colspan="2"><input type="checkbox" id="NoAmbiCaracAutoGeneration" '.($tabConf[5] ? "checked" : "").' min="0"> <span id="textcheckbox">'.($tabConf[5] ? $langs->trans("Activated") : $langs->trans("Disabled")).'</span></td>';
|
||||
print '</tr>';
|
||||
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td colspan="2"></td><td width="103" align="center"><a id="linkChangePattern">'.$langs->trans("Save").'</a></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
print '<table align="right">';
|
||||
print '<tr><td>';
|
||||
print '<a class="button" id="linkChangePattern">'.$langs->trans("Save").'</a>';
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
print '<br><br>';
|
||||
|
||||
print '<script type="text/javascript">';
|
||||
print ' function getStringArg(){';
|
||||
print ' var pattern = "";';
|
||||
@ -389,7 +394,7 @@ $var=!$var;
|
||||
// Cryptage mot de passe
|
||||
print '<br>';
|
||||
$var=true;
|
||||
print "<form method=\"post\" action=\"security.php\">";
|
||||
print "<form method=\"post\" action=\"" . $_SERVER["PHP_SELF"] . "\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"encrypt\">";
|
||||
|
||||
|
||||
@ -978,6 +978,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
|
||||
$this->id=0;
|
||||
$this->ref = '';
|
||||
$this->statut=self::STATUS_DRAFT;
|
||||
|
||||
// Clear fields
|
||||
@ -986,14 +987,7 @@ class Commande extends CommonOrder
|
||||
$this->date_creation = '';
|
||||
$this->date_validation = '';
|
||||
$this->ref_client = '';
|
||||
|
||||
// Set ref
|
||||
require_once DOL_DOCUMENT_ROOT ."/core/modules/commande/".$conf->global->COMMANDE_ADDON.'.php';
|
||||
$obj = $conf->global->COMMANDE_ADDON;
|
||||
$modCommande = new $obj;
|
||||
$this->ref = $modCommande->getNextValue($objsoc,$this);
|
||||
|
||||
|
||||
|
||||
// Create clone
|
||||
$result=$this->create($user);
|
||||
if ($result < 0) $error++;
|
||||
|
||||
@ -1317,7 +1317,7 @@ else
|
||||
$sql.= " cd.date_fin_validite as date_fin, cd.date_cloture as date_fin_reelle,";
|
||||
$sql.= " cd.commentaire as comment, cd.fk_product_fournisseur_price as fk_fournprice, cd.buy_price_ht as pa_ht,";
|
||||
$sql.= " cd.fk_unit,";
|
||||
$sql.= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype";
|
||||
$sql.= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype, p.entity as pentity";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as cd";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
|
||||
$sql.= " WHERE cd.rowid = ".$object->lines[$cursorline-1]->id;
|
||||
@ -1352,6 +1352,7 @@ else
|
||||
$productstatic->id=$objp->fk_product;
|
||||
$productstatic->type=$objp->ptype;
|
||||
$productstatic->ref=$objp->pref;
|
||||
$productstatic->entity=$objp->pentity;
|
||||
$text = $productstatic->getNomUrl(1,'',20);
|
||||
if ($objp->label)
|
||||
{
|
||||
@ -1485,6 +1486,7 @@ else
|
||||
$productstatic->id=$objp->fk_product;
|
||||
$productstatic->type=$objp->ptype;
|
||||
$productstatic->ref=$objp->pref;
|
||||
$productstatic->entity=$objp->pentity;
|
||||
print $productstatic->getNomUrl(1,'',20);
|
||||
print $objp->label?' - '.dol_trunc($objp->label,16):'';
|
||||
print '<br>';
|
||||
|
||||
@ -371,7 +371,7 @@ print '<br>';
|
||||
$sql = "SELECT c.ref, c.fk_soc, ";
|
||||
$sql.= " cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat, cd.date_fin_validite,";
|
||||
$sql.= " s.nom as name,";
|
||||
$sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype";
|
||||
$sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity";
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."contrat as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -413,6 +413,7 @@ if ($resql)
|
||||
$productstatic->id=$obj->fk_product;
|
||||
$productstatic->type=$obj->ptype;
|
||||
$productstatic->ref=$obj->pref;
|
||||
$productstatic->entity=$obj->pentity;
|
||||
print $productstatic->getNomUrl(1,'',20);
|
||||
}
|
||||
else
|
||||
@ -449,7 +450,7 @@ print '<br>';
|
||||
// Not activated services
|
||||
$sql = "SELECT c.ref, c.fk_soc, cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat,";
|
||||
$sql.= " s.nom as name,";
|
||||
$sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype";
|
||||
$sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity";
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."contrat as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -493,6 +494,7 @@ if ($resql)
|
||||
$productstatic->id=$obj->fk_product;
|
||||
$productstatic->type=$obj->ptype;
|
||||
$productstatic->ref=$obj->pref;
|
||||
$productstatic->entity=$obj->pentity;
|
||||
print $productstatic->getNomUrl(1,'',20);
|
||||
}
|
||||
else
|
||||
@ -528,7 +530,7 @@ print '<br>';
|
||||
// Expired services
|
||||
$sql = "SELECT c.ref, c.fk_soc, cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat,";
|
||||
$sql.= " s.nom as name,";
|
||||
$sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype";
|
||||
$sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity";
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."contrat as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -573,6 +575,7 @@ if ($resql)
|
||||
$productstatic->id=$obj->fk_product;
|
||||
$productstatic->type=$obj->ptype;
|
||||
$productstatic->ref=$obj->pref;
|
||||
$productstatic->entity=$obj->pentity;
|
||||
print $productstatic->getNomUrl(1,'',20);
|
||||
}
|
||||
else
|
||||
|
||||
@ -98,7 +98,7 @@ llxHeader();
|
||||
$sql = "SELECT c.rowid as cid, c.ref, c.statut as cstatut,";
|
||||
$sql.= " s.rowid as socid, s.nom as name,";
|
||||
$sql.= " cd.rowid, cd.description, cd.statut,";
|
||||
$sql.= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype,";
|
||||
$sql.= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype, p.entity as pentity,";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= " sc.fk_soc, sc.fk_user,";
|
||||
$sql.= " cd.date_ouverture_prevue,";
|
||||
$sql.= " cd.date_ouverture,";
|
||||
@ -225,6 +225,7 @@ if ($resql)
|
||||
$productstatic->id=$obj->pid;
|
||||
$productstatic->type=$obj->ptype;
|
||||
$productstatic->ref=$obj->pref;
|
||||
$productstatic->entity=$obj->pentity;
|
||||
print $productstatic->getNomUrl(1,'',20);
|
||||
print $obj->label?' - '.dol_trunc($obj->label,16):'';
|
||||
if (! empty($obj->description) && ! empty($conf->global->PRODUCT_DESC_IN_LIST)) print '<br>'.dol_nl2br($obj->description);
|
||||
|
||||
@ -64,7 +64,7 @@ class box_produits extends ModeleBoxes
|
||||
|
||||
if ($user->rights->produit->lire || $user->rights->service->lire)
|
||||
{
|
||||
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.fk_price_expression";
|
||||
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.fk_price_expression, p.entity";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
$sql.= ' WHERE p.entity IN ('.getEntity($productstatic->element, 1).')';
|
||||
if (empty($user->rights->produit->lire)) $sql.=' AND p.fk_product_type != 0';
|
||||
@ -103,6 +103,7 @@ class box_produits extends ModeleBoxes
|
||||
$productstatic->ref = $objp->ref;
|
||||
$productstatic->type = $objp->fk_product_type;
|
||||
$productstatic->label = $objp->label;
|
||||
$productstatic->entity = $objp->entity;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
|
||||
@ -66,7 +66,7 @@ class box_produits_alerte_stock extends ModeleBoxes
|
||||
|
||||
if ($user->rights->produit->lire || $user->rights->service->lire)
|
||||
{
|
||||
$sql = "SELECT p.rowid, p.label, p.price, p.ref, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.seuil_stock_alerte,";
|
||||
$sql = "SELECT p.rowid, p.label, p.price, p.ref, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.seuil_stock_alerte,p.entity,";
|
||||
$sql.= " SUM(".$db->ifsql("s.reel IS NULL","0","s.reel").") as total_stock";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as s on p.rowid = s.fk_product";
|
||||
@ -110,6 +110,7 @@ class box_produits_alerte_stock extends ModeleBoxes
|
||||
$productstatic->ref = $objp->ref;
|
||||
$productstatic->type = $objp->fk_product_type;
|
||||
$productstatic->label = $objp->label;
|
||||
$productstatic->entity = $objp->entity;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
|
||||
@ -75,6 +75,7 @@ abstract class CommonDocGenerator
|
||||
'myuser_mobile'=>$user->user_mobile,
|
||||
'myuser_email'=>$user->email,
|
||||
'myuser_logo'=>$user->photo,
|
||||
'myuser_job'=>$user->job,
|
||||
'myuser_web'=>'' // url not exist in $user object
|
||||
);
|
||||
}
|
||||
|
||||
@ -3764,7 +3764,7 @@ function get_exdir($num,$level,$alpha,$withoutslash,$object,$modulepart)
|
||||
// TODO if object is null, load it from id and modulepart.
|
||||
|
||||
|
||||
if (! empty($level) && in_array($modulepart, array('cheque','user','category','holiday','shipment', 'member','don','donation','supplier_invoice','invoice_supplier')))
|
||||
if (! empty($level) && in_array($modulepart, array('cheque','user','category','holiday','shipment', 'member','don','donation','supplier_invoice','invoice_supplier','product')))
|
||||
{
|
||||
// This part should be removed once all code is using "get_exdir" to forge path, with all parameters provided
|
||||
if (empty($alpha)) $num = preg_replace('/([^0-9])/i','',$num);
|
||||
|
||||
@ -1197,7 +1197,10 @@ function pdf_getlinenum($object,$i,$outputlangs,$hidedetails=0)
|
||||
{
|
||||
$special_code = $object->lines[$i]->special_code;
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
// TODO add hook function
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlinenum',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
return $hookmanager->resPrint;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1223,7 +1226,10 @@ function pdf_getlineref($object,$i,$outputlangs,$hidedetails=0)
|
||||
{
|
||||
$special_code = $object->lines[$i]->special_code;
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
// TODO add hook function
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlineref',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
return $hookmanager->resPrint;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1248,7 +1254,10 @@ function pdf_getlineref_supplier($object,$i,$outputlangs,$hidedetails=0)
|
||||
{
|
||||
$special_code = $object->lines[$i]->special_code;
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
// TODO add hook function
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlineref_supplier',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
return $hookmanager->resPrint;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1275,7 +1284,8 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0)
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
return $hookmanager->executeHooks('pdf_getlinevatrate',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlinevatrate',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
return $hookmanager->resPrint;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1305,7 +1315,8 @@ function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0)
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
return $hookmanager->executeHooks('pdf_getlineupexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlineupexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
return $hookmanager->resPrint;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1330,10 +1341,10 @@ function pdf_getlineupwithtax($object,$i,$outputlangs,$hidedetails=0)
|
||||
{
|
||||
$special_code = $object->lines[$i]->special_code;
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
foreach($object->hooks as $modules)
|
||||
{
|
||||
if (method_exists($modules[$special_code],'pdf_getlineupwithtax')) return $modules[$special_code]->pdf_getlineupwithtax($object,$i,$outputlangs,$hidedetails);
|
||||
}
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlineupwithtax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
return $hookmanager->resPrint;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1362,7 +1373,8 @@ function pdf_getlineqty($object,$i,$outputlangs,$hidedetails=0)
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
return $hookmanager->executeHooks('pdf_getlineqty',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlineqty',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
return $hookmanager->resPrint;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1392,7 +1404,8 @@ function pdf_getlineqty_asked($object,$i,$outputlangs,$hidedetails=0)
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
return $hookmanager->executeHooks('pdf_getlineqty_asked',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlineqty_asked',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
return $hookmanager->resPrint;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1422,7 +1435,8 @@ function pdf_getlineqty_shipped($object,$i,$outputlangs,$hidedetails=0)
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
return $hookmanager->executeHooks('pdf_getlineqty_shipped',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlineqty_shipped',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
return $hookmanager->resPrint;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1452,7 +1466,8 @@ function pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails=0)
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
return $hookmanager->executeHooks('pdf_getlineqty_keeptoship',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlineqty_keeptoship',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
return $hookmanager->resPrint;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1487,8 +1502,8 @@ function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0, $hookmanag
|
||||
'special_code' => $special_code
|
||||
);
|
||||
$action = '';
|
||||
return $hookmanager->executeHooks('pdf_getlineunit', $parameters, $object,
|
||||
$action); // Note that $action and $object may have been modified by some hooks
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlineunit', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
return $hookmanager->resPrint;
|
||||
} else {
|
||||
if (empty($hidedetails) || $hidedetails > 1) {
|
||||
return $langs->transnoentitiesnoconv($object->lines[$i]->getLabelOfUnit('short'));
|
||||
@ -1521,7 +1536,8 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0)
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
return $hookmanager->executeHooks('pdf_getlineremisepercent',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlineremisepercent',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
return $hookmanager->resPrint;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1548,7 +1564,8 @@ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookm
|
||||
if (!empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
$parameters = array('i' => $i, 'outputlangs' => $outputlangs, 'hidedetails' => $hidedetails, 'special_code' => $special_code);
|
||||
$action = '';
|
||||
return $hookmanager->executeHooks('pdf_getlineprogress', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlineprogress', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
return $hookmanager->resPrint;
|
||||
} else {
|
||||
if (empty($hidedetails) || $hidedetails > 1) return $object->lines[$i]->situation_percent . '%';
|
||||
}
|
||||
@ -1583,7 +1600,8 @@ function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0)
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
return $hookmanager->executeHooks('pdf_getlinetotalexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlinetotalexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
return $hookmanager->resPrint;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1618,7 +1636,8 @@ function pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails=0)
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
return $hookmanager->executeHooks('pdf_getlinetotalwithtax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
$reshook = $hookmanager->executeHooks('pdf_getlinetotalwithtax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
return $hookmanager->resPrint;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1656,7 +1675,10 @@ function pdf_getTotalQty($object,$type,$outputlangs)
|
||||
{
|
||||
$special_code = $object->lines[$i]->special_code;
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
// TODO add hook function
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
$reshook = $hookmanager->executeHooks('pdf_getTotalQty',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
return $hookmanager->resPrint;
|
||||
}
|
||||
else if ($type==0 && $object->lines[$i]->product_type == 0)
|
||||
{
|
||||
@ -1692,7 +1714,7 @@ function pdf_getLinkedObjects($object,$outputlangs)
|
||||
if ($objecttype == 'propal')
|
||||
{
|
||||
$outputlangs->load('propal');
|
||||
|
||||
|
||||
foreach($objects as $elementobject)
|
||||
{
|
||||
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefProposal");
|
||||
|
||||
@ -191,7 +191,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$objphoto = new Product($this->db);
|
||||
$objphoto->fetch($object->lines[$i]->fk_product);
|
||||
|
||||
$pdir = get_exdir($object->lines[$i]->fk_product,2,0,0,'product') . $object->lines[$i]->fk_product ."/photos/";
|
||||
$pdir = get_exdir($object->lines[$i]->fk_product,2,0,0,$objphoto,'product') . $object->lines[$i]->fk_product ."/photos/";
|
||||
$dir = $conf->product->dir_output.'/'.$pdir;
|
||||
|
||||
$realpath='';
|
||||
|
||||
@ -123,7 +123,7 @@ print '<td align="right">'.$langs->trans("LibraryVersion").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php';
|
||||
$model=new ModeleExports();
|
||||
$model=new ModeleExports($db);
|
||||
$liste=$model->liste_modeles($db); // This is not a static method for exports because method load non static properties
|
||||
|
||||
$var=true;
|
||||
|
||||
@ -337,7 +337,7 @@ if ($object->id > 0)
|
||||
|
||||
//Query from product/liste.php
|
||||
$sql = 'SELECT p.rowid, p.ref, p.label, pfp.tms,';
|
||||
$sql.= ' p.fk_product_type';
|
||||
$sql.= ' p.fk_product_type, p.entity';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'product_fournisseur_price as pfp';
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = pfp.fk_product";
|
||||
$sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')';
|
||||
@ -361,6 +361,7 @@ if ($object->id > 0)
|
||||
$productstatic->ref = $objp->ref;
|
||||
$productstatic->label = $objp->label;
|
||||
$productstatic->type = $objp->fk_product_type;
|
||||
$productstatic->entity = $objp->entity;
|
||||
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td class="nowrap">';
|
||||
|
||||
@ -86,7 +86,7 @@ if ($fourn_id)
|
||||
$supplier->fetch($fourn_id);
|
||||
}
|
||||
|
||||
$sql = "SELECT p.rowid, p.label, p.ref, p.fk_product_type,";
|
||||
$sql = "SELECT p.rowid, p.label, p.ref, p.fk_product_type, p.entity,";
|
||||
$sql.= " ppf.fk_soc, ppf.ref_fourn, ppf.price as price, ppf.quantity as qty, ppf.unitprice,";
|
||||
$sql.= " s.rowid as socid, s.nom as name";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
@ -212,6 +212,7 @@ if ($resql)
|
||||
$productstatic->id=$objp->rowid;
|
||||
$productstatic->ref=$objp->ref;
|
||||
$productstatic->type=$objp->fk_product_type;
|
||||
$productstatic->entity=$objp->entity;
|
||||
print $productstatic->getNomUrl(1,'supplier');
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -974,6 +974,7 @@ Delays_MAIN_DELAY_CUSTOMER_BILLS_UNPAYED=Tolerence delay (in days) before alert
|
||||
Delays_MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE=Tolerance delay (in days) before alert on pending bank reconciliation
|
||||
Delays_MAIN_DELAY_MEMBERS=Tolerance delay (in days) before alert on delayed membership fee
|
||||
Delays_MAIN_DELAY_CHEQUES_TO_DEPOSIT=Tolerance delay (in days) before alert for cheques deposit to do
|
||||
Delays_MAIN_DELAY_EXPENSEREPORTS=Tolerance delay (in days) before alert for expense reports to approve
|
||||
SetupDescription1=All parameters available in the setup area allow you to setup Dolibarr before starting using it.
|
||||
SetupDescription2=The 2 most important setup steps are the 2 first ones in the left setup menu, this means Company/foundation setup page and Modules setup page:
|
||||
SetupDescription3=Parameters in menu <a href="%s">Setup -> Company/foundation</a> are required because input information is used on Dolibarr displays and to modify Dolibarr behaviour (for example for features related to your country).
|
||||
@ -1110,6 +1111,9 @@ EmptyNumRefModelDesc=The code is free. This code can be modified at any time.
|
||||
##### Module password generation
|
||||
PasswordGenerationStandard=Return a password generated according to internal Dolibarr algorithm: 8 characters containing shared numbers and characters in lowercase.
|
||||
PasswordGenerationNone=Do not suggest any generated password. Password must be type in manually.
|
||||
PasswordGenerationPerso=Return a password according to your personally defined configuration.
|
||||
SetupPerso=According to your configuration
|
||||
PasswordPatternDesc=Password pattern description
|
||||
##### Users setup #####
|
||||
UserGroupSetup=Users and groups module setup
|
||||
GeneratePassword=Suggest a generated password
|
||||
|
||||
@ -162,7 +162,7 @@ if (! empty($conf->global->DISPLAY_MARK_RATES)) {
|
||||
print "</table>";
|
||||
print '</form>';
|
||||
|
||||
$sql = "SELECT p.label, p.rowid, p.fk_product_type, p.ref,";
|
||||
$sql = "SELECT p.label, p.rowid, p.fk_product_type, p.ref, p.entity as pentity,";
|
||||
if ($id > 0) $sql.= " d.fk_product,";
|
||||
if ($id > 0) $sql.= " f.rowid as facid, f.facnumber, f.total as total_ht, f.datef, f.paye, f.fk_statut as statut,";
|
||||
$sql.= " sum(d.total_ht) as selling_price,";
|
||||
@ -264,6 +264,7 @@ if ($result)
|
||||
$product_static->id=$objp->rowid;
|
||||
$product_static->ref=$objp->ref;
|
||||
$product_static->label=$objp->label;
|
||||
$product_static->entity=$objp->pentity;
|
||||
$text=$product_static->getNomUrl(1);
|
||||
print $text.= ' - '.$objp->label;
|
||||
print "</td>\n";
|
||||
|
||||
@ -341,7 +341,7 @@ class ActionsCardProduct
|
||||
$sql = 'SELECT DISTINCT ';
|
||||
|
||||
// Fields requiered
|
||||
$sql.= 'p.rowid, p.price_base_type, p.fk_product_type, p.seuil_stock_alerte';
|
||||
$sql.= 'p.rowid, p.price_base_type, p.fk_product_type, p.seuil_stock_alerte, p.entity';
|
||||
|
||||
// Fields not requiered
|
||||
foreach($this->field_list as $field)
|
||||
@ -417,6 +417,7 @@ class ActionsCardProduct
|
||||
$this->id = $obj->rowid;
|
||||
$this->ref = $obj->$alias;
|
||||
$this->type = $obj->fk_product_type;
|
||||
$this->entity = $obj->entity;
|
||||
$datas[$alias] = $this->getNomUrl(1,'',24);
|
||||
}
|
||||
else if ($alias == 'stock')
|
||||
|
||||
@ -2768,7 +2768,8 @@ class Product extends CommonObject
|
||||
'type'=>$type, // Nb of units that compose parent product
|
||||
'desiredstock'=>$this->desiredstock,
|
||||
'level'=>$level,
|
||||
'incdec'=>$incdec
|
||||
'incdec'=>$incdec,
|
||||
'entity'=>$this->entity
|
||||
);
|
||||
|
||||
// Recursive call if there is childs to child
|
||||
@ -2850,7 +2851,7 @@ class Product extends CommonObject
|
||||
*/
|
||||
function getFather()
|
||||
{
|
||||
$sql = "SELECT p.rowid, p.label as label, p.ref as ref, pa.fk_product_pere as id, p.fk_product_type, pa.qty, pa.incdec";
|
||||
$sql = "SELECT p.rowid, p.label as label, p.ref as ref, pa.fk_product_pere as id, p.fk_product_type, pa.qty, pa.incdec, p.entity";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product_association as pa,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."product as p";
|
||||
$sql.= " WHERE p.rowid = pa.fk_product_pere";
|
||||
@ -2868,6 +2869,7 @@ class Product extends CommonObject
|
||||
$prods[$record['id']]['qty'] = $record['qty'];
|
||||
$prods[$record['id']]['incdec'] = $record['incdec'];
|
||||
$prods[$record['id']]['fk_product_type'] = $record['fk_product_type'];
|
||||
$prods[$record['id']]['entity'] = $record['entity'];
|
||||
}
|
||||
return $prods;
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ if ($action == 'search')
|
||||
{
|
||||
$current_lang = $langs->getDefaultLang();
|
||||
|
||||
$sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,';
|
||||
$sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,';
|
||||
$sql.= ' p.fk_product_type, p.tms as datem';
|
||||
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= ', pl.label as labelm, pl.description as descriptionm';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'product as p';
|
||||
@ -278,6 +278,7 @@ if ($id > 0 || ! empty($ref))
|
||||
$productstatic->type=$value["fk_product_type"];
|
||||
$productstatic->ref=$value['ref'];
|
||||
$productstatic->label=$value['label'];
|
||||
$productstatic->entity=$value['entity'];
|
||||
|
||||
$class=($class=='impair')?'pair':'impair';
|
||||
print '<tr class="'.$class.'">';
|
||||
@ -334,6 +335,7 @@ if ($id > 0 || ! empty($ref))
|
||||
$productstatic->id=$value['id'];
|
||||
$productstatic->type=$value['type'];
|
||||
$productstatic->label=$value['label'];
|
||||
$productstatic->entity=$value['entity'];
|
||||
|
||||
if ($value['level'] <= 1)
|
||||
{
|
||||
@ -542,6 +544,7 @@ if ($id > 0 || ! empty($ref))
|
||||
$productstatic->ref=$objp->ref;
|
||||
$productstatic->label=$objp->label;
|
||||
$productstatic->type=$objp->type;
|
||||
$productstatic->entity=$objp->entity;
|
||||
|
||||
print '<td>'.$productstatic->getNomUrl(1,'',24).'</td>';
|
||||
$labeltoshow=$objp->label;
|
||||
|
||||
@ -70,8 +70,10 @@ if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$result = $object->fetch($id, $ref);
|
||||
|
||||
if (! empty($conf->product->enabled)) $upload_dir = $conf->product->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
|
||||
elseif (! empty($conf->service->enabled)) $upload_dir = $conf->service->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
|
||||
if (! empty($conf->product->enabled)) $upload_dir = $conf->product->multidir_output[$object->entity].'/';
|
||||
elseif (! empty($conf->service->enabled)) $upload_dir = $conf->service->multidir_output[$object->entity].'/';
|
||||
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) $upload_dir.= get_exdir($object->id,2,0,0,$object,'product').$object->id."/photos";
|
||||
else $upload_dir.= dol_sanitizeFileName($object->ref);
|
||||
}
|
||||
$modulepart='produit';
|
||||
|
||||
|
||||
@ -133,7 +133,7 @@ else
|
||||
// Add what we are searching for
|
||||
if (! empty($sall)) $texte.= " - ".$sall;
|
||||
|
||||
$sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,';
|
||||
$sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,';
|
||||
$sql.= ' p.fk_product_type, p.tms as datem,';
|
||||
$sql.= ' p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,';
|
||||
$sql.= ' MIN(pfp.unitprice) as minsellprice';
|
||||
@ -431,6 +431,7 @@ else
|
||||
$product_static->ref = $objp->ref;
|
||||
$product_static->label = $objp->label;
|
||||
$product_static->type = $objp->fk_product_type;
|
||||
$product_static->entity = $objp->entity;
|
||||
print $product_static->getNomUrl(1,'',24);
|
||||
print "</td>\n";
|
||||
|
||||
|
||||
@ -101,7 +101,7 @@ $htmlother=new FormOther($db);
|
||||
|
||||
$title=$langs->trans("ProductsAndServices");
|
||||
|
||||
$sql = 'SELECT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,';
|
||||
$sql = 'SELECT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,p.entity,';
|
||||
$sql.= ' p.fk_product_type, p.tms as datem,';
|
||||
$sql.= ' p.duration, p.tosell as statut, p.tobuy, p.seuil_stock_alerte, p.desiredstock,';
|
||||
$sql.= ' SUM(s.reel) as stock_physique';
|
||||
@ -307,6 +307,7 @@ if ($resql)
|
||||
$product_static->id=$objp->rowid;
|
||||
$product_static->label = $objp->label;
|
||||
$product_static->type=$objp->fk_product_type;
|
||||
$product_static->entity=$objp->entity;
|
||||
print $product_static->getNomUrl(1,'',16);
|
||||
//if ($objp->stock_theorique < $objp->seuil_stock_alerte) print ' '.img_warning($langs->trans("StockTooLow"));
|
||||
print '</td>';
|
||||
|
||||
@ -104,7 +104,7 @@ $htmlother=new FormOther($db);
|
||||
|
||||
$title=$langs->trans("ProductsAndServices");
|
||||
|
||||
$sql = 'SELECT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,';
|
||||
$sql = 'SELECT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,p.entity,';
|
||||
$sql.= ' p.fk_product_type, p.tms as datem,';
|
||||
$sql.= ' p.duration, p.tosell as statut, p.tobuy, p.seuil_stock_alerte, p.desiredstock,';
|
||||
$sql.= ' s.fk_entrepot,';
|
||||
@ -324,6 +324,7 @@ if ($resql)
|
||||
$product_static->id=$objp->rowid;
|
||||
$product_static->label = $objp->label;
|
||||
$product_static->type=$objp->fk_product_type;
|
||||
$product_static->entity=$objp->entity;
|
||||
print $product_static->getNomUrl(1,'',16);
|
||||
//if ($objp->stock_theorique < $objp->seuil_stock_alerte) print ' '.img_warning($langs->trans("StockTooLow"));
|
||||
print '</td>';
|
||||
|
||||
@ -394,7 +394,7 @@ else
|
||||
$totalunit=0;
|
||||
$totalvalue=$totalvaluesell=0;
|
||||
|
||||
$sql = "SELECT p.rowid as rowid, p.ref, p.label as produit, p.fk_product_type as type, p.pmp as ppmp, p.price, p.price_ttc,";
|
||||
$sql = "SELECT p.rowid as rowid, p.ref, p.label as produit, p.fk_product_type as type, p.pmp as ppmp, p.price, p.price_ttc, p.entity,";
|
||||
$sql.= " ps.pmp, ps.reel as value";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product_stock as ps, ".MAIN_DB_PREFIX."product as p";
|
||||
$sql.= " WHERE ps.fk_product = p.rowid";
|
||||
@ -438,6 +438,7 @@ else
|
||||
$productstatic->ref = $objp->ref;
|
||||
$productstatic->label = $objp->produit;
|
||||
$productstatic->type=$objp->type;
|
||||
$productstatic->entity=$objp->entity;
|
||||
print $productstatic->getNomUrl(1,'stock',16);
|
||||
print '</td>';
|
||||
print '<td>'.$objp->produit.'</td>';
|
||||
|
||||
@ -164,7 +164,7 @@ $form=new Form($db);
|
||||
$formother=new FormOther($db);
|
||||
$formproduct=new FormProduct($db);
|
||||
|
||||
$sql = "SELECT p.rowid, p.ref as product_ref, p.label as produit, p.fk_product_type as type,";
|
||||
$sql = "SELECT p.rowid, p.ref as product_ref, p.label as produit, p.fk_product_type as type, p.entity,";
|
||||
$sql.= " e.label as stock, e.rowid as entrepot_id, e.lieu,";
|
||||
$sql.= " m.rowid as mid, m.value, m.datem, m.fk_user_author, m.label, m.inventorycode, m.fk_origin, m.origintype,";
|
||||
$sql.= " m.batch,m.eatby,m.sellby,";
|
||||
@ -575,6 +575,7 @@ if ($resql)
|
||||
$productstatic->ref=$objp->product_ref;
|
||||
$productstatic->label=$objp->produit;
|
||||
$productstatic->type=$objp->type;
|
||||
$productstatic->entity=$objp->entity;
|
||||
print $productstatic->getNomUrl(1,'',16);
|
||||
print "</td>\n";
|
||||
// Product label
|
||||
|
||||
@ -285,7 +285,7 @@ $sql = $sql_select;
|
||||
$sql.= ' d.description as description,';
|
||||
if ($type_element != 'fichinter' && $type_element != 'contract') $sql.= ' d.label, d.fk_product as product_id, d.fk_product as fk_product, d.info_bits, d.date_start, d.date_end, d.qty, d.qty as prod_qty,';
|
||||
if ($type_element == 'contract') $sql.= ' d.label, d.fk_product as product_id, d.fk_product as fk_product, d.info_bits, d.date_ouverture as date_start, d.date_cloture as date_end, d.qty, d.qty as prod_qty,';
|
||||
if ($type_element != 'fichinter') $sql.= ' p.ref as ref, p.rowid as prod_id, p.rowid as fk_product, p.fk_product_type as prod_type, p.fk_product_type as fk_product_type,';
|
||||
if ($type_element != 'fichinter') $sql.= ' p.ref as ref, p.rowid as prod_id, p.rowid as fk_product, p.fk_product_type as prod_type, p.fk_product_type as fk_product_type, p.entity as pentity,';
|
||||
$sql.= " s.rowid as socid ";
|
||||
if ($type_element != 'fichinter') $sql.= ", p.ref as prod_ref, p.label as product_label";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".$tables_from;
|
||||
@ -402,6 +402,7 @@ if ($sql_select)
|
||||
$product_static->type=$objp->fk_product_type;
|
||||
$product_static->id=$objp->fk_product;
|
||||
$product_static->ref=$objp->ref;
|
||||
$product_static->entity=$objp->pentity;
|
||||
$text=$product_static->getNomUrl(1);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user