Clean and prepare code to fix a SQL injection
This commit is contained in:
parent
bb86428663
commit
22e897b1a1
@ -151,8 +151,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Member").'</td><td>';
|
||||
$filter='s.client in (1,2,3)';
|
||||
print $form->select_company($id,'memberid',$filter,1);
|
||||
print $form->select_company($id,'memberid','',1);
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("User").'</td><td>';
|
||||
print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
|
||||
@ -121,7 +121,7 @@ print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven"><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
|
||||
print '<td colspan="2">';
|
||||
print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY, 'socid', 's.client in (1,3) AND s.status = 1', 1, 0, 0, array(), 0);
|
||||
print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY, 'socid', '(s.client in (1,3) AND s.status = 1)', 1, 0, 0, array(), 0);
|
||||
print '</td></tr>';
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
|
||||
@ -134,7 +134,7 @@ print '<td>';
|
||||
$disabled=0;
|
||||
$langs->load("companies");
|
||||
if (! empty($conf->global->CASHDESK_ID_THIRDPARTY)) $disabled=1; // If a particular third party is defined, we disable choice
|
||||
print $form->select_company(GETPOST('socid', 'int')?GETPOST('socid', 'int'):$conf->global->CASHDESK_ID_THIRDPARTY, 'socid', 's.client in (1,3) AND s.status = 1', !$disabled, $disabled, 1);
|
||||
print $form->select_company(GETPOST('socid', 'int')?GETPOST('socid', 'int'):$conf->global->CASHDESK_ID_THIRDPARTY, 'socid', '(s.client IN (1,3) AND s.status = 1)', !$disabled, $disabled, 1);
|
||||
//print '<input name="warehouse_id" class="texte_login" type="warehouse_id" value="" />';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -78,7 +78,7 @@ print '<li class="menu_choix0">'.$langs->trans("User").': '.$_SESSION['firstname
|
||||
print ' <a href="deconnexion.php">'.img_picto($langs->trans('Logout'), 'logout.png').'</a><br>';
|
||||
print '<form id="frmThirdparty" class="formulaire1 inline-block" method="post" action="facturation_verif.php?action=change_thirdparty">';
|
||||
print $langs->trans("CashDeskThirdParty").': ';
|
||||
print $form->select_company($_SESSION["CASHDESK_ID_THIRDPARTY"], 'CASHDESK_ID_THIRDPARTY', 's.client IN (1,3) AND s.status = 1', '', 0, 0, null, 0, 'valignmiddle inline-block');
|
||||
print $form->select_company($_SESSION["CASHDESK_ID_THIRDPARTY"], 'CASHDESK_ID_THIRDPARTY', '(s.client IN (1,3) AND s.status = 1)', '', 0, 0, null, 0, 'valignmiddle inline-block');
|
||||
print '<input class="button bouton_change_thirdparty inline-block valignmiddle" type="submit" id="bouton_change_thirdparty" value="'.$langs->trans("Modify").'">';
|
||||
//print $companyLink;
|
||||
print '<br>';
|
||||
|
||||
@ -252,7 +252,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
// Company
|
||||
print '<tr><td class="left">'.$langs->trans("ThirdParty").'</td><td class="left">';
|
||||
$filter='s.client in (1,2,3)';
|
||||
$filter='s.client IN (1,2,3)';
|
||||
print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"');
|
||||
print '</td></tr>';
|
||||
// User
|
||||
|
||||
@ -264,7 +264,7 @@ print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
// Company
|
||||
print '<tr><td class="left">'.$langs->trans("ThirdParty").'</td><td class="left">';
|
||||
if ($mode == 'customer') $filter='s.client in (1,2,3)';
|
||||
if ($mode == 'customer') $filter='s.client IN (1,2,3)';
|
||||
if ($mode == 'supplier') $filter='s.fournisseur = 1';
|
||||
print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"');
|
||||
print '</td></tr>';
|
||||
|
||||
@ -2736,7 +2736,7 @@ if ($action == 'create')
|
||||
else
|
||||
{
|
||||
print '<td colspan="2">';
|
||||
print $form->select_company($soc->id, 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300');
|
||||
print $form->select_company($soc->id, 'socid', '((s.client = 1 OR s.client = 3) AND s.status=1)', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300');
|
||||
// Option to reload page to retrieve customer informations. Note, this clear other input
|
||||
if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE))
|
||||
{
|
||||
|
||||
@ -1046,7 +1046,7 @@ class Form
|
||||
*
|
||||
* @param string $selected Preselected type
|
||||
* @param string $htmlname Name of field in form
|
||||
* @param string $filter optional filters criteras (example: 's.rowid <> x', 's.client IN (1,3)')
|
||||
* @param string $filter Optional filters criteras. WARNING: To avoid SQL injection, only few chars [.a-z0-9 =<>] are allowed here (example: 's.rowid <> x', 's.client IN (1,3)')
|
||||
* @param string $showempty Add an empty field (Can be '1' or text key to use on empty line like 'SelectThirdParty')
|
||||
* @param int $showtype Show third party type in combolist (customer, prospect or supplier)
|
||||
* @param int $forcecombo Force to load all values and output a standard combobox (with no beautification)
|
||||
@ -1080,7 +1080,7 @@ class Form
|
||||
unset($societetmp);
|
||||
}
|
||||
// mode 1
|
||||
$urloption='htmlname='.$htmlname.'&outjson=1&filter='.$filter.($showtype?'&showtype='.$showtype:'');
|
||||
$urloption='htmlname='.urlencode($htmlname).'&outjson=1&filter='.urlencode($filter).($showtype?'&showtype='.urlencode($showtype):'');
|
||||
$out.= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
|
||||
$out.='<style type="text/css">.ui-autocomplete { z-index: 250; }</style>';
|
||||
if (empty($hidelabel)) print $langs->trans("RefOrLabel").' : ';
|
||||
@ -1138,7 +1138,7 @@ class Form
|
||||
|
||||
// Clean $filter that may contains sql conditions so sql code
|
||||
if (function_exists('testSqlAndScriptInject')) {
|
||||
if (testSqlAndScriptInject($filter, 3)>0) {
|
||||
if (testSqlAndScriptInject($filter, 3) > 0) {
|
||||
$filter ='';
|
||||
}
|
||||
}
|
||||
@ -5704,7 +5704,6 @@ class Form
|
||||
{
|
||||
$objectdesc=$classname.':'.$classpath;
|
||||
$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
|
||||
//if ($objecttmp->element == 'societe') $urlforajaxcall = DOL_URL_ROOT.'/societe/ajax/company.php';
|
||||
|
||||
// No immediate load of all database
|
||||
$urloption='htmlname='.$htmlname.'&outjson=1&objectdesc='.$objectdesc.($moreparams?$moreparams:'');
|
||||
|
||||
@ -64,7 +64,7 @@ print load_fiche_titre($langs->trans("StatisticsOfSendings"), $mesg);
|
||||
|
||||
dol_mkdir($dir);
|
||||
|
||||
$stats = new DonationStats($db, $socid, $mode, ($userid>0?$userid:0));
|
||||
$stats = new DonationStats($db, $socid, '', ($userid>0?$userid:0));
|
||||
|
||||
// Build graphic number of object
|
||||
$data = $stats->getNbByMonthWithPrevYear($endyear, $startyear);
|
||||
@ -75,14 +75,10 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear);
|
||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||
{
|
||||
$filenamenb = $dir.'/shipmentsnbinyear-'.$user->id.'-'.$year.'.png';
|
||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsnbinyear-'.$user->id.'-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsnbinyear-'.$user->id.'-'.$year.'.png';
|
||||
}
|
||||
else
|
||||
{
|
||||
$filenamenb = $dir.'/shipmentsnbinyear-'.$year.'.png';
|
||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsnbinyear-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsnbinyear-'.$year.'.png';
|
||||
}
|
||||
|
||||
$px1 = new DolGraph();
|
||||
@ -121,14 +117,10 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear);
|
||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||
{
|
||||
$filenameamount = $dir.'/shipmentsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||
if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||
}
|
||||
else
|
||||
{
|
||||
$filenameamount = $dir.'/shipmentsamountinyear-'.$year.'.png';
|
||||
if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsamountinyear-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsamountinyear-'.$year.'.png';
|
||||
}
|
||||
|
||||
$px2 = new DolGraph();
|
||||
@ -164,14 +156,10 @@ $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
|
||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||
{
|
||||
$filename_avg = $dir.'/shipmentsaverage-'.$user->id.'-'.$year.'.png';
|
||||
if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsaverage-'.$user->id.'-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsaverage-'.$user->id.'-'.$year.'.png';
|
||||
}
|
||||
else
|
||||
{
|
||||
$filename_avg = $dir.'/shipmentsaverage-'.$year.'.png';
|
||||
if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsaverage-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsaverage-'.$year.'.png';
|
||||
}
|
||||
|
||||
$px3 = new DolGraph();
|
||||
@ -214,7 +202,7 @@ if (! count($arrayyears)) $arrayyears[$nowyear]=$nowyear;
|
||||
|
||||
$h=0;
|
||||
$head = array();
|
||||
$head[$h][0] = DOL_URL_ROOT . '/don/stats/index.php?mode='.$mode;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/don/stats/index.php';
|
||||
$head[$h][1] = $langs->trans("ByMonthYear");
|
||||
$head[$h][2] = 'byyear';
|
||||
$h++;
|
||||
@ -233,14 +221,13 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
//{
|
||||
// Show filter box
|
||||
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
// Company
|
||||
print '<tr><td class="left">'.$langs->trans("ThirdParty").'</td><td class="left">';
|
||||
if ($mode == 'customer') $filter='s.client in (1,2,3)';
|
||||
if ($mode == 'supplier') $filter='s.fournisseur = 1';
|
||||
print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"');
|
||||
print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, '', 'style="width: 95%"');
|
||||
print '</td></tr>';
|
||||
// User
|
||||
print '<tr><td class="left">'.$langs->trans("CreatedBy").'</td><td class="left">';
|
||||
@ -276,7 +263,7 @@ foreach ($data as $val)
|
||||
{ // If we have empty year
|
||||
$oldyear--;
|
||||
print '<tr height="24">';
|
||||
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.'">'.$oldyear.'</a></td>';
|
||||
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'">'.$oldyear.'</a></td>';
|
||||
|
||||
print '<td class="right">0</td>';
|
||||
/*print '<td class="right">0</td>';
|
||||
@ -285,7 +272,7 @@ foreach ($data as $val)
|
||||
}
|
||||
|
||||
print '<tr height="24">';
|
||||
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&mode='.$mode.'">'.$year.'</a></td>';
|
||||
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'">'.$year.'</a></td>';
|
||||
print '<td class="right">'.$val['nb'].'</td>';
|
||||
/*print '<td class="right">'.price(price2num($val['total'],'MT'),1).'</td>';
|
||||
print '<td class="right">'.price(price2num($val['avg'],'MT'),1).'</td>';*/
|
||||
|
||||
@ -63,7 +63,7 @@ print load_fiche_titre($langs->trans("StatisticsOfSendings"), $mesg);
|
||||
|
||||
dol_mkdir($dir);
|
||||
|
||||
$stats = new ExpeditionStats($db, $socid, $mode, ($userid>0?$userid:0));
|
||||
$stats = new ExpeditionStats($db, $socid, '', ($userid>0?$userid:0));
|
||||
|
||||
// Build graphic number of object
|
||||
$data = $stats->getNbByMonthWithPrevYear($endyear, $startyear);
|
||||
@ -74,14 +74,10 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear);
|
||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||
{
|
||||
$filenamenb = $dir.'/shipmentsnbinyear-'.$user->id.'-'.$year.'.png';
|
||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsnbinyear-'.$user->id.'-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsnbinyear-'.$user->id.'-'.$year.'.png';
|
||||
}
|
||||
else
|
||||
{
|
||||
$filenamenb = $dir.'/shipmentsnbinyear-'.$year.'.png';
|
||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsnbinyear-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsnbinyear-'.$year.'.png';
|
||||
}
|
||||
|
||||
$px1 = new DolGraph();
|
||||
@ -120,14 +116,10 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear);
|
||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||
{
|
||||
$filenameamount = $dir.'/shipmentsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||
if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||
}
|
||||
else
|
||||
{
|
||||
$filenameamount = $dir.'/shipmentsamountinyear-'.$year.'.png';
|
||||
if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsamountinyear-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsamountinyear-'.$year.'.png';
|
||||
}
|
||||
|
||||
$px2 = new DolGraph();
|
||||
@ -163,14 +155,10 @@ $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
|
||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||
{
|
||||
$filename_avg = $dir.'/shipmentsaverage-'.$user->id.'-'.$year.'.png';
|
||||
if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsaverage-'.$user->id.'-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsaverage-'.$user->id.'-'.$year.'.png';
|
||||
}
|
||||
else
|
||||
{
|
||||
$filename_avg = $dir.'/shipmentsaverage-'.$year.'.png';
|
||||
if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstats&file=shipmentsaverage-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=shipmentstatssupplier&file=shipmentsaverage-'.$year.'.png';
|
||||
}
|
||||
|
||||
$px3 = new DolGraph();
|
||||
@ -213,7 +201,7 @@ if (! count($arrayyears)) $arrayyears[$nowyear]=$nowyear;
|
||||
|
||||
$h=0;
|
||||
$head = array();
|
||||
$head[$h][0] = DOL_URL_ROOT . '/expedition/stats/index.php?mode='.$mode;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/expedition/stats/index.php';
|
||||
$head[$h][1] = $langs->trans("ByMonthYear");
|
||||
$head[$h][2] = 'byyear';
|
||||
$h++;
|
||||
@ -232,15 +220,13 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
//{
|
||||
// Show filter box
|
||||
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
// Company
|
||||
print '<tr><td class="left">'.$langs->trans("ThirdParty").'</td><td class="left">';
|
||||
if ($mode == 'customer') $filter='s.client in (1,2,3)';
|
||||
if ($mode == 'supplier') $filter='s.fournisseur = 1';
|
||||
print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"');
|
||||
print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, '', 'style="width: 95%"');
|
||||
print '</td></tr>';
|
||||
// User
|
||||
print '<tr><td class="left">'.$langs->trans("CreatedBy").'</td><td class="left">';
|
||||
@ -279,7 +265,7 @@ foreach ($data as $val)
|
||||
|
||||
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.'">'.$oldyear.'</a></td>';
|
||||
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'">'.$oldyear.'</a></td>';
|
||||
|
||||
print '<td class="right">0</td>';
|
||||
/*print '<td class="right">0</td>';
|
||||
@ -289,7 +275,7 @@ foreach ($data as $val)
|
||||
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td class="center">';
|
||||
if ($year) print '<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&mode='.$mode.'">'.$year.'</a>';
|
||||
if ($year) print '<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'">'.$year.'</a>';
|
||||
else print $langs->trans("ValidationDateNotDefinedEvenIfShipmentValidated");
|
||||
print '</td>';
|
||||
print '<td class="right">'.$val['nb'].'</td>';
|
||||
|
||||
@ -221,8 +221,7 @@ print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->tra
|
||||
// Company
|
||||
/*
|
||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||
$filter='';
|
||||
print $form->select_company($socid,'socid',$filter,1,1,0,array(),0,'','style="width: 95%"');
|
||||
print $form->select_company($socid,'socid','',1,1,0,array(),0,'','style="width: 95%"');
|
||||
print '</td></tr>';
|
||||
*/
|
||||
// User
|
||||
|
||||
@ -234,7 +234,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
// Company
|
||||
print '<tr><td class="left">'.$langs->trans("ThirdParty").'</td><td class="left">';
|
||||
$filter = 's.client in (1,2,3)';
|
||||
$filter = 's.client IN (1,2,3)';
|
||||
print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"');
|
||||
print '</td></tr>';
|
||||
// User
|
||||
|
||||
@ -1545,7 +1545,7 @@ if ($action=='create')
|
||||
}
|
||||
else
|
||||
{
|
||||
print $form->select_company((empty($socid)?'':$socid), 'socid', 's.fournisseur = 1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300');
|
||||
print $form->select_company((empty($socid)?'':$socid), 'socid', 's.fournisseur=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300');
|
||||
// reload page to retrieve customer informations
|
||||
if (!empty($conf->global->RELOAD_PAGE_ON_SUPPLIER_CHANGE))
|
||||
{
|
||||
@ -1895,7 +1895,7 @@ elseif (! empty($object->id))
|
||||
$morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="set_thirdparty">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
$morehtmlref .= $form->select_company($object->thirdparty->id, 'new_socid', 's.fournisseur = 1', '', 0, 0, array(), 0, 'minwidth300');
|
||||
$morehtmlref .= $form->select_company($object->thirdparty->id, 'new_socid', 's.fournisseur=1', '', 0, 0, array(), 0, 'minwidth300');
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
|
||||
$morehtmlref .= '</form>';
|
||||
}
|
||||
|
||||
@ -1741,7 +1741,7 @@ if ($action == 'create')
|
||||
}
|
||||
else
|
||||
{
|
||||
print $form->select_company($societe->id, 'socid', 's.fournisseur = 1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300');
|
||||
print $form->select_company($societe->id, 'socid', 's.fournisseur=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300');
|
||||
// reload page to retrieve supplier informations
|
||||
if (!empty($conf->global->RELOAD_PAGE_ON_SUPPLIER_CHANGE))
|
||||
{
|
||||
|
||||
@ -99,8 +99,7 @@ if ($socid > 0) {
|
||||
{
|
||||
print '<tr><td class="titlefield">'.$langs->trans('ThirdPartyName').'</td>';
|
||||
print '<td class="maxwidthonsmartphone" colspan="4">';
|
||||
print $form->select_company($socid, 'socid', 'client=1 OR client=3', 1, 0, 0);
|
||||
//$form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$socid,$socid,'socid','client=1 OR client=3',1,0,1);
|
||||
print $form->select_company($socid, 'socid', '(client=1 OR client=3)', 1, 0, 0);
|
||||
print '</td></tr>';
|
||||
|
||||
$client = true;
|
||||
@ -111,8 +110,7 @@ if ($socid > 0) {
|
||||
else {
|
||||
print '<tr><td class="titlefield">'.$langs->trans('ThirdPartyName').'</td>';
|
||||
print '<td class="maxwidthonsmartphone" colspan="4">';
|
||||
print $form->select_company(null, 'socid', 'client=1 OR client=3', 1, 0, 0);
|
||||
//$form->form_thirdparty($_SERVER['PHP_SELF'],null,'socid','client=1 OR client=3',1,0,1);
|
||||
print $form->select_company(null, 'socid', '(client=1 OR client=3)', 1, 0, 0);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -440,7 +440,7 @@ if ($id > 0 || $ref)
|
||||
{
|
||||
$events=array();
|
||||
$events[]=array('method' => 'getVatRates', 'url' => dol_buildpath('/core/ajax/vatrates.php', 1), 'htmlname' => 'tva_tx', 'params' => array());
|
||||
print $form->select_company(GETPOST("id_fourn"), 'id_fourn', 'fournisseur=1', 'SelectThirdParty', 0, 0, $events);
|
||||
print $form->select_company(GETPOST("id_fourn", 'alpha'), 'id_fourn', 'fournisseur=1', 'SelectThirdParty', 0, 0, $events);
|
||||
|
||||
$parameters=array('filtre'=>"fournisseur=1",'html_name'=>'id_fourn','selected'=>GETPOST("id_fourn"),'showempty'=>1,'prod_id'=>$object->id);
|
||||
$reshook=$hookmanager->executeHooks('formCreateThirdpartyOptions', $parameters, $object, $action);
|
||||
|
||||
@ -1666,7 +1666,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired">' . $langs->trans('ThirdParty') . '</td>';
|
||||
print '<td>';
|
||||
print $form->select_company('', 'socid', 's.client in (1,2,3)', 'SelectThirdParty', 0, 0, array(), 0, 'minwidth300');
|
||||
print $form->select_company('', 'socid', 's.client IN (1,2,3)', 'SelectThirdParty', 0, 0, array(), 0, 'minwidth300');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@ -264,7 +264,7 @@ if (! count($arrayyears)) $arrayyears[$nowyear]=$nowyear;
|
||||
|
||||
$h=0;
|
||||
$head = array();
|
||||
$head[$h][0] = DOL_URL_ROOT . '/projet/stats/index.php?mode='.$mode;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/projet/stats/index.php';
|
||||
$head[$h][1] = $langs->trans("ByMonthYear");
|
||||
$head[$h][2] = 'byyear';
|
||||
$h++;
|
||||
@ -282,9 +282,7 @@ print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
// Company
|
||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||
if ($mode == 'customer') $filter='s.client in (1,2,3)';
|
||||
if ($mode == 'supplier') $filter='s.fournisseur = 1';
|
||||
print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"');
|
||||
print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, '', 'style="width: 95%"');
|
||||
print '</td></tr>';
|
||||
// User
|
||||
/*print '<tr><td>'.$langs->trans("ProjectCommercial").'</td><td>';
|
||||
@ -324,7 +322,7 @@ foreach ($data_all_year as $val)
|
||||
$oldyear--;
|
||||
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
|
||||
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
|
||||
if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||
{
|
||||
print '<td class="right">0</td>';
|
||||
@ -336,7 +334,7 @@ foreach ($data_all_year as $val)
|
||||
}
|
||||
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.'</a></td>';
|
||||
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.'</a></td>';
|
||||
print '<td class="right">'.$val['nb'].'</td>';
|
||||
if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||
{
|
||||
|
||||
@ -146,9 +146,7 @@ print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
// Company
|
||||
/*print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||
if ($mode == 'customer') $filter='s.client in (1,2,3)';
|
||||
if ($mode == 'supplier') $filter='s.fournisseur = 1';
|
||||
print $form->select_company($socid,'socid',$filter,1,0,0,array(),0,'','style="width: 95%"');
|
||||
print $form->select_company($socid,'socid','',1,0,0,array(),0,'','style="width: 95%"');
|
||||
print '</td></tr>';
|
||||
*/
|
||||
// User
|
||||
|
||||
@ -52,6 +52,7 @@ $langs->load("other");
|
||||
$langs->load("companies");
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@ -65,7 +66,7 @@ print load_fiche_titre($langs->trans("StatisticsOfReceptions"), $mesg);
|
||||
|
||||
dol_mkdir($dir);
|
||||
|
||||
$stats = new ReceptionStats($db, $socid, $mode, ($userid>0?$userid:0));
|
||||
$stats = new ReceptionStats($db, $socid, '', ($userid>0?$userid:0));
|
||||
|
||||
// Build graphic number of object
|
||||
$data = $stats->getNbByMonthWithPrevYear($endyear, $startyear);
|
||||
@ -76,14 +77,10 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear);
|
||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||
{
|
||||
$filenamenb = $dir.'/receptionsnbinyear-'.$user->id.'-'.$year.'.png';
|
||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstats&file=receptionsnbinyear-'.$user->id.'-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstatssupplier&file=receptionsnbinyear-'.$user->id.'-'.$year.'.png';
|
||||
}
|
||||
else
|
||||
{
|
||||
$filenamenb = $dir.'/receptionsnbinyear-'.$year.'.png';
|
||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstats&file=receptionsnbinyear-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstatssupplier&file=receptionsnbinyear-'.$year.'.png';
|
||||
}
|
||||
|
||||
$px1 = new DolGraph();
|
||||
@ -122,14 +119,10 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear);
|
||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||
{
|
||||
$filenameamount = $dir.'/receptionsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||
if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstats&file=receptionsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstatssupplier&file=receptionsamountinyear-'.$user->id.'-'.$year.'.png';
|
||||
}
|
||||
else
|
||||
{
|
||||
$filenameamount = $dir.'/receptionsamountinyear-'.$year.'.png';
|
||||
if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstats&file=receptionsamountinyear-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstatssupplier&file=receptionsamountinyear-'.$year.'.png';
|
||||
}
|
||||
|
||||
$px2 = new DolGraph();
|
||||
@ -165,14 +158,10 @@ $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
|
||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||
{
|
||||
$filename_avg = $dir.'/receptionsaverage-'.$user->id.'-'.$year.'.png';
|
||||
if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstats&file=receptionsaverage-'.$user->id.'-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstatssupplier&file=receptionsaverage-'.$user->id.'-'.$year.'.png';
|
||||
}
|
||||
else
|
||||
{
|
||||
$filename_avg = $dir.'/receptionsaverage-'.$year.'.png';
|
||||
if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstats&file=receptionsaverage-'.$year.'.png';
|
||||
if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstatssupplier&file=receptionsaverage-'.$year.'.png';
|
||||
}
|
||||
|
||||
$px3 = new DolGraph();
|
||||
@ -215,7 +204,7 @@ if (! count($arrayyears)) $arrayyears[$nowyear]=$nowyear;
|
||||
|
||||
$h=0;
|
||||
$head = array();
|
||||
$head[$h][0] = DOL_URL_ROOT . '/commande/stats/index.php?mode='.$mode;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/commande/stats/index.php';
|
||||
$head[$h][1] = $langs->trans("ByMonthYear");
|
||||
$head[$h][2] = 'byyear';
|
||||
$h++;
|
||||
@ -234,15 +223,13 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
//{
|
||||
// Show filter box
|
||||
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
// Company
|
||||
print '<tr><td class="left">'.$langs->trans("ThirdParty").'</td><td class="left">';
|
||||
if ($mode == 'customer') $filter='s.client in (1,2,3)';
|
||||
if ($mode == 'supplier') $filter='s.fournisseur = 1';
|
||||
print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"');
|
||||
print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, '', 'style="width: 95%"');
|
||||
print '</td></tr>';
|
||||
// User
|
||||
print '<tr><td class="left">'.$langs->trans("CreatedBy").'</td><td class="left">';
|
||||
@ -279,7 +266,7 @@ foreach ($data as $val)
|
||||
|
||||
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.'">'.$oldyear.'</a></td>';
|
||||
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'">'.$oldyear.'</a></td>';
|
||||
|
||||
print '<td class="right">0</td>';
|
||||
/*print '<td class="right">0</td>';
|
||||
@ -289,7 +276,7 @@ foreach ($data as $val)
|
||||
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td class="center">';
|
||||
if ($year) print '<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&mode='.$mode.'">'.$year.'</a>';
|
||||
if ($year) print '<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'">'.$year.'</a>';
|
||||
else print $langs->trans("ValidationDateNotDefinedEvenIfReceptionValidated");
|
||||
print '</td>';
|
||||
print '<td class="right">'.$val['nb'].'</td>';
|
||||
|
||||
@ -81,7 +81,7 @@ if (GETPOST('newcompany') || GETPOST('socid', 'int') || GETPOST('id_fourn'))
|
||||
if (! empty($conf->global->SOCIETE_ALLOW_SEARCH_ON_ROWID)) $sql.=" OR rowid = '" . $db->escape($socid) . "'";
|
||||
$sql.=")";
|
||||
}
|
||||
//if (GETPOST("filter")) $sql.= " AND ".GETPOST("filter", "alpha"); // Add other filters
|
||||
//if (GETPOST("filter")) $sql.= " AND (".GETPOST("filter", "alpha").")"; // Add other filters
|
||||
$sql.= " ORDER BY nom ASC";
|
||||
|
||||
//dol_syslog("ajaxcompanies", LOG_DEBUG);
|
||||
|
||||
@ -2213,7 +2213,7 @@ else
|
||||
'name' => 'soc_origin',
|
||||
'label' => $langs->trans('MergeOriginThirdparty'),
|
||||
'type' => 'other',
|
||||
'value' => $form->select_company('', 'soc_origin', 's.rowid != '.$object->id, 'SelectThirdParty', 0, 0, array(), 0, 'minwidth200')
|
||||
'value' => $form->select_company('', 'soc_origin', 's.rowid <> '.$object->id, 'SelectThirdParty', 0, 0, array(), 0, 'minwidth200')
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -1083,7 +1083,7 @@ if ($action == 'create')
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td colspan="2">';
|
||||
print $form->select_company('', 'socid', 's.fournisseur = 1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300');
|
||||
print $form->select_company('', 'socid', 's.fournisseur=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300');
|
||||
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=0&fournisseur=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddThirdParty").'</span><span class="fa fa-plus-circle valignmiddle paddingleft"></span></a>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -64,21 +64,6 @@ if (GETPOST('action', 'alpha') == 'set')
|
||||
$db->begin();
|
||||
if (GETPOST('socid', 'int') < 0) $_POST["socid"]='';
|
||||
|
||||
/*
|
||||
$res = dolibarr_set_const($db, "CASHDESK_ID_THIRDPARTY", (GETPOST('socid', 'int') > 0 ? GETPOST('socid', 'int') : ''), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CASH", (GETPOST('CASHDESK_ID_BANKACCOUNT_CASH', 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CASH', 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CHEQUE", (GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE', 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE', 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CB", (GETPOST('CASHDESK_ID_BANKACCOUNT_CB', 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CB', 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||
foreach($paiements as $modep) {
|
||||
if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue;
|
||||
$name="CASHDESK_ID_BANKACCOUNT_".$modep->code;
|
||||
$res = dolibarr_set_const($db, $name, (GETPOST($name, 'alpha') > 0 ? GETPOST($name, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
$res = dolibarr_set_const($db, "CASHDESK_ID_WAREHOUSE", (GETPOST('CASHDESK_ID_WAREHOUSE', 'alpha') > 0 ? GETPOST('CASHDESK_ID_WAREHOUSE', 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK", GETPOST('CASHDESK_NO_DECREASE_STOCK', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
*/
|
||||
|
||||
$res = dolibarr_set_const($db, "CASHDESK_SERVICES", GETPOST('CASHDESK_SERVICES', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "TAKEPOS_ROOT_CATEGORY_ID", GETPOST('TAKEPOS_ROOT_CATEGORY_ID', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
@ -270,82 +255,6 @@ print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
/*
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
if (!$conf->global->TAKEPOS_NUM_TERMINALS || $conf->global->TAKEPOS_NUM_TERMINALS=="1") print '<td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
|
||||
else print '<td>'.$langs->trans("Terminal").' 1</td><td>'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven"><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
|
||||
print '<td colspan="2">';
|
||||
print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY, 'socid', 's.client in (1, 3) AND s.status = 1', 1, 0, 0, array(), 0);
|
||||
print '</td></tr>';
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForSell").'</td>';
|
||||
print '<td colspan="2">';
|
||||
$form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CASH, 'CASHDESK_ID_BANKACCOUNT_CASH', 0, "courant=2", 1);
|
||||
print '</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForCheque").'</td>';
|
||||
print '<td colspan="2">';
|
||||
$form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE, 'CASHDESK_ID_BANKACCOUNT_CHEQUE', 0, "courant=1", 1);
|
||||
print '</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForCB").'</td>';
|
||||
print '<td colspan="2">';
|
||||
$form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CB, 'CASHDESK_ID_BANKACCOUNT_CB', 0, "courant=1", 1);
|
||||
print '</td></tr>';
|
||||
|
||||
foreach($paiements as $modep) {
|
||||
if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue;
|
||||
$name="CASHDESK_ID_BANKACCOUNT_".$modep->code;
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountFor").' '.$langs->trans($modep->libelle).'</td>';
|
||||
print '<td colspan="2">';
|
||||
$cour=preg_match('|^LIQ.*|', $modep->code)?2:1;
|
||||
$form->select_comptes($conf->global->$name, $name, 0, "courant=".$cour, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($conf->stock->enabled))
|
||||
{
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskDoNotDecreaseStock").'</td>'; // Force warehouse (this is not a default value)
|
||||
print '<td colspan="2">';
|
||||
if (empty($conf->productbatch->enabled)) {
|
||||
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK', $conf->global->CASHDESK_NO_DECREASE_STOCK, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!$conf->global->CASHDESK_NO_DECREASE_STOCK) {
|
||||
$res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK", 1, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
print $langs->trans("Yes").'<br>';
|
||||
print '<span class="opacitymedium">'.$langs->trans('StockDecreaseForPointOfSaleDisabledbyBatch').'</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
$disabled=$conf->global->CASHDESK_NO_DECREASE_STOCK;
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskIdWareHouse").'</td>'; // Force warehouse (this is not a default value)
|
||||
print '<td colspan="2">';
|
||||
if (! $disabled)
|
||||
{
|
||||
print $formproduct->selectWarehouses($conf->global->CASHDESK_ID_WAREHOUSE, 'CASHDESK_ID_WAREHOUSE', '', 1, $disabled);
|
||||
print ' <a href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">('.$langs->trans("Create").')</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<span class="opacitymedium">'.$langs->trans("StockDecreaseForPointOfSaleDisabled").'</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
*/
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
@ -127,7 +127,7 @@ print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven"><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
|
||||
print '<td colspan="2">';
|
||||
print $form->select_company($conf->global->{'CASHDESK_ID_THIRDPARTY'.$terminaltouse}, 'socid', 's.client in (1, 3) AND s.status = 1', 1, 0, 0, array(), 0);
|
||||
print $form->select_company($conf->global->{'CASHDESK_ID_THIRDPARTY'.$terminaltouse}, 'socid', '(s.client IN (1, 3) AND s.status = 1)', 1, 0, 0, array(), 0);
|
||||
print '</td></tr>';
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
|
||||
@ -214,7 +214,7 @@ if (! count($arrayyears)) $arrayyears[$nowyear]=$nowyear;
|
||||
|
||||
$h=0;
|
||||
$head = array();
|
||||
$head[$h][0] = DOL_URL_ROOT . '/ticket/stats/index.php?mode='.$mode;
|
||||
$head[$h][0] = DOL_URL_ROOT . '/ticket/stats/index.php';
|
||||
$head[$h][1] = $langs->trans("ByMonthYear");
|
||||
$head[$h][2] = 'byyear';
|
||||
$h++;
|
||||
@ -231,12 +231,14 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
// Show filter box
|
||||
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
// Company
|
||||
print '<tr><td class="left">'.$langs->trans("ThirdParty").'</td><td class="left">';
|
||||
print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"');
|
||||
print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, '', 'style="width: 95%"');
|
||||
print '</td></tr>';
|
||||
// User
|
||||
print '<tr><td class="left">'.$langs->trans("CreatedBy").'</td><td class="left">';
|
||||
@ -280,7 +282,7 @@ foreach ($data as $val)
|
||||
$oldyear--;
|
||||
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
|
||||
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
|
||||
print '<td class="right">0</td>';
|
||||
print '<td class="right"></td>';
|
||||
//print '<td class="right">0</td>';
|
||||
@ -292,7 +294,7 @@ foreach ($data as $val)
|
||||
|
||||
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.'</a></td>';
|
||||
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.'</a></td>';
|
||||
print '<td class="right">'.$val['nb'].'</td>';
|
||||
print '<td class="right" style="'.(($val['nb_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['nb_diff']).'</td>';
|
||||
//print '<td class="right">'.price(price2num($val['total'], 'MT'), 1).'</td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user