From 8bc31a69b03a2bf2455787b56dbd5a604891da20 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Sat, 14 Apr 2007 19:59:44 +0000 Subject: [PATCH] Add Dexia to import CSV (Guy Moins) --- include/dexia.inc.php | 149 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 include/dexia.inc.php diff --git a/include/dexia.inc.php b/include/dexia.inc.php new file mode 100644 index 000000000..ffe8b9916 --- /dev/null +++ b/include/dexia.inc.php @@ -0,0 +1,149 @@ + 0) + { + /* Skip it it already encoded */ + echo "Double skipped : $ref_extrait $detail
"; + $LinesDup++; + continue; + } + + +//-------------------------------------------------------------------- +// SQL request to insert into import_tmp +// Adapt the format of the import's date in the ** to_date ** function +//-------------------------------------------------------------------- + $Sql="insert into import_tmp (code, + date_exec , + date_valeur, + montant, + devise, + compte_ordre, + detail, + num_compte, + bq_account , + jrn, + status) + values ( '$ref_extrait', + to_date('$date_exec','DD/MM/YYYY'), + to_date('$date_val' ,'DD/MM/YYYY'), + $montant, + '$devise', + '" . addslashes($compte_ordre). "', + '".addslashes($detail)."','" .$num_compte." ', + '$p_bq_account', + $p_jrn, + 'n')"; + +//----------------------------------------------------- +// Check if no need to rollback when executing the SQL +//----------------------------------------------------- + if ( ExecSql($p_cn,$Sql) == false ) { + Rollback($p_cn); + echo "Rollbacking : $ref_extrait $detail
"; + $LinesSkipped++; + break; + } +//----------------------------------------------------- +// The import is OK +//----------------------------------------------------- + + else { + $LinesImported++; + $row++; + echo "Record imported: $ref_extrait $detail
"; + } + +} +//----------------------------------------------------- +// Close and summary +//----------------------------------------------------- + +fclose($handle); +echo "
$LinesImported operation(s) imported, $LinesSkipped text or invalid +line(s) skipped, $LinesDup operation(s) skipped as already imported
"; +?> \ No newline at end of file