fix pb with multicompny payment dictionnary on faxcture card
This commit is contained in:
parent
c50a3c4a78
commit
02af7ca25e
@ -1685,7 +1685,7 @@ class Commande extends CommonOrder
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as cr ON c.fk_cond_reglement = cr.rowid';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON c.fk_mode_reglement = p.id';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_availability as ca ON c.fk_availability = ca.rowid';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_input_reason as dr ON c.fk_input_reason = ca.rowid';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_input_reason as dr ON c.fk_input_reason = dr.rowid';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid';
|
||||
|
||||
if ($id) $sql.= " WHERE c.rowid=".$id;
|
||||
|
||||
@ -4251,7 +4251,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank as b ON p.fk_bank = b.rowid';
|
||||
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank_account as ba ON b.fk_account = ba.rowid';
|
||||
$sql .= ' WHERE pf.fk_facture = ' . $object->id . ' AND pf.fk_paiement = p.rowid';
|
||||
$sql .= ' AND p.entity IN (' . getEntity('invoice').')';
|
||||
$sql .= ' AND p.entity IN (' . getEntity('invoice').') AND c.entity IN (' . getEntity('invoice').')';
|
||||
$sql .= ' ORDER BY p.datep, p.tms';
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
||||
@ -102,8 +102,7 @@ class Form
|
||||
* @param string $paramid Key of parameter for id ('id', 'socid')
|
||||
* @return string HTML edit field
|
||||
*/
|
||||
public function editfieldkey($text, $htmlname, $preselected, $object, $perm, $typeofdata = 'string', $moreparam = '', $fieldrequired = 0, $notabletag = 0, $paramid = 'id')
|
||||
{
|
||||
public function editfieldkey($text, $htmlname, $preselected, $object, $perm, $typeofdata = 'string', $moreparam = '', $fieldrequired = 0, $notabletag = 0, $paramid = 'id') {
|
||||
global $conf,$langs;
|
||||
|
||||
$ret='';
|
||||
@ -144,7 +143,7 @@ class Form
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Output value of a field for an editable field
|
||||
|
||||
@ -1229,12 +1229,18 @@ class Project extends CommonObject
|
||||
else dol_print_error($this->db);
|
||||
if (count($listofprojectcontacttype) == 0) $listofprojectcontacttype[0]='0'; // To avoid syntax error if not found
|
||||
|
||||
|
||||
if (!empty($user->contactid)) {
|
||||
$userid=$user->contactid;
|
||||
} else {
|
||||
$userid=$user->id;
|
||||
}
|
||||
if ($mode == 0)
|
||||
{
|
||||
$sql.= " AND ec.element_id = p.rowid";
|
||||
$sql.= " AND ( p.public = 1";
|
||||
$sql.= " OR ( ec.fk_c_type_contact IN (".join(',', array_keys($listofprojectcontacttype)).")";
|
||||
$sql.= " AND ec.fk_socpeople = ".$user->id.")";
|
||||
$sql.= " AND ec.fk_socpeople = ".$userid.")";
|
||||
$sql.= " )";
|
||||
}
|
||||
if ($mode == 1)
|
||||
@ -1242,7 +1248,7 @@ class Project extends CommonObject
|
||||
$sql.= " AND ec.element_id = p.rowid";
|
||||
$sql.= " AND (";
|
||||
$sql.= " ( ec.fk_c_type_contact IN (".join(',', array_keys($listofprojectcontacttype)).")";
|
||||
$sql.= " AND ec.fk_socpeople = ".$user->id.")";
|
||||
$sql.= " AND ec.fk_socpeople = ".$userid.")";
|
||||
$sql.= " )";
|
||||
}
|
||||
if ($mode == 2)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user