diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 2d0ba61fff9..e5a90c86661 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1061,8 +1061,7 @@ class ActionComm extends CommonObject $this->nb=array(); $sql = "SELECT count(a.id) as nb"; } - $sql.= " FROM (".MAIN_DB_PREFIX."actioncomm as a"; - $sql.= ")"; + $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a"; if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; $sql.= " WHERE 1 = 1"; diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index 1e2c26c0c62..db0364e5e3b 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -121,7 +121,7 @@ function pt($db, $sql, $date) if ($obj->mode == 'claimed' && ! empty($previousmode)) { print ''; - print ''.$obj->dm."\n"; + print ''.$previousmonth."\n"; print ''.price($amountclaimed)."\n"; print ''.price($amountpaid)."\n"; print "\n"; @@ -271,7 +271,7 @@ $mend = $tmp['mon']; $total=0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0; $i=0; $mcursor=0; -while ((($y < $yend) || ($y == $yend && $m < $mend)) && $mcursor < 1000) // $mcursor is to avoid too large loop +while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mcursor is to avoid too large loop { //$m = $conf->global->SOCIETE_FISCAL_MONTH_START + ($mcursor % 12); if ($m == 13) $y++; @@ -536,7 +536,7 @@ while ((($y < $yend) || ($y == $yend && $m < $mend)) && $mcursor < 1000) // $mcu if ($i > 2) { print ''; - print ''.$langs->trans("SubTotal").':'; + print ''.$langs->trans("SubTotal").':'; print ''.price(price2num($subtotalcoll,'MT')).''; print ''.price(price2num($subtotalpaye,'MT')).''; print ''.price(price2num($subtotal,'MT')).''; diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 514f2030065..47baeaef3e6 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -505,7 +505,7 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mc if ($i > 2) { print ''; - print ''.$langs->trans("SubTotal").':'; + print ''.$langs->trans("SubTotal").':'; print ''.price(price2num($subtotalcoll,'MT')).''; print ''.price(price2num($subtotalpaye,'MT')).''; print ''.price(price2num($subtotal,'MT')).''; diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index aea85fd111e..70e024ca952 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -89,8 +89,7 @@ class box_actions extends ModeleBoxes $sql.= ", s.nom as name"; $sql.= ", s.rowid as socid"; $sql.= ", s.code_client"; - $sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm AS ta, "; - $sql.= MAIN_DB_PREFIX."actioncomm AS a)"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm AS ta, ".MAIN_DB_PREFIX."actioncomm AS a"; if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; $sql.= " WHERE a.fk_action = ta.id";