Example #1
0
// Security check
if ($user->societe_id > 0) {
    $action = '';
    $socid = $user->societe_id;
}
$nowyear = strftime("%Y", dol_now());
$year = GETPOST('year') > 0 ? GETPOST('year') : $nowyear;
//$startyear=$year-2;
$startyear = $year - 1;
$endyear = $year;
$mode = GETPOST('mode');
/*
 * View
 */
$form = new Form($db);
$formpropal = new FormPropal($db);
$langs->load('propal');
$langs->load('other');
llxHeader('', $langs->trans("ProposalsStatistics"));
print load_fiche_titre($langs->trans("ProposalsStatistics"), '', 'title_commercial.png');
$dir = $conf->propal->dir_temp;
dol_mkdir($dir);
$stats = new PropaleStats($db, $socid, $userid > 0 ? $userid : 0);
if ($object_statut != '' && $object_statut >= 0) {
    $stats->where .= ' AND p.fk_statut IN (' . $object_statut . ')';
}
// Build graphic number of object
$data = $stats->getNbByMonthWithPrevYear($endyear, $startyear);
// $data = array(array('Lib',val1,val2,val3),...)
if (!$user->rights->societe->client->voir || $user->societe_id) {
    $filenamenb = $dir . '/proposalsnbinyear-' . $user->id . '-' . $year . '.png';
Example #2
0
 * Actions
 */
$parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
// Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
    setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
/*
 * View
 */
llxHeader('', $langs->trans('Proposal'), 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos');
$form = new Form($db);
$formother = new FormOther($db);
$formfile = new FormFile($db);
$formpropal = new FormPropal($db);
$companystatic = new Societe($db);
$now = dol_now();
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOST("page", 'int');
if ($page == -1) {
    $page = 0;
}
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortfield) {
    $sortfield = 'p.datep';
}
if (!$sortorder) {
Example #3
0
    $search_sale = '';
    $search_ref = '';
    $search_refcustomer = '';
    $search_societe = '';
    $search_montant_ht = '';
    $year = '';
    $month = '';
}
/*
 * View
 */
llxHeader('', $langs->trans('Proposal'), 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos');
$form = new Form($db);
$formother = new FormOther($db);
$formfile = new FormFile($db);
$formpropal = new FormPropal($db);
$companystatic = new Societe($db);
$now = dol_now();
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOST("page", 'int');
if ($page == -1) {
    $page = 0;
}
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
$viewstatut = $db->escape(GETPOST('viewstatut'));
$object_statut = $db->escape(GETPOST('propal_statut'));
if ($object_statut != '') {
    $viewstatut = $object_statut;