diff --git a/htdocs/install/mysql/migration/2.7.0-2.8.0.sql b/htdocs/install/mysql/migration/2.7.0-2.8.0.sql
index bb7b4f201dc..dfaa2b94a06 100755
--- a/htdocs/install/mysql/migration/2.7.0-2.8.0.sql
+++ b/htdocs/install/mysql/migration/2.7.0-2.8.0.sql
@@ -154,3 +154,18 @@ ALTER TABLE llx_projet MODIFY fk_statut smallint DEFAULT 0 NOT NULL;
ALTER TABLE llx_facturedet CHANGE tva_taux tva_tx real;
ALTER TABLE llx_facture_fourn_det CHANGE tva_taux tva_tx double(6,3);
ALTER TABLE llx_facturedet_rec CHANGE tva_taux tva_tx real DEFAULT 19.6;
+
+-- Create table for entities
+create table llx_entity
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ label varchar(255) NOT NULL,
+ description text,
+ datec datetime,
+ fk_user_creat integer,
+ visible tinyint DEFAULT 1 NOT NULL,
+ active tinyint DEFAULT 1 NOT NULL
+) type=innodb;
+
+INSERT INTO llx_entity (label, description, datec, fk_user_creat, visible, active) VALUES ('Default Entity', 'This is the default entity', NOW(), 1, 1, 1);
\ No newline at end of file
diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php
index 3cb5bb10d1a..b78ac751a31 100644
--- a/htdocs/install/upgrade2.php
+++ b/htdocs/install/upgrade2.php
@@ -1103,7 +1103,7 @@ function migrate_price_facture($db,$langs,$conf)
print ''.$langs->trans('MigrationInvoice')."
\n";
// Liste des lignes facture non a jour
- $sql = "SELECT fd.rowid, fd.qty, fd.subprice, fd.remise_percent, fd.tva_taux, fd.total_ttc, fd.info_bits,";
+ $sql = "SELECT fd.rowid, fd.qty, fd.subprice, fd.remise_percent, fd.tva_tx as tva_taux, fd.total_ttc, fd.info_bits,";
$sql.= " f.rowid as facid, f.remise_percent as remise_percent_global, f.total_ttc as total_ttc_f";
$sql.= " FROM ".MAIN_DB_PREFIX."facturedet as fd, ".MAIN_DB_PREFIX."facture as f";
$sql.= " WHERE fd.fk_facture = f.rowid";
@@ -1446,7 +1446,7 @@ function migrate_price_commande($db,$langs,$conf)
$info_bits = $obj->info_bits;
// On met a jour les 3 nouveaux champs
- $commandeligne= new CommandeLigne($db);
+ $commandeligne= new OrderLine($db);
$commandeligne->fetch($rowid);
$result=calcul_price_total($qty,$pu,$remise_percent,$txtva,$remise_percent_global,'HT',$info_bits);