84 |
|
|
85 |
print '<table border="0" width="100%" class="notopnoleftnoright">'; |
print '<table border="0" width="100%" class="notopnoleftnoright">'; |
86 |
|
|
|
print '<tr><td valign="top" width="100%" class="notopnoleft">'; |
|
|
|
|
|
/* |
|
|
* Actions commerciales a faire |
|
|
* |
|
|
*/ |
|
|
|
|
|
$sql = "SELECT a.id, a.label, ".$db->pdate("a.datea")." as da, c.code, c.libelle, a.fk_user_author, s.nom as sname, s.idp"; |
|
|
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."societe as s"; |
|
|
$sql .= " WHERE c.id=a.fk_action AND a.percent < 100 AND s.idp = a.fk_soc"; |
|
|
if ($socidp) |
|
|
{ |
|
|
$sql .= " AND s.idp = $socidp"; |
|
|
} |
|
|
$sql .= " ORDER BY a.datea ASC"; |
|
|
|
|
|
$resql=$db->query($sql); |
|
|
if ($resql) |
|
|
{ |
|
|
$num = $db->num_rows($resql); |
|
|
if ($num > 0) |
|
|
{ |
|
|
print '<table class="noborder" width="100%">'; |
|
|
print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("ActionsToDo").'</td></tr>'; |
|
|
$var = true; |
|
|
$i = 0; |
|
|
|
|
|
while ($i < $num) |
|
|
{ |
|
|
$obj = $db->fetch_object($resql); |
|
|
$var=!$var; |
|
|
|
|
|
print "<tr $bc[$var]>"; |
|
|
print "<td><a href=\"action/fiche.php?id=$obj->id\">".img_object($langs->trans("ShowTask"),"task"); |
|
|
$transcode=$langs->trans("Action".$obj->code); |
|
|
$libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle); |
|
|
print $libelle; |
|
|
print '</a></td>'; |
|
|
print "<td>".$obj->label."</td>"; |
|
|
print '<td>'. dolibarr_print_date($obj->da); |
|
|
if (date("U",$obj->da) < time()) |
|
|
{ |
|
|
print img_warning("Late"); |
|
|
} |
|
|
print "</td>"; |
|
|
|
|
|
print '<td><a href="fiche.php?socid='.$obj->idp.'">'.img_object($langs->trans("ShowCustomer"),"company").' '.$obj->sname.'</a></td>'; |
|
|
$i++; |
|
|
} |
|
|
// TODO Ajouter rappel pour "il y a des contrats à mettre en service" |
|
|
// TODO Ajouter rappel pour "il y a des contrats qui arrivent à expiration" |
|
|
print "</table><br>"; |
|
|
} |
|
|
$db->free($resql); |
|
|
} |
|
|
else |
|
|
{ |
|
|
dolibarr_print_error($db); |
|
|
} |
|
|
|
|
|
print '</td></tr></table>'; |
|
|
print '<table border="0" width="100%" class="notopnoleftnoright">'; |
|
|
|
|
87 |
print '<tr><td valign="top" width="30%" class="notopnoleft">'; |
print '<tr><td valign="top" width="30%" class="notopnoleft">'; |
88 |
|
|
89 |
|
|
90 |
/* |
/* |
91 |
* Recherche Propal |
* Recherche Propal |
262 |
|
|
263 |
|
|
264 |
/* |
/* |
265 |
|
* Actions commerciales a faire |
266 |
|
* |
267 |
|
*/ |
268 |
|
|
269 |
|
$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.code, c.libelle, a.fk_user_author, s.nom as sname, s.idp"; |
270 |
|
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."societe as s"; |
271 |
|
$sql .= " WHERE c.id=a.fk_action AND a.percent < 100 AND s.idp = a.fk_soc"; |
272 |
|
if ($socidp) |
273 |
|
{ |
274 |
|
$sql .= " AND s.idp = $socidp"; |
275 |
|
} |
276 |
|
$sql .= " ORDER BY a.datea ASC"; |
277 |
|
|
278 |
|
$resql=$db->query($sql); |
279 |
|
if ($resql) |
280 |
|
{ |
281 |
|
$num = $db->num_rows($resql); |
282 |
|
if ($num > 0) |
283 |
|
{ |
284 |
|
print '<table class="noborder" width="100%">'; |
285 |
|
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("ActionsToDo").'</td></tr>'; |
286 |
|
$var = true; |
287 |
|
$i = 0; |
288 |
|
|
289 |
|
while ($i < $num) |
290 |
|
{ |
291 |
|
$obj = $db->fetch_object($resql); |
292 |
|
$var=!$var; |
293 |
|
|
294 |
|
print "<tr $bc[$var]>"; |
295 |
|
print "<td><a href=\"action/fiche.php?id=$obj->id\">".img_object($langs->trans("ShowTask"),"task"); |
296 |
|
$transcode=$langs->trans("Action".$obj->code); |
297 |
|
$libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle); |
298 |
|
print $libelle; |
299 |
|
print '</a></td>'; |
300 |
|
|
301 |
|
print '<td>'. dolibarr_print_date($obj->da); |
302 |
|
if (date("U",$obj->da) < time()) |
303 |
|
{ |
304 |
|
print img_warning("Late"); |
305 |
|
} |
306 |
|
print "</td>"; |
307 |
|
|
308 |
|
print '<td><a href="fiche.php?socid='.$obj->idp.'">'.img_object($langs->trans("ShowCustomer"),"company").' '.$obj->sname.'</a></td>'; |
309 |
|
$i++; |
310 |
|
} |
311 |
|
// TODO Ajouter rappel pour "il y a des contrats à mettre en service" |
312 |
|
// TODO Ajouter rappel pour "il y a des contrats qui arrivent à expiration" |
313 |
|
print "</table><br>"; |
314 |
|
} |
315 |
|
$db->free($resql); |
316 |
|
} |
317 |
|
else |
318 |
|
{ |
319 |
|
dolibarr_print_error($db); |
320 |
|
} |
321 |
|
|
322 |
|
|
323 |
|
/* |
324 |
* Derniers clients enregistrés |
* Derniers clients enregistrés |
325 |
*/ |
*/ |
326 |
if ($user->rights->societe->lire) |
if ($user->rights->societe->lire) |
367 |
} |
} |
368 |
} |
} |
369 |
|
|
370 |
|
|
371 |
/* |
/* |
372 |
* Dernières actions commerciales effectuées |
* Dernières actions commerciales effectuées |
373 |
*/ |
*/ |
419 |
dolibarr_print_error($db); |
dolibarr_print_error($db); |
420 |
} |
} |
421 |
|
|
422 |
|
|
423 |
/* |
/* |
424 |
* Derniers contrat |
* Derniers contrat |
425 |
* |
* |