Merge remote-tracking branch 'Dolibarr/13.0' into 13
This commit is contained in:
commit
3585eaaacd
@ -1737,7 +1737,7 @@ class Contact extends CommonObject
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_contacts WHERE fk_socpeople=".$this->id." AND entity IN (".getEntity("societe_contact").")";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_contacts WHERE fk_socpeople=".((int) $this->id)." AND entity IN (".getEntity("societe_contact").")";
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
|
|||||||
@ -437,8 +437,8 @@ class Conf
|
|||||||
$this->service->dir_temp = $rootfortemp."/produit/temp";
|
$this->service->dir_temp = $rootfortemp."/produit/temp";
|
||||||
|
|
||||||
// Module productbatch
|
// Module productbatch
|
||||||
$this->productbatch->multidir_output = array($this->entity => $rootfordata."/produitlot");
|
$this->productbatch->multidir_output = array($this->entity => $rootfordata."/productlot");
|
||||||
$this->productbatch->multidir_temp = array($this->entity => $rootfortemp."/produitlot/temp");
|
$this->productbatch->multidir_temp = array($this->entity => $rootfortemp."/productlot/temp");
|
||||||
|
|
||||||
// Module contrat
|
// Module contrat
|
||||||
$this->contrat->multidir_output = array($this->entity => $rootfordata."/contract");
|
$this->contrat->multidir_output = array($this->entity => $rootfordata."/contract");
|
||||||
|
|||||||
@ -455,7 +455,7 @@ class FormMail extends Form
|
|||||||
// Zone to select email template
|
// Zone to select email template
|
||||||
if (count($modelmail_array) > 0)
|
if (count($modelmail_array) > 0)
|
||||||
{
|
{
|
||||||
$model_mail_selected_id = GETPOSTISSET('modelmailselected') ? GETPOST('modelmailselected', 'int') : $arraydefaultmessage->id;
|
$model_mail_selected_id = GETPOSTISSET('modelmailselected') ? GETPOST('modelmailselected', 'int') : ($arraydefaultmessage->id > 0 ? $arraydefaultmessage->id : 0);
|
||||||
|
|
||||||
// If list of template is filled
|
// If list of template is filled
|
||||||
$out .= '<div class="center" style="padding: 0px 0 12px 0">'."\n";
|
$out .= '<div class="center" style="padding: 0px 0 12px 0">'."\n";
|
||||||
|
|||||||
@ -365,7 +365,7 @@ function show_stats_for_company($product, $socid)
|
|||||||
if ($ret < 0) dol_print_error($db);
|
if ($ret < 0) dol_print_error($db);
|
||||||
$langs->load("propal");
|
$langs->load("propal");
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<a href="propal.php?id='.$product->id.'">'.img_object('', 'propal').' '.$langs->trans("Proposals").'</a>';
|
print '<a href="propal.php?id='.$product->id.'">'.img_object('', 'propal', 'class="paddingright"').$langs->trans("Proposals").'</a>';
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
print $product->stats_propale['customers'];
|
print $product->stats_propale['customers'];
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
@ -381,9 +381,9 @@ function show_stats_for_company($product, $socid)
|
|||||||
$nblines++;
|
$nblines++;
|
||||||
$ret = $product->load_stats_proposal_supplier($socid);
|
$ret = $product->load_stats_proposal_supplier($socid);
|
||||||
if ($ret < 0) dol_print_error($db);
|
if ($ret < 0) dol_print_error($db);
|
||||||
$langs->load("propal");
|
$langs->load("supplier_proposal");
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<a href="supplier_proposal.php?id='.$product->id.'">'.img_object('', 'supplier_proposal').' '.$langs->trans("SupplierProposals").'</a>';
|
print '<a href="supplier_proposal.php?id='.$product->id.'">'.img_object('', 'supplier_proposal', 'class="paddingright"').$langs->trans("SupplierProposals").'</a>';
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
print $product->stats_proposal_supplier['suppliers'];
|
print $product->stats_proposal_supplier['suppliers'];
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
@ -401,7 +401,7 @@ function show_stats_for_company($product, $socid)
|
|||||||
if ($ret < 0) dol_print_error($db);
|
if ($ret < 0) dol_print_error($db);
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<a href="commande.php?id='.$product->id.'">'.img_object('', 'order').' '.$langs->trans("CustomersOrders").'</a>';
|
print '<a href="commande.php?id='.$product->id.'">'.img_object('', 'order', 'class="paddingright"').$langs->trans("CustomersOrders").'</a>';
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
print $product->stats_commande['customers'];
|
print $product->stats_commande['customers'];
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
@ -419,7 +419,7 @@ function show_stats_for_company($product, $socid)
|
|||||||
if ($ret < 0) dol_print_error($db);
|
if ($ret < 0) dol_print_error($db);
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<a href="commande_fournisseur.php?id='.$product->id.'">'.img_object('', 'supplier_order').' '.$langs->trans("SuppliersOrders").'</a>';
|
print '<a href="commande_fournisseur.php?id='.$product->id.'">'.img_object('', 'supplier_order', 'class="paddingright"').$langs->trans("SuppliersOrders").'</a>';
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
print $product->stats_commande_fournisseur['suppliers'];
|
print $product->stats_commande_fournisseur['suppliers'];
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
@ -455,7 +455,7 @@ function show_stats_for_company($product, $socid)
|
|||||||
if ($ret < 0) dol_print_error($db);
|
if ($ret < 0) dol_print_error($db);
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<a href="facture_fournisseur.php?id='.$product->id.'">'.img_object('', 'supplier_invoice').' '.$langs->trans("SuppliersInvoices").'</a>';
|
print '<a href="facture_fournisseur.php?id='.$product->id.'">'.img_object('', 'supplier_invoice', 'class="paddingright"').$langs->trans("SuppliersInvoices").'</a>';
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
print $product->stats_facture_fournisseur['suppliers'];
|
print $product->stats_facture_fournisseur['suppliers'];
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
@ -474,7 +474,7 @@ function show_stats_for_company($product, $socid)
|
|||||||
if ($ret < 0) dol_print_error($db);
|
if ($ret < 0) dol_print_error($db);
|
||||||
$langs->load("contracts");
|
$langs->load("contracts");
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<a href="contrat.php?id='.$product->id.'">'.img_object('', 'contract').' '.$langs->trans("Contracts").'</a>';
|
print '<a href="contrat.php?id='.$product->id.'">'.img_object('', 'contract', 'class="paddingright"').$langs->trans("Contracts").'</a>';
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
print $product->stats_contrat['customers'];
|
print $product->stats_contrat['customers'];
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
@ -496,15 +496,15 @@ function show_stats_for_company($product, $socid)
|
|||||||
$langs->load("mrp");
|
$langs->load("mrp");
|
||||||
|
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<a href="bom.php?id='.$product->id.'">'.img_object('', 'mrp').' '.$langs->trans("BOM").'</a>';
|
print '<a href="bom.php?id='.$product->id.'">'.img_object('', 'bom', 'class="paddingright"').$langs->trans("BOM").'</a>';
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
|
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
print $form->textwithpicto($product->stats_bom['nb_toproduce'], $langs->trans("QtyToProduce"));
|
print $form->textwithpicto($product->stats_bom['nb_toconsume'], $langs->trans("RowMaterial"));
|
||||||
print $form->textwithpicto($product->stats_bom['nb_toconsume'], $langs->trans("ToConsume"));
|
print $form->textwithpicto($product->stats_bom['nb_toproduce'], $langs->trans("Finished"));
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
print $form->textwithpicto($product->stats_bom['qty_toproduce'], $langs->trans("QtyToProduce"));
|
print $form->textwithpicto($product->stats_bom['qty_toconsume'], $langs->trans("RowMaterial"));
|
||||||
print $form->textwithpicto($product->stats_bom['qty_toconsume'], $langs->trans("ToConsume"));
|
print $form->textwithpicto($product->stats_bom['qty_toproduce'], $langs->trans("Finished"));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
@ -519,7 +519,7 @@ function show_stats_for_company($product, $socid)
|
|||||||
}
|
}
|
||||||
$langs->load("mrp");
|
$langs->load("mrp");
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<a href="mo.php?id='.$product->id.'">'.img_object('', 'mrp').' '.$langs->trans("MO").'</a>';
|
print '<a href="mo.php?id='.$product->id.'">'.img_object('', 'mrp', 'class="paddingright"').$langs->trans("MO").'</a>';
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
print $form->textwithpicto($product->stats_mo['customers_toconsume'], $langs->trans("ToConsume"));
|
print $form->textwithpicto($product->stats_mo['customers_toconsume'], $langs->trans("ToConsume"));
|
||||||
print $form->textwithpicto($product->stats_mo['customers_consumed'], $langs->trans("QtyAlreadyConsumed"));
|
print $form->textwithpicto($product->stats_mo['customers_consumed'], $langs->trans("QtyAlreadyConsumed"));
|
||||||
|
|||||||
@ -2464,7 +2464,7 @@ class Product extends CommonObject
|
|||||||
$this->stats_bom['qty_toconsume'] = 0;
|
$this->stats_bom['qty_toconsume'] = 0;
|
||||||
|
|
||||||
$sql = "SELECT COUNT(DISTINCT b.rowid) as nb_toproduce,";
|
$sql = "SELECT COUNT(DISTINCT b.rowid) as nb_toproduce,";
|
||||||
$sql .= " b.qty as qty_toproduce";
|
$sql .= " SUM(b.qty) as qty_toproduce";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."bom_bom as b";
|
$sql .= " FROM ".MAIN_DB_PREFIX."bom_bom as b";
|
||||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."bom_bomline as bl ON bl.fk_bom=b.rowid";
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."bom_bomline as bl ON bl.fk_bom=b.rowid";
|
||||||
$sql .= " WHERE ";
|
$sql .= " WHERE ";
|
||||||
|
|||||||
@ -244,8 +244,8 @@ if ($id > 0 || !empty($ref))
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", "&id=".$product->id, '', $sortfield, $sortorder);
|
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", "&id=".$product->id, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "b.date_valid", "", "&id=".$product->id, 'align="center"', $sortfield, $sortorder);
|
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "b.date_valid", "", "&id=".$product->id, 'align="center"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("ToConsume", $_SERVER["PHP_SELF"], "", "", "&id=".$product->id, '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre("RowMaterial", $_SERVER["PHP_SELF"], "", "", "&id=".$product->id, '', $sortfield, $sortorder, 'center ');
|
||||||
print_liste_field_titre("QtyToProduce", $_SERVER["PHP_SELF"], "", "", "&id=".$product->id, '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre("Finished", $_SERVER["PHP_SELF"], "", "", "&id=".$product->id, '', $sortfield, $sortorder, 'center ');
|
||||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "b.status", "", "&id=".$product->id, '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "b.status", "", "&id=".$product->id, '', $sortfield, $sortorder, 'center ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
|||||||
@ -397,7 +397,7 @@ if (empty($action))
|
|||||||
print '<a name="builddoc"></a>'; // ancre
|
print '<a name="builddoc"></a>'; // ancre
|
||||||
|
|
||||||
// Documents
|
// Documents
|
||||||
$filedir = $conf->productbatch->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product_batch').dol_sanitizeFileName($object->ref);
|
$filedir = $conf->productbatch->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product_batch');
|
||||||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
|
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||||
$genallowed = $usercanread;
|
$genallowed = $usercanread;
|
||||||
$delallowed = $usercancreate;
|
$delallowed = $usercancreate;
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/product/stock/productlot_document.php
|
* \file htdocs/product/stock/productlot_document.php
|
||||||
* \ingroup product
|
* \ingroup product
|
||||||
* \brief Page des documents joints sur les lots produits
|
* \brief Page of attached documents for porudct lots
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
@ -79,7 +79,7 @@ if ($id || $ref)
|
|||||||
$object->fetch($id, $productid, $batch);
|
$object->fetch($id, $productid, $batch);
|
||||||
$object->ref = $object->batch; // For document management ( it use $object->ref)
|
$object->ref = $object->batch; // For document management ( it use $object->ref)
|
||||||
|
|
||||||
if (!empty($conf->productbatch->enabled)) $upload_dir = $conf->productbatch->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, $modulepart).dol_sanitizeFileName($object->ref);
|
if (!empty($conf->productbatch->enabled)) $upload_dir = $conf->productbatch->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, $modulepart);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -352,7 +352,7 @@ foreach ($search as $key => $val)
|
|||||||
if (count($newarrayofstatus)) $sql .= natural_search($key, join(',', $newarrayofstatus), 2);
|
if (count($newarrayofstatus)) $sql .= natural_search($key, join(',', $newarrayofstatus), 2);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ($key == 'fk_user_assign' || $key == 'fk_user_create')
|
if ($key == 'fk_user_assign' || $key == 'fk_user_create' || $key == 'fk_project')
|
||||||
{
|
{
|
||||||
if ($search[$key] > 0) $sql .= natural_search($key, $search[$key], 2);
|
if ($search[$key] > 0) $sql .= natural_search($key, $search[$key], 2);
|
||||||
continue;
|
continue;
|
||||||
@ -362,7 +362,7 @@ foreach ($search as $key => $val)
|
|||||||
}
|
}
|
||||||
if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
|
if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
|
||||||
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
|
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
|
||||||
if ($search_fk_project) $sql .= natural_search('fk_project', $search_fk_project, 2);
|
//if ($search_fk_project) $sql .= natural_search('fk_project', $search_fk_project, 2);
|
||||||
if ($search_date_start) $sql .= " AND t.datec >= '".$db->idate($search_date_start)."'";
|
if ($search_date_start) $sql .= " AND t.datec >= '".$db->idate($search_date_start)."'";
|
||||||
if ($search_date_end) $sql .= " AND t.datec <= '".$db->idate($search_date_end)."'";
|
if ($search_date_end) $sql .= " AND t.datec <= '".$db->idate($search_date_end)."'";
|
||||||
if ($search_dateread_start) $sql .= " AND t.date_read >= '".$db->idate($search_dateread_start)."'";
|
if ($search_dateread_start) $sql .= " AND t.date_read >= '".$db->idate($search_dateread_start)."'";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user