review code
This commit is contained in:
parent
e4803dda88
commit
0e8e8a79dc
@ -526,13 +526,14 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
|||||||
if ($j > 12) {
|
if ($j > 12) {
|
||||||
$j -= 12;
|
$j -= 12;
|
||||||
}
|
}
|
||||||
$sql .= ' SUM(CASE WHEN
|
$sql .= '
|
||||||
MONTH(f.datef)='.$j.'
|
SUM('.$db->ifsql('MONTH(f.datef)='.$j,
|
||||||
THEN (CASE WHEN fd.total_ht < 0
|
' ('.
|
||||||
THEN (-1 * (abs(fd.total_ht) - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100))))
|
$db->ifsql('fd.total_ht < 0',
|
||||||
ELSE (fd.total_ht - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100)))
|
' (-1 * (abs(fd.total_ht) - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100))))',
|
||||||
END)
|
' (fd.total_ht - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100)))'
|
||||||
ELSE 0 END) AS month'.str_pad($j, 2, '0', STR_PAD_LEFT).',';
|
).')',
|
||||||
|
0).') AS month'.str_pad($j, 2, '0', STR_PAD_LEFT).',';
|
||||||
}
|
}
|
||||||
$sql .= " SUM((fd.total_ht-(fd.qty * fd.buy_price_ht))) as total";
|
$sql .= " SUM((fd.total_ht-(fd.qty * fd.buy_price_ht))) as total";
|
||||||
|
|
||||||
@ -552,7 +553,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
|||||||
} else {
|
} else {
|
||||||
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.", ".Facture::TYPE_REPLACEMENT.", ".Facture::TYPE_CREDIT_NOTE.", ".Facture::TYPE_DEPOSIT.", ".Facture::TYPE_SITUATION.")";
|
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.", ".Facture::TYPE_REPLACEMENT.", ".Facture::TYPE_CREDIT_NOTE.", ".Facture::TYPE_DEPOSIT.", ".Facture::TYPE_SITUATION.")";
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog('htdocs/accountancy/customer/index.php');
|
dol_syslog('htdocs/accountancy/customer/index.php');
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user