From db56e1b8a1ba58daf81534315234e80773bcbab2 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Thu, 26 May 2016 21:17:43 +0200
Subject: [PATCH] FIX Missing columns in migration

---
 htdocs/install/mysql/migration/3.9.0-4.0.0.sql        | 2 ++
 htdocs/install/mysql/tables/llx_expensereport_det.sql | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql
index 5342dd56f7b..f603846de50 100644
--- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql
+++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql
@@ -350,6 +350,8 @@ ALTER TABLE llx_expensereport_det ADD COLUMN multicurrency_total_ht double(24,8)
 ALTER TABLE llx_expensereport_det ADD COLUMN multicurrency_total_tva double(24,8) DEFAULT 0;
 ALTER TABLE llx_expensereport_det ADD COLUMN multicurrency_total_ttc double(24,8) DEFAULT 0;
 
+ALTER TABLE llx_expensereport_det ADD COLUMN fk_facture	integer DEFAULT 0;
+
 ALTER TABLE llx_product_lang ADD COLUMN import_key varchar(14) DEFAULT NULL;
 
 ALTER TABLE llx_actioncomm MODIFY COLUMN elementtype varchar(255) DEFAULT NULL;
diff --git a/htdocs/install/mysql/tables/llx_expensereport_det.sql b/htdocs/install/mysql/tables/llx_expensereport_det.sql
index c5333c4fca5..4684a70399d 100644
--- a/htdocs/install/mysql/tables/llx_expensereport_det.sql
+++ b/htdocs/install/mysql/tables/llx_expensereport_det.sql
@@ -40,6 +40,13 @@ CREATE TABLE llx_expensereport_det
    date date NOT NULL,
    info_bits					integer DEFAULT 0,				-- TVA NPR ou non
    special_code					integer DEFAULT 0,			    -- code pour les lignes speciales
+   fk_multicurrency             integer,
+   multicurrency_code           varchar(255),
+   multicurrency_subprice       double(24,8) DEFAULT 0,
+   multicurrency_total_ht       double(24,8) DEFAULT 0,
+   multicurrency_total_tva      double(24,8) DEFAULT 0,
+   multicurrency_total_ttc      double(24,8) DEFAULT 0;
+   fk_facture					integer DEFAULT 0,				-- ID of customer invoice line if expense is rebilled to a customer  		        
    rang							integer DEFAULT 0,				-- position of line
    import_key					varchar(14)
 ) ENGINE=innodb;
\ No newline at end of file
-- 
GitLab