Skip to content

Commit

Permalink
Merge pull request #5870 from olsesacl/#5340
Browse files Browse the repository at this point in the history
FIX: #5340 Importing Tiers problem with capital field
  • Loading branch information
eldy committed Oct 15, 2016
2 parents 02f4f6d + 567f7e5 commit dda248c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions htdocs/core/modules/import/import_csv.modules.php
Expand Up @@ -504,6 +504,10 @@ function import_insert($arrayrecord,$array_match_file_to_database,$objimport,$ma
}
if (empty($newval)) $arrayrecord[($key-1)]['type']=-1; // If we get empty value, we will use "null"
}
elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='numeric')
{
$newval = price2num($newval);
}

//print 'Val to use as insert is '.$newval.'<br>';
}
Expand Down
3 changes: 2 additions & 1 deletion htdocs/core/modules/modSociete.class.php
Expand Up @@ -405,7 +405,8 @@ function __construct($db)
's.code_client'=>array('rule'=>'getcustomercodeifauto'),
's.code_fournisseur'=>array('rule'=>'getsuppliercodeifauto'),
's.code_compta'=>array('rule'=>'getcustomeraccountancycodeifauto'),
's.code_compta_fournisseur'=>array('rule'=>'getsupplieraccountancycodeifauto')
's.code_compta_fournisseur'=>array('rule'=>'getsupplieraccountancycodeifauto'),
's.capital'=>array('rule'=>'numeric')
);
//$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t');
$this->import_regex_array[$r]=array('s.status'=>'^[0|1]','s.client'=>'^[0|1|2|3]','s.fournisseur'=>'^[0|1]','s.fk_typent'=>'id@'.MAIN_DB_PREFIX.'c_typent','s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]( [0-9][0-9]:[0-9][0-9]:[0-9][0-9])?$');
Expand Down

0 comments on commit dda248c

Please sign in to comment.