diff --git a/html/admin/sql/patch/upgrade8.sql b/html/admin/sql/patch/upgrade8.sql
index 4ba7fa7ad..8fae913ea 100644
--- a/html/admin/sql/patch/upgrade8.sql
+++ b/html/admin/sql/patch/upgrade8.sql
@@ -47,6 +47,21 @@ INSERT INTO format_csv_banque VALUES ('EUB', 'eub_be.inc.php');
INSERT INTO format_csv_banque VALUES ('ING', 'ing_be.inc.php');
INSERT INTO format_csv_banque VALUES ('CBC', 'cbc_be.inc.php');
+CREATE TABLE import_tmp (
+ code text,
+ date_exec date,
+ date_valeur date,
+ montant text,
+ devise text,
+ compte_ordre text,
+ detail text,
+ num_compte text,
+ poste_comptable text,
+ ok boolean DEFAULT false,
+ bq_account integer,
+ jrn integer
+);
+
update version set val=9;
diff --git a/html/import.php b/html/import.php
index aee68623b..755607162 100644
--- a/html/import.php
+++ b/html/import.php
@@ -67,7 +67,7 @@ if ( isset ($_GET["action"]) ) {
if(isset($_FILES['fupload'])) {
// load the table with the cvs' content
echo '
';
- ImportCSV($cn,$_FILES['fupload']['tmp_name'],$_POST['import_bq'],$_POST['format_csv']);
+ ImportCSV($cn,$_FILES['fupload']['tmp_name'],$_POST['import_bq'],$_POST['format_csv'],$_POST['import_jrn']);
echo "
";
} else {
echo '';
diff --git a/include/eub_be.inc.php b/include/eub_be.inc.php
index 4f0ecc8f6..5fb46a231 100644
--- a/include/eub_be.inc.php
+++ b/include/eub_be.inc.php
@@ -23,14 +23,15 @@ if($code >= 100) $code = "0".$code;
$code = $annee."-".$code;
-$Sql="insert into import_tmp (code
+$Sql="insert into import_tmp (code,
date_exec ,
date_valeur,
montant,
devise,
detail,
num_compte,
- poste_comptable,
+ bq_account ,
+ jrn,
ok)
values ('$code',
'$date_exec',
@@ -39,6 +40,7 @@ values ('$code',
'EUR',
'".addslashes($detail)."',
'$p_bq_account',
+ $p_jrn,
false)";
$Res=ExecSql($p_cn,$Sql);
}
diff --git a/include/fortis_be.inc.php b/include/fortis_be.inc.php
index b9a282a75..d244a38aa 100644
--- a/include/fortis_be.inc.php
+++ b/include/fortis_be.inc.php
@@ -46,7 +46,7 @@ if ( $row>1) {
echo "Opération FORTIS ".$code." déj&eagrave; importée.
";
} else {
// $Sql="insert into import_tmp values ('$code','$date_exec','$date_valeur','$montant','$devise','".addslashes($compte_ordre)."','".addslashes($detail)."','$num_compte','$poste_comptable')";
- $Sql="insert into import_tmp (code
+ $Sql="insert into import_tmp (code ,
date_exec ,
date_valeur,
montant,
@@ -54,7 +54,8 @@ if ( $row>1) {
compte_ordre,
detail,
num_compte,
- poste_comptable,
+ bq_account ,
+ jrn
ok)
values ('$code',
'$date_exec',
@@ -64,6 +65,7 @@ if ( $row>1) {
'".addslashes($compte_ordre)."',
'".addslashes($detail)."',
'$p_bq_account',
+ $p_jrn,
false)";
$Res=ExecSql($p_cn,$Sql);
diff --git a/include/import_inc.php b/include/import_inc.php
index 5ce750f30..0f532d92d 100644
--- a/include/import_inc.php
+++ b/include/import_inc.php
@@ -38,7 +38,7 @@ include_once("user_common.php");
* -
* return:
*/
-function ImportCSV($p_cn,$file,$p_bq_account,$p_format_csv)
+function ImportCSV($p_cn,$file,$p_bq_account,$p_format_csv,$p_jrn)
{
if(!$handle = fopen($file, "r")) {
print 'could not open file. quitting';
@@ -48,7 +48,7 @@ function ImportCSV($p_cn,$file,$p_bq_account,$p_format_csv)
while (($data = fgetcsv($handle, 2000, '#@!')) !== FALSE) {
$num = count($data);
for ($c=0; $c < $num; $c++) {
-// if $p_format_csv == fortis
+// include the right format for CSV --> given by the