[ task #867 ] Remove ESAEB external module code from core

This commit is contained in:
Juanjo Menent 2014-06-27 09:09:08 +02:00
parent 96da5bf0e0
commit 6ce1ef08cf
2 changed files with 3 additions and 67 deletions

View File

@ -5,6 +5,7 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.7 compared to 3.6.* *****
For users:
New: [ task #867 ] Remove ESAEB external module code from core
-
For translators:

View File

@ -1220,8 +1220,7 @@ class BonPrelevement extends CommonObject
/**
* Generate a withdrawal file. Generation Formats:
* France: CFONB
* Spain: AEB19 (if external module EsAEB is enabled)
* European countries: SEPA
* Others: Warning message
* File is generated with name this->filename
*
@ -1242,72 +1241,8 @@ class BonPrelevement extends CommonObject
$found=0;
// Build file for Spain
if ($mysoc->country_code=='ES')
{
if (! empty($conf->esaeb->enabled))
{
$found++;
dol_include_once('/esaeb/class/esaeb19.class.php');
//Head
$esaeb19 = new AEB19DocWritter;
$esaeb19->configuraPresentador($this->numero_national_emetteur,$conf->global->ESAEB_SUFIX_PRESENTADOR,$this->raison_sociale,$this->emetteur_code_banque,$this->emetteur_code_guichet);
$idOrdenante = $esaeb19->agregaOrdenante($this->numero_national_emetteur,$conf->global->ESAEB_SUFIX_ORDENANTE,$this->raison_sociale,$this->emetteur_code_banque,$this->emetteur_code_guichet, $this->emetteur_number_key, $this->emetteur_numero_compte);
$this->total = 0;
$sql = "SELECT pl.rowid, pl.fk_soc, pl.client_nom, pl.code_banque, pl.code_guichet, pl.cle_rib, pl.number, pl.amount,";
$sql.= " f.facnumber, pf.fk_facture";
$sql.= " FROM";
$sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
$sql.= " ".MAIN_DB_PREFIX."facture as f,";
$sql.= " ".MAIN_DB_PREFIX."prelevement_facture as pf";
$sql.= " WHERE pl.fk_prelevement_bons = ".$this->id;
$sql.= " AND pl.rowid = pf.fk_prelevement_lignes";
$sql.= " AND pf.fk_facture = f.rowid";
//Lines
$i = 0;
$resql=$this->db->query($sql);
if ($resql)
{
$num = $this->db->num_rows($resql);
$client = new Societe($this->db);
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);
$client->fetch($obj->fk_soc);
$esaeb19->agregaRecibo(
$idOrdenante,
$client->idprof1,
$obj->client_nom,
$obj->code_banque,
$obj->code_guichet,
$obj->cle_rib,
$obj->number,
$obj->amount,
"Fra.".$obj->facnumber." ".$obj->amount
);
$this->total = $this->total + $obj->amount;
$i++;
}
}
else
{
$result = -2;
}
fputs($this->file, $esaeb19->generaRemesa());
}
}
// Build file for European countries
if (! $found && $mysoc->isInEEC())
if (! $mysoc->isInEEC())
{
$found++;