|
@@ -601,6 +601,12 @@ if (!empty($search_categ_cus) && $search_categ_cus != '-1') {
|
|
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ
|
|
|
}
|
|
|
|
|
|
+// Added by MMI Mathieu Moulin iProspective
|
|
|
+// Add fields from hooks
|
|
|
+$parameters = array();
|
|
|
+$reshook = $hookmanager->executeHooks('printFieldListJoinSoc', $parameters); // Note that $action and $object may have been modified by hook
|
|
|
+$sql .= $hookmanager->resPrint;
|
|
|
+
|
|
|
$sql .= ', '.MAIN_DB_PREFIX.'facture as f';
|
|
|
if ($sortfield == "f.datef") {
|
|
|
$sql .= $db->hintindex('idx_facture_datef');
|
|
@@ -627,6 +633,14 @@ if (!empty($search_fac_rec_source_title)) {
|
|
|
}
|
|
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = f.fk_projet";
|
|
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user AS u ON f.fk_user_author = u.rowid';
|
|
|
+
|
|
|
+// Added by MMI Mathieu Moulin iProspective
|
|
|
+// Add fields from hooks
|
|
|
+$parameters = array();
|
|
|
+$reshook = $hookmanager->executeHooks('printFieldListJoinInvoice', $parameters); // Note that $action and $object may have been modified by hook
|
|
|
+$sql .= $hookmanager->resPrint;
|
|
|
+//echo ($sql); die();
|
|
|
+
|
|
|
// We'll need this table joined to the select in order to filter by sale
|
|
|
if ($search_sale > 0 || (empty($user->rights->societe->client->voir) && !$socid)) {
|
|
|
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|