Clean code

This commit is contained in:
Laurent Destailleur
2021-08-28 00:55:51 +02:00
parent 11096a5453
commit 51a4d7630f
44 changed files with 193 additions and 219 deletions

View File

@@ -306,7 +306,7 @@ if ($modecompta == 'CREANCES-DETTES') {
$sql .= " fd.product_type AS product_type,";
$sql .= " cc.code, cc.label AS country,";
for ($i = 1; $i <= 12; $i++) {
$sql .= " SUM(".$db->ifsql('MONTH(f.datef)='.$i, 'fd.total_ht', '0').") AS month".str_pad($i, 2, '0', STR_PAD_LEFT).",";
$sql .= " SUM(".$db->ifsql("MONTH(f.datef)=".$i, "fd.total_ht", "0").") AS month".str_pad($i, 2, "0", STR_PAD_LEFT).",";
}
$sql .= " SUM(fd.total_ht) as total";
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd";
@@ -393,7 +393,7 @@ if ($modecompta == 'CREANCES-DETTES') {
$sql2 .= " ffd.product_type AS product_type,";
$sql2 .= " cc.code, cc.label AS country,";
for ($i = 1; $i <= 12; $i++) {
$sql2 .= " SUM(".$db->ifsql('MONTH(ff.datef)='.$i, 'ffd.total_ht', '0').") AS month".str_pad($i, 2, '0', STR_PAD_LEFT).",";
$sql2 .= " SUM(".$db->ifsql("MONTH(ff.datef)=".$i, "ffd.total_ht", "0").") AS month".str_pad($i, 2, "0", STR_PAD_LEFT).",";
}
$sql2 .= " SUM(ffd.total_ht) as total";
$sql2 .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as ffd";