Merge remote-tracking branch 'origin/3.5' into develop
This commit is contained in:
commit
932b421d1d
@ -60,7 +60,6 @@ llxHeader('',$langs->trans("ListOfFees"),$help_url);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$totalnb=0;
|
$totalnb=0;
|
||||||
$sql = "SELECT count(d.rowid) as nb, sum(d.km) as km, d.type";
|
$sql = "SELECT count(d.rowid) as nb, sum(d.km) as km, d.type";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."deplacement as d";
|
$sql.= " FROM ".MAIN_DB_PREFIX."deplacement as d";
|
||||||
@ -90,13 +89,11 @@ if ($result)
|
|||||||
|
|
||||||
print_fiche_titre($langs->trans("ExpensesArea"));
|
print_fiche_titre($langs->trans("ExpensesArea"));
|
||||||
|
|
||||||
print '<table width="100%" class="notopnoleftnoright">';
|
|
||||||
|
|
||||||
// Left area
|
|
||||||
print '<tr><td class="notopnoleft" width="30%" valign="top">';
|
|
||||||
|
|
||||||
|
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||||
|
|
||||||
|
|
||||||
|
// Statistics
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="4">'.$langs->trans("Statistics").'</td>';
|
print '<td colspan="4">'.$langs->trans("Statistics").'</td>';
|
||||||
@ -124,8 +121,8 @@ print '</tr>';
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
|
||||||
// Right area
|
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||||
print '</td><td valign="top">';
|
|
||||||
|
|
||||||
$max=10;
|
$max=10;
|
||||||
|
|
||||||
@ -191,6 +188,9 @@ if ($result)
|
|||||||
else dol_print_error($db);
|
else dol_print_error($db);
|
||||||
|
|
||||||
|
|
||||||
|
print '</div></div></div>';
|
||||||
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -6,8 +6,8 @@ DIRECTION=ltr
|
|||||||
# To read Chinese pdf with Linux: sudo apt-get install poppler-data
|
# To read Chinese pdf with Linux: sudo apt-get install poppler-data
|
||||||
FONTFORPDF=helvetica
|
FONTFORPDF=helvetica
|
||||||
FONTSIZEFORPDF=10
|
FONTSIZEFORPDF=10
|
||||||
SeparatorDecimal=None
|
SeparatorDecimal=,
|
||||||
SeparatorThousand=Nenhuma
|
SeparatorThousand=None
|
||||||
FormatDateShort=%d/%m/%Y
|
FormatDateShort=%d/%m/%Y
|
||||||
FormatDateShortInput=%d/%m/%Y
|
FormatDateShortInput=%d/%m/%Y
|
||||||
FormatDateShortJava=dd/MM/yyyy
|
FormatDateShortJava=dd/MM/yyyy
|
||||||
|
|||||||
@ -130,10 +130,8 @@ if ($agentid > 0) {
|
|||||||
else
|
else
|
||||||
$sql .= " AND sc.fk_user = ".$agentid;
|
$sql .= " AND sc.fk_user = ".$agentid;
|
||||||
}
|
}
|
||||||
if (!empty($startdate))
|
if (!empty($startdate)) $sql.= " AND f.datef >= '".$db->idate($startdate)."'";
|
||||||
$sql.= " AND f.datef >= '".$db->idate($startdate)."'";
|
if (!empty($enddate)) $sql.= " AND f.datef <= '".$db->idate($enddate)."'";
|
||||||
if (!empty($enddate))
|
|
||||||
$sql.= " AND f.datef <= '".$db->idate($enddate)."'";
|
|
||||||
$sql .= " AND d.buy_price_ht IS NOT NULL";
|
$sql .= " AND d.buy_price_ht IS NOT NULL";
|
||||||
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0";
|
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0";
|
||||||
$sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, u.rowid, u.login, u.lastname, u.firstname";
|
$sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, u.rowid, u.login, u.lastname, u.firstname";
|
||||||
|
|||||||
@ -172,17 +172,13 @@ $sql.= " WHERE f.fk_soc = s.rowid";
|
|||||||
$sql.= " AND f.fk_statut > 0";
|
$sql.= " AND f.fk_statut > 0";
|
||||||
$sql.= " AND s.entity = ".$conf->entity;
|
$sql.= " AND s.entity = ".$conf->entity;
|
||||||
$sql.= " AND d.fk_facture = f.rowid";
|
$sql.= " AND d.fk_facture = f.rowid";
|
||||||
if ($client)
|
if ($client) $sql.= " AND f.fk_soc = ".$socid;
|
||||||
$sql.= " AND f.fk_soc = ".$socid;
|
if (!empty($startdate)) $sql.= " AND f.datef >= '".$db->idate($startdate)."'";
|
||||||
if (!empty($startdate))
|
if (!empty($enddate)) $sql.= " AND f.datef <= '".$db->idate($enddate)."'";
|
||||||
$sql.= " AND f.datef >= '".$db->idate($startdate)."'";
|
|
||||||
if (!empty($enddate))
|
|
||||||
$sql.= " AND f.datef <= '".$db->idate($enddate)."'";
|
|
||||||
$sql .= " AND d.buy_price_ht IS NOT NULL";
|
$sql .= " AND d.buy_price_ht IS NOT NULL";
|
||||||
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
|
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0";
|
||||||
$sql .= " AND d.buy_price_ht <> 0";
|
$sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut";
|
||||||
if ($client) $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut";
|
$sql.= " ORDER BY ".$sortfield." ".$sortorder;
|
||||||
$sql.= " ORDER BY $sortfield $sortorder ";
|
|
||||||
// TODO: calculate total to display then restore pagination
|
// TODO: calculate total to display then restore pagination
|
||||||
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
||||||
|
|
||||||
|
|||||||
@ -178,17 +178,12 @@ $sql.= " AND f.fk_soc = s.rowid";
|
|||||||
$sql.= " AND d.fk_product = p.rowid";
|
$sql.= " AND d.fk_product = p.rowid";
|
||||||
$sql.= " AND f.fk_statut > 0";
|
$sql.= " AND f.fk_statut > 0";
|
||||||
$sql.= " AND d.fk_facture = f.rowid";
|
$sql.= " AND d.fk_facture = f.rowid";
|
||||||
if ($id > 0)
|
if ($id > 0) $sql.= " AND d.fk_product =".$id;
|
||||||
$sql.= " AND d.fk_product =".$id;
|
if (!empty($startdate)) $sql.= " AND f.datef >= '".$db->idate($startdate)."'";
|
||||||
if (!empty($startdate))
|
if (!empty($enddate)) $sql.= " AND f.datef <= '".$db->idate($enddate)."'";
|
||||||
$sql.= " AND f.datef >= '".$db->idate($startdate)."'";
|
|
||||||
if (!empty($enddate))
|
|
||||||
$sql.= " AND f.datef <= '".$db->idate($enddate)."'";
|
|
||||||
$sql .= " AND d.buy_price_ht IS NOT NULL";
|
$sql .= " AND d.buy_price_ht IS NOT NULL";
|
||||||
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
|
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0";
|
||||||
$sql .= " AND d.buy_price_ht <> 0";
|
$sql.= " GROUP BY p.label, p.rowid, p.fk_product_type, p.ref, d.fk_product, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut";
|
||||||
if ($id > 0)
|
|
||||||
$sql.= " GROUP BY p.label, p.rowid, p.fk_product_type, p.ref, d.fk_product, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut";
|
|
||||||
$sql.= " ORDER BY ".$sortfield." ".$sortorder;
|
$sql.= " ORDER BY ".$sortfield." ".$sortorder;
|
||||||
// TODO: calculate total to display then restore pagination
|
// TODO: calculate total to display then restore pagination
|
||||||
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
||||||
|
|||||||
@ -129,13 +129,13 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
|
|
||||||
$sql = "SELECT s.nom, s.rowid as socid, s.code_client,";
|
$sql = "SELECT s.nom, s.rowid as socid, s.code_client,";
|
||||||
$sql.= " f.facnumber, f.total as total_ht,";
|
$sql.= " f.rowid as facid, f.facnumber, f.total as total_ht,";
|
||||||
|
$sql.= " f.datef, f.paye, f.fk_statut as statut,";
|
||||||
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= " sc.fk_soc, sc.fk_user,";
|
||||||
$sql.= " sum(d.total_ht) as selling_price,";
|
$sql.= " sum(d.total_ht) as selling_price,";
|
||||||
$sql.= $db->ifsql('f.type =2','sum(d.qty *-1)','sum(d.qty)')." as qty,";
|
$sql.= $db->ifsql('f.type =2','sum(d.qty *-1)','sum(d.qty)')." as qty,";
|
||||||
$sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid,";
|
|
||||||
$sql.= $db->ifsql('f.type =2','sum(d.qty * d.buy_price_ht *-1)','sum(d.qty * d.buy_price_ht)')." as buying_price,";
|
$sql.= $db->ifsql('f.type =2','sum(d.qty * d.buy_price_ht *-1)','sum(d.qty * d.buy_price_ht)')." as buying_price,";
|
||||||
$sql.= $db->ifsql('f.type =2','sum(-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty)))','sum(d.total_ht - (d.buy_price_ht * d.qty))')." as marge" ;
|
$sql.= $db->ifsql('f.type =2','sum(-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty)))','sum(d.total_ht - (d.buy_price_ht * d.qty))')." as marge" ;
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."facture as f";
|
$sql.= ", ".MAIN_DB_PREFIX."facture as f";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."facturedet as d";
|
$sql.= ", ".MAIN_DB_PREFIX."facturedet as d";
|
||||||
@ -148,10 +148,10 @@ if ($id > 0 || ! empty($ref))
|
|||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
if (! empty($socid)) $sql.= " AND f.fk_soc = $socid";
|
if (! empty($socid)) $sql.= " AND f.fk_soc = $socid";
|
||||||
$sql .= " AND d.buy_price_ht IS NOT NULL";
|
$sql .= " AND d.buy_price_ht IS NOT NULL";
|
||||||
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
|
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0";
|
||||||
$sql .= " AND d.buy_price_ht <> 0";
|
$sql.= " GROUP BY s.nom, s.rowid, s.code_client, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut";
|
||||||
$sql.= " GROUP BY f.rowid";
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user";
|
||||||
$sql.= " ORDER BY $sortfield $sortorder ";
|
$sql.= " ORDER BY ".$sortfield." ".$sortorder;
|
||||||
// TODO: calculate total to display then restore pagination
|
// TODO: calculate total to display then restore pagination
|
||||||
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
||||||
dol_syslog('margin:tabs:productMargins.php sql='.$sql,LOG_DEBUG);
|
dol_syslog('margin:tabs:productMargins.php sql='.$sql,LOG_DEBUG);
|
||||||
|
|||||||
@ -127,12 +127,11 @@ if ($socid > 0)
|
|||||||
|
|
||||||
|
|
||||||
$sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client,";
|
$sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client,";
|
||||||
$sql.= " f.facnumber, f.total as total_ht,";
|
$sql.= " f.rowid as facid, f.facnumber, f.total as total_ht,";
|
||||||
|
$sql.= " f.datef, f.paye, f.fk_statut as statut,";
|
||||||
$sql.= " sum(d.total_ht) as selling_price,";
|
$sql.= " sum(d.total_ht) as selling_price,";
|
||||||
|
$sql.= " ".$db->ifsql('f.type =2','sum(d.qty * d.buy_price_ht *-1)','sum(d.qty * d.buy_price_ht)')." as buying_price,";
|
||||||
$sql.= $db->ifsql('f.type =2','sum(d.qty * d.buy_price_ht *-1)','sum(d.qty * d.buy_price_ht)')." as buying_price,";
|
$sql.= " ".$db->ifsql('f.type =2','sum(-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty)))','sum(d.total_ht - (d.buy_price_ht * d.qty))')." as marge";
|
||||||
$sql.= $db->ifsql('f.type =2','sum(-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty)))','sum(d.total_ht - (d.buy_price_ht * d.qty))')." as marge," ;
|
|
||||||
$sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."facture as f";
|
$sql.= ", ".MAIN_DB_PREFIX."facture as f";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."facturedet as d";
|
$sql.= ", ".MAIN_DB_PREFIX."facturedet as d";
|
||||||
@ -142,10 +141,9 @@ if ($socid > 0)
|
|||||||
$sql.= " AND d.fk_facture = f.rowid";
|
$sql.= " AND d.fk_facture = f.rowid";
|
||||||
$sql.= " AND f.fk_soc = $socid";
|
$sql.= " AND f.fk_soc = $socid";
|
||||||
$sql .= " AND d.buy_price_ht IS NOT NULL";
|
$sql .= " AND d.buy_price_ht IS NOT NULL";
|
||||||
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
|
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0";
|
||||||
$sql .= " AND d.buy_price_ht <> 0";
|
$sql.= " GROUP BY s.nom, s.rowid, s.code_client, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut";
|
||||||
$sql.= " GROUP BY f.rowid";
|
$sql.= " ORDER BY ".$sortfield." ".$sortorder;
|
||||||
$sql.= " ORDER BY $sortfield $sortorder ";
|
|
||||||
// TODO: calculate total to display then restore pagination
|
// TODO: calculate total to display then restore pagination
|
||||||
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
||||||
|
|
||||||
@ -175,7 +173,7 @@ if ($socid > 0)
|
|||||||
|
|
||||||
$cumul_achat = 0;
|
$cumul_achat = 0;
|
||||||
$cumul_vente = 0;
|
$cumul_vente = 0;
|
||||||
|
|
||||||
$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT);
|
$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT);
|
||||||
|
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
@ -195,7 +193,7 @@ if ($socid > 0)
|
|||||||
$marginRate = ($objp->buying_price != 0)?(100 * $objp->marge / $objp->buying_price):'' ;
|
$marginRate = ($objp->buying_price != 0)?(100 * $objp->marge / $objp->buying_price):'' ;
|
||||||
$markRate = ($objp->selling_price != 0)?(100 * $objp->marge / $objp->selling_price):'' ;
|
$markRate = ($objp->selling_price != 0)?(100 * $objp->marge / $objp->selling_price):'' ;
|
||||||
}
|
}
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
|
|||||||
@ -126,9 +126,20 @@ print '</td>';
|
|||||||
print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>';
|
print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Show all lines in taskarray (recursive function to go down on tree)
|
if (count($tasksarray) > 1000)
|
||||||
$j=0; $level=0;
|
{
|
||||||
$nboftaskshown=projectLinesa($j, 0, $tasksarray, $level, true, 1, $tasksrole, $projectsListId, 0);
|
print '<tr '.$bc[0].'>';
|
||||||
|
print '<td colspan="9">';
|
||||||
|
print $langs->trans("TooManyDataPleaseUseMoreFilters");
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Show all lines in taskarray (recursive function to go down on tree)
|
||||||
|
$j=0; $level=0;
|
||||||
|
$nboftaskshown=projectLinesa($j, 0, $tasksarray, $level, true, 1, $tasksrole, $projectsListId, 0);
|
||||||
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@ -1042,7 +1042,6 @@ div.tabsAction {
|
|||||||
|
|
||||||
|
|
||||||
a.tabTitle {
|
a.tabTitle {
|
||||||
background: <? echo empty($dol_use_jmobile)?'#5088A9':'auto'; ?>;
|
|
||||||
color: #888;
|
color: #888;
|
||||||
font-family: <?php print $fontlist ?>;
|
font-family: <?php print $fontlist ?>;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
@ -1050,9 +1049,6 @@ a.tabTitle {
|
|||||||
margin: 0px 6px;
|
margin: 0px 6px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
border-<?php print $right; ?>: 1px solid #555555;
|
|
||||||
border-<?php print $left; ?>: 1px solid #D8D8D8;
|
|
||||||
border-top: 1px solid #D8D8D8;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
a.tab:link {
|
a.tab:link {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user