Uniformize table fields

This commit is contained in:
Laurent Destailleur
2011-06-29 11:22:35 +00:00
parent cb035666a6
commit 508a1d00a2
13 changed files with 53 additions and 37 deletions

View File

@@ -21,7 +21,7 @@
/**
* \file htdocs/compta/stats/comp.php
* \ingroup commercial
* \version $Id$
* \version $Id: comp.php,v 1.43 2011/06/29 11:22:36 eldy Exp $
* TODO Remove or add page in menus
*/
@@ -40,19 +40,16 @@ function propals ($db, $year, $month)
{
global $bc,$langs,$conf;
$sql = "SELECT s.nom, s.rowid as socid, p.rowid as propalid, p.price, p.ref, p.datep as dp, c.label as statut, c.id as statutid";
$sql = "SELECT s.nom, s.rowid as socid, p.rowid as propalid, p.price, p.ref, p.datep as dp, p.fk_statut as statutid, c.label as statut";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."propal as p";
$sql.= ", ".MAIN_DB_PREFIX."c_propalst as c";
$sql.= " WHERE p.fk_soc = s.rowid";
$sql.= " WHERE p.fk_soc = s.rowid AND p.fk_statut = c.id";
$sql.= " AND p.entity = ".$conf->entity;
$sql.= " AND p.fk_statut = c.id";
$sql.= " AND c.id in (1,2,4)";
$sql.= " AND p.fk_statut in (1,2,4)";
$sql.= " AND date_format(p.datep, '%Y') = ".$year;
$sql.= " AND round(date_format(p.datep, '%m')) = ".$month;
$sql .= " ORDER BY p.fk_statut";
$sql.= " ORDER BY p.fk_statut";
$result = $db->query($sql);
$num = $db->num_rows($result);
@@ -77,7 +74,7 @@ function propals ($db, $year, $month)
print "<tr class=\"liste_titre\">";
print "<td>Societe</td>";
print "<td>".$langs->trans("Ref")."</td>";
print "<td align=\"right\">Date</td>";
print "<td align=\"right\">".$langs->trans("Date")."</td>";
print "<td align=\"right\">".$langs->trans("Price")."</td>";
print "<td align=\"center\">".$langs->trans("Status")."</td>";
print "</tr>\n";
@@ -353,5 +350,5 @@ if ($details == 1)
$db->close();
llxFooter('$Date$ - $Revision$');
llxFooter('$Date: 2011/06/29 11:22:36 $ - $Revision: 1.43 $');
?>

View File

@@ -31,7 +31,7 @@
* \file htdocs/core/class/html.form.class.php
* \ingroup core
* \brief File of class with all html predefined components
* \version $Id$
* \version $Id: html.form.class.php,v 1.183 2011/06/29 11:22:36 eldy Exp $
*/
@@ -1814,7 +1814,7 @@ class Form
{
print '<option value="'.$obj->id.'">';
}
print $obj->label;
print ($langs->trans("PropalStatus".$obj->code)!="PropalStatus".$obj->code)?$langs->trans("PropalStatus".$obj->code):$obj->label;
print '</option>';
$i++;
}

View File

@@ -1,5 +1,5 @@
--
-- $Id: 3.0.0-3.1.0.sql,v 1.76 2011/06/29 10:23:33 eldy Exp $
-- $Id: 3.0.0-3.1.0.sql,v 1.77 2011/06/29 11:22:35 eldy Exp $
--
-- Be carefull to requests order.
-- This file must be loaded by calling /install/index.php page
@@ -421,10 +421,20 @@ ALTER TABLE llx_propal MODIFY ref_client varchar(50);
ALTER TABLE llx_propal ADD COLUMN ref_int varchar(50) AFTER ref_ext;
-- Add module field to allow external modules to set their name when they add a new record during init/remove.
ALTER TABLE llx_c_type_contact ADD COLUMN module varchar(32) NULL;
ALTER TABLE llx_c_typent ADD COLUMN module varchar(32) NULL;
ALTER TABLE llx_c_chargesociales ADD COLUMN module varchar(32) NULL;
ALTER TABLE llx_c_civilite ADD COLUMN module varchar(32) NULL;
ALTER TABLE llx_c_effectif ADD COLUMN module varchar(32) NULL;
ALTER TABLE llx_c_forme_juridique ADD COLUMN module varchar(32) NULL;
ALTER TABLE llx_c_input_method ADD COLUMN module varchar(32) NULL;
ALTER TABLE llx_c_input_reason ADD COLUMN module varchar(32) NULL;
ALTER TABLE llx_c_paiement ADD COLUMN module varchar(32) NULL;
ALTER TABLE llx_c_paper_format ADD COLUMN module varchar(32) NULL;
ALTER TABLE llx_c_payment_term ADD COLUMN module varchar(32) NULL;
ALTER TABLE llx_c_prospectlevel ADD COLUMN module varchar(32) NULL;
ALTER TABLE llx_c_shipment_mode ADD COLUMN module varchar(32) NULL;
ALTER TABLE llx_c_type_contact ADD COLUMN module varchar(32) NULL;
ALTER TABLE llx_c_type_fees ADD COLUMN module varchar(32) NULL;
ALTER TABLE llx_c_typent ADD COLUMN module varchar(32) NULL;
ALTER TABLE llx_user ADD signature text DEFAULT NULL AFTER email;

View File

@@ -16,7 +16,7 @@
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
--
-- $Id$
-- $Id: llx_c_chargesociales.sql,v 1.4 2011/06/29 11:22:36 eldy Exp $
-- ========================================================================
create table llx_c_chargesociales
@@ -26,7 +26,8 @@ create table llx_c_chargesociales
deductible smallint DEFAULT 0 NOT NULL,
active tinyint DEFAULT 1 NOT NULL,
code varchar(12) NOT NULL,
fk_pays integer DEFAULT 1 NOT NULL
fk_pays integer DEFAULT 1 NOT NULL,
module varchar(32) NULL
)ENGINE=innodb;

View File

@@ -16,7 +16,7 @@
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
--
-- $Id$
-- $Id: llx_c_civilite.sql,v 1.3 2011/06/29 11:22:35 eldy Exp $
-- ========================================================================
create table llx_c_civilite
@@ -24,6 +24,7 @@ create table llx_c_civilite
rowid integer PRIMARY KEY,
code varchar(6) UNIQUE NOT NULL,
civilite varchar(50),
active tinyint DEFAULT 1 NOT NULL
active tinyint DEFAULT 1 NOT NULL,
module varchar(32) NULL
)ENGINE=innodb;

View File

@@ -16,7 +16,7 @@
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
--
-- $Id$
-- $Id: llx_c_input_method.sql,v 1.2 2011/06/29 11:22:35 eldy Exp $
-- ========================================================================
create table llx_c_input_method
@@ -24,6 +24,7 @@ create table llx_c_input_method
rowid integer AUTO_INCREMENT PRIMARY KEY,
code varchar(30),
libelle varchar(60),
active tinyint default 1 NOT NULL
active tinyint default 1 NOT NULL,
module varchar(32) NULL
)ENGINE=innodb;

View File

@@ -16,7 +16,7 @@
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
--
-- $Id$
-- $Id: llx_c_input_reason.sql,v 1.2 2011/06/29 11:22:36 eldy Exp $
-- ========================================================================
create table llx_c_input_reason
@@ -24,7 +24,7 @@ create table llx_c_input_reason
rowid integer AUTO_INCREMENT PRIMARY KEY,
code varchar(30),
label varchar(60),
active tinyint default 1 NOT NULL
active tinyint default 1 NOT NULL,
module varchar(32) NULL
)ENGINE=innodb;

View File

@@ -16,7 +16,7 @@
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
--
-- $Id$
-- $Id: llx_c_paiement.sql,v 1.4 2011/06/29 11:22:36 eldy Exp $
-- ========================================================================
@@ -32,7 +32,8 @@ create table llx_c_paiement
code varchar(6) UNIQUE NOT NULL,
libelle varchar(30),
type smallint,
active tinyint DEFAULT 1 NOT NULL
active tinyint DEFAULT 1 NOT NULL,
module varchar(32) NULL
)ENGINE=innodb;

View File

@@ -15,7 +15,7 @@
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
--
-- $Id$
-- $Id: llx_c_paper_format.sql,v 1.3 2011/06/29 11:22:35 eldy Exp $
-- ========================================================================
create table llx_c_paper_format
@@ -25,8 +25,9 @@ create table llx_c_paper_format
label varchar(50) NOT NULL,
width float(6,2) DEFAULT 0, -- Largeur du papier
height float(6,2) DEFAULT 0, -- Hauteur du papier
unit varchar(5) NOT NULL, -- Unit<EFBFBD> de mesure
active tinyint DEFAULT 1 NOT NULL
unit varchar(5) NOT NULL, -- Mesure unit
active tinyint DEFAULT 1 NOT NULL,
module varchar(32) NULL
)ENGINE=innodb;
--

View File

@@ -15,7 +15,7 @@
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
--
-- $Id$
-- $Id: llx_c_payment_term.sql,v 1.4 2011/06/29 11:22:35 eldy Exp $
-- ============================================================================
create table llx_c_payment_term
@@ -28,5 +28,6 @@ create table llx_c_payment_term
libelle_facture text,
fdm tinyint, -- reglement fin de mois
nbjour smallint,
decalage smallint
decalage smallint,
module varchar(32) NULL
)ENGINE=innodb;

View File

@@ -15,7 +15,7 @@
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
--
-- $Id$
-- $Id: llx_c_prospectlevel.sql,v 1.3 2011/06/29 11:22:36 eldy Exp $
-- ===================================================================
create table llx_c_prospectlevel
@@ -23,6 +23,7 @@ create table llx_c_prospectlevel
code varchar(12) PRIMARY KEY,
label varchar(30),
sortorder smallint,
active smallint DEFAULT 1 NOT NULL
active smallint DEFAULT 1 NOT NULL,
module varchar(32) NULL
) ENGINE=innodb;

View File

@@ -15,7 +15,7 @@
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
--
-- $Id$
-- $Id: llx_c_shipment_mode.sql,v 1.3 2011/06/29 11:22:35 eldy Exp $
-- ===================================================================
create table llx_c_shipment_mode
@@ -25,5 +25,6 @@ create table llx_c_shipment_mode
code varchar(30) NOT NULL,
libelle varchar(50) NOT NULL,
description text,
active tinyint DEFAULT 0
active tinyint DEFAULT 0,
module varchar(32) NULL
)ENGINE=innodb;

View File

@@ -16,7 +16,7 @@
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
--
-- $Id$
-- $Id: llx_c_type_fees.sql,v 1.3 2011/06/29 11:22:35 eldy Exp $
-- ========================================================================
create table llx_c_type_fees
@@ -24,5 +24,6 @@ create table llx_c_type_fees
id integer AUTO_INCREMENT PRIMARY KEY,
code varchar(12) UNIQUE NOT NULL,
libelle varchar(30),
active tinyint DEFAULT 1 NOT NULL
active tinyint DEFAULT 1 NOT NULL,
module varchar(32) NULL
)ENGINE=innodb;