BUG import bank : fortis
This commit is contained in:
parent
710c5f8d3b
commit
9220fca807
3 changed files with 19 additions and 7 deletions
6
html/admin/sql/patch/upgrade55.sql
Normal file
6
html/admin/sql/patch/upgrade55.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
begin;
|
||||
alter table import_tmp alter bq_account type text;
|
||||
|
||||
update version set val=56;
|
||||
|
||||
commit;
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
*/
|
||||
require_once ('config.inc.php');
|
||||
|
||||
define ("DBVERSION",55);
|
||||
define ("DBVERSION",56);
|
||||
|
||||
define ("MAX_COMPTE",4);
|
||||
define ('MAX_BUD_DETAIL',20);
|
||||
|
|
|
|||
|
|
@ -27,15 +27,20 @@
|
|||
// Fortis Bank
|
||||
//-----------------------------------------------------
|
||||
$row=1;
|
||||
$must_field=7; // The mandatory number of fields
|
||||
while (($data = fgetcsv($handle, 2000,'@')) !== FALSE) {
|
||||
$num = count($data);
|
||||
|
||||
for ($c=0; $c < $num; $c++) {
|
||||
|
||||
$nb_field=substr_count($data[$c],";");
|
||||
// first line is skipped
|
||||
if ( $row>1) {
|
||||
if ( $row>1 && $nb_field == $must_field) {
|
||||
|
||||
$code=""; $date_exec=""; $date_valeur=""; $montant=""; $devise=""; $compte_ordre=""; $detail=""; $num_compte=""; $iduser="";
|
||||
$code=""; $date_exec="";
|
||||
$date_valeur=""; $montant=""; $devise=""; $compte_ordre=""; $detail=""; $num_compte=""; $iduser="";
|
||||
|
||||
|
||||
|
||||
list($code, $date_exec, $date_valeur, $montant, $devise, $compte_ordre, $detail, $num_compte) = split(";", $data[$c]);
|
||||
echo "line : $row > ".$data[$c]."<hr>";
|
||||
|
||||
|
|
@ -76,10 +81,10 @@ while (($data = fgetcsv($handle, 2000,'@')) !== FALSE) {
|
|||
$Res=ExecSql($p_cn,$sql);
|
||||
$Num=pg_NumRows($Res);
|
||||
|
||||
if($Num > 0) {
|
||||
if($Num > 0 ) {
|
||||
echo "Opération FORTIS ".$code." déj&eagrave; importée.<br/>";
|
||||
} else {
|
||||
$Sql="insert into import_tmp (code ,
|
||||
$Sql="insert into import_tmp (code ,
|
||||
date_exec ,
|
||||
date_valeur,
|
||||
montant,
|
||||
|
|
@ -102,7 +107,8 @@ while (($data = fgetcsv($handle, 2000,'@')) !== FALSE) {
|
|||
$p_jrn,
|
||||
'n')";
|
||||
|
||||
$Res=ExecSql($p_cn,$Sql,'latin1');
|
||||
$Res=ExecSql($p_cn,$Sql);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue