Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1
This commit is contained in:
commit
92858a7b47
@ -1645,7 +1645,7 @@ abstract class CommonObject
|
||||
|
||||
$sourceid = (! empty($sourceid) ? $sourceid : $this->id);
|
||||
$targetid = (! empty($targetid) ? $targetid : $this->id);
|
||||
$sourcetype = (! empty($sourcetype) ? $sourcetype : (! empty($this->origin) ? $this->origin : $this->element));
|
||||
$sourcetype = (! empty($sourcetype) ? $sourcetype : $this->element);
|
||||
$targettype = (! empty($targettype) ? $targettype : $this->element);
|
||||
|
||||
// Links beetween objects are stored in this table
|
||||
|
||||
@ -45,12 +45,17 @@ function shipping_prepare_head($object)
|
||||
$head[$h][2] = 'shipping';
|
||||
$h++;
|
||||
|
||||
if ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->lire && ! empty($object->linkedObjectsIds['delivery'][0]))
|
||||
if ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->lire)
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/livraison/fiche.php?id=".$object->linkedObjectsIds['delivery'][0];
|
||||
$head[$h][1] = $langs->trans("DeliveryCard");
|
||||
$head[$h][2] = 'delivery';
|
||||
$h++;
|
||||
// delivery link
|
||||
$object->fetchObjectLinked($object->id,$object->element);
|
||||
if (! empty($object->linkedObjectsIds['delivery'][0]))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/livraison/fiche.php?id=".$object->linkedObjectsIds['delivery'][0];
|
||||
$head[$h][1] = $langs->trans("DeliveryCard");
|
||||
$head[$h][2] = 'delivery';
|
||||
$h++;
|
||||
}
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->id;
|
||||
|
||||
@ -867,9 +867,6 @@ else
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($object->socid);
|
||||
|
||||
// delivery link
|
||||
$object->fetchObjectLinked($object->id,$object->element,-1,-1);
|
||||
|
||||
$head=shipping_prepare_head($object);
|
||||
dol_fiche_head($head, 'shipping', $langs->trans("Sending"), 0, 'sending');
|
||||
|
||||
|
||||
@ -226,8 +226,8 @@ $sql = "SELECT e.rowid, e.ref";
|
||||
$sql.= ", s.nom, s.rowid as socid";
|
||||
$sql.= ", c.ref as commande_ref, c.rowid as commande_id";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."expedition as e";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target AND el.sourcetype IN ('commande')";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON el.fk_source = c.rowid AND el.targettype IN ('shipping')";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target AND el.targettype = 'shipping' AND el.sourcetype IN ('commande')";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON el.fk_source = c.rowid AND el.sourcetype IN ('commande') AND el.targettype = 'shipping'";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON e.fk_soc = sc.fk_soc";
|
||||
$sql.= " WHERE e.entity = ".$conf->entity;
|
||||
|
||||
@ -549,7 +549,7 @@ class Livraison extends CommonObject
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||
$this->db->begin();
|
||||
|
||||
|
||||
$error=0;
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."livraisondet";
|
||||
@ -559,7 +559,7 @@ class Livraison extends CommonObject
|
||||
// Delete linked object
|
||||
$res = $this->deleteObjectLinked();
|
||||
if ($res < 0) $error++;
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."livraison";
|
||||
@ -804,7 +804,7 @@ class Livraison extends CommonObject
|
||||
global $langs;
|
||||
|
||||
// Get the linked object
|
||||
$this->fetchObjectLinked(-1,-1,$this->id,$this->element);
|
||||
$this->fetchObjectLinked('','',$this->id,$this->element);
|
||||
//var_dump($this->linkedObjectIds);
|
||||
// Get the product ref and qty in source
|
||||
$sqlSourceLine = "SELECT st.rowid, st.description, st.qty";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user