From c06aedc54da2dadd3d01e8dd3c5200ea847ed8c3 Mon Sep 17 00:00:00 2001
From: Alexandre SPANGARO <alexandre.spangaro@gmail.com>
Date: Wed, 15 Feb 2017 20:55:52 +0100
Subject: [PATCH] [FP17] : Add data in llx_accountancy_journal

---
 htdocs/install/mysql/data/llx_accounting.sql           | 8 +++++++-
 htdocs/install/mysql/migration/5.0.0-6.0.0.sql         | 6 ++++++
 htdocs/install/mysql/tables/llx_accounting_journal.sql | 4 ++--
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/htdocs/install/mysql/data/llx_accounting.sql b/htdocs/install/mysql/data/llx_accounting.sql
index 149d7fea394..dc7aeb27bef 100644
--- a/htdocs/install/mysql/data/llx_accounting.sql
+++ b/htdocs/install/mysql/data/llx_accounting.sql
@@ -5,7 +5,7 @@
 -- Copyright (C) 2004      Guillaume Delecourt  <guillaume.delecourt@opensides.be>
 -- Copyright (C) 2005-2009 Regis Houssin        <regis.houssin@capnetworks.com>
 -- Copyright (C) 2007 	   Patrick Raguin       <patrick.raguin@gmail.com>
--- Copyright (C) 2011-2016 Alexandre Spangaro   <aspangaro.dolibarr@gmail.com>
+-- Copyright (C) 2011-2017 Alexandre Spangaro   <aspangaro@zendsi.com>
 --
 -- This program is free software; you can redistribute it and/or modify
 -- it under the terms of the GNU General Public License as published by
@@ -29,7 +29,13 @@
 
 delete from llx_accounting_account;
 delete from llx_accounting_system;
+delete from llx_accounting_journal;
 
+INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (1,'VT', 'Journal des ventes', 1, 1);
+INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (2,'AC', 'Journal des achats', 2, 1);
+INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (3,'BQ', 'Journal de banque', 3, 1);
+INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (4,'OD', 'Journal des opérations diverses', 4, 1);
+INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (5,'AN', 'Journal des à-nouveaux', 9, 1);
 --
 -- Descriptif des plans comptables FR PCG99-ABREGE
 --
diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql
index aa755daa09a..0d47261503c 100644
--- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql
+++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql
@@ -98,3 +98,9 @@ CREATE TABLE llx_product_attribute_combination
   entity INT DEFAULT 1 NOT NULL
 );
 
+INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (1,'VT', 'Journal des ventes', 1, 1);
+INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (2,'AC', 'Journal des achats', 2, 1);
+INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (3,'BQ', 'Journal de banque', 3, 1);
+INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (4,'OD', 'Journal des opérations diverses', 4, 1);
+INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (5,'AN', 'Journal des à-nouveaux', 9, 1);
+
diff --git a/htdocs/install/mysql/tables/llx_accounting_journal.sql b/htdocs/install/mysql/tables/llx_accounting_journal.sql
index bc514f0ed9b..f3ee2a2e010 100644
--- a/htdocs/install/mysql/tables/llx_accounting_journal.sql
+++ b/htdocs/install/mysql/tables/llx_accounting_journal.sql
@@ -1,5 +1,5 @@
 -- ============================================================================
--- Copyright (C) 2016	 Alexandre Spangaro	 <aspangaro.dolibarr@gmail.com>
+-- Copyright (C) 2016-2017	Alexandre Spangaro	 <aspangaro@zendsi.com>
 --
 -- This program is free software; you can redistribute it and/or modify
 -- it under the terms of the GNU General Public License as published by
@@ -22,6 +22,6 @@ create table llx_accounting_journal
   rowid             integer AUTO_INCREMENT PRIMARY KEY,
   code       		varchar(32) NOT NULL,
   label             varchar(128) NOT NULL,
-  nature			smallint DEFAULT 0 NOT NULL,			-- type of journals (Sale / purchase / bank / various operations)
+  nature			smallint DEFAULT 0 NOT NULL,			-- type of journals (1:Sale / 2:purchase / 3:bank / 4:various operations / 9: has-new)
   active            smallint DEFAULT 0
 )ENGINE=innodb;
-- 
GitLab