diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 116dbbfac6f..27657765ed8 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2012 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -362,6 +363,26 @@ class modSociete extends DolibarrModules //$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t'); $this->import_regex_array[$r]=array('s.birthday'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); $this->import_examplevalues_array[$r]=array('s.fk_soc'=>'MyBigCompany','s.civilite'=>"MR",'s.name'=>"Smith",'s.firstname'=>'John','s.address'=>'61 jump street','s.cp'=>'75000','s.ville'=>'Bigtown','s.fk_pays'=>'US, FR, DE...','s.datec'=>'1972-10-10','s.poste'=>"Director",'s.phone'=>"5551122",'s.phone_perso'=>"5551133",'s.phone_mobile'=>"5551144",'s.fax'=>"5551155",'s.email'=>"johnsmith@email.com",'s.note'=>"My comments"); + + // Import Bank Accounts + $r++; + $this->import_code[$r]=$this->rights_class.'_'.$r; + $this->import_label[$r]="ImportDataset_company_3"; // Translation key + $this->import_icon[$r]='account'; + $this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon + $this->import_tables_array[$r]=array('sr'=>MAIN_DB_PREFIX.'societe_rib'); + $this->import_fields_array[$r]=array('sr.fk_soc'=>"ThirdPartyName*",'sr.bank'=>"Bank", + 'sr.code_banque'=>"BankCode*",'sr.code_guichet'=>"DeskCode*",'sr.number'=>"BankAccountNumber*", + 'sr.cle_rib'=>"BankAccountNumberKey*",'sr.bic'=>"BIC",'sr.iban_prefix'=>"IBAN" + ); + + $this->import_convertvalue_array[$r]=array( + 'sr.fk_soc'=>array('rule'=>'fetchidfromref','classfile'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty') + ); + $this->import_examplevalues_array[$r]=array('sr.fk_soc'=>"MyBigCompany",'sr.bank'=>"ING", + 'sr.code_banque'=>"0000", 'sr.code_guichet'=>"1111",'sr.number'=>"3333333333", + 'sr.cle_rib'=>"22",'sr.bic'=>"USHINGMMXXX",'sr.iban_prefix'=>"US00 0000 1111 22 3333 3333" + ); } diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql index 0cedd43afcb..52f9bbaca51 100755 --- a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql +++ b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql @@ -765,6 +765,7 @@ ALTER TABLE llx_commande_fournisseurdet ADD COLUMN import_key varchar(14) AFTER ALTER TABLE llx_entrepot ADD COLUMN import_key varchar(14) AFTER fk_user_author; ALTER TABLE llx_product_fournisseur_price ADD COLUMN import_key varchar(14) AFTER fk_user; ALTER TABLE llx_product_stock ADD COLUMN import_key varchar(14) AFTER pmp; +ALTER TABLE llx_societe_rib ADD COLUMN import_key varchar(14) AFTER adresse_proprio; -- [ task #146 ] Remove table llx_categorie_association ALTER TABLE llx_categorie_association DROP FOREIGN KEY fk_categorie_asso_fk_categorie_mere; diff --git a/htdocs/install/mysql/tables/llx_societe_rib.sql b/htdocs/install/mysql/tables/llx_societe_rib.sql index b5856284ecc..4d3e555f565 100644 --- a/htdocs/install/mysql/tables/llx_societe_rib.sql +++ b/htdocs/install/mysql/tables/llx_societe_rib.sql @@ -1,6 +1,7 @@ -- ============================================================================= -- Copyright (C) 2000-2004 Rodolphe Quiedeville -- Copyright (C) 2005-2009 Regis Houssin +-- Copyright (C) 2012 Juanjo Menent -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -33,7 +34,8 @@ create table llx_societe_rib iban_prefix varchar(34), -- 34 according to ISO 13616 domiciliation varchar(255), proprio varchar(60), - adresse_proprio varchar(255) + adresse_proprio varchar(255), + import_key varchar(14) -- import key )ENGINE=innodb; diff --git a/htdocs/langs/ca_ES/companies.lang b/htdocs/langs/ca_ES/companies.lang index cfd42da2d18..caa0cfe0174 100644 --- a/htdocs/langs/ca_ES/companies.lang +++ b/htdocs/langs/ca_ES/companies.lang @@ -342,6 +342,7 @@ ExportDataset_company_1=Tercers (empreses/institucions) i atributs ExportDataset_company_2=Contactes de tercers i atributs ImportDataset_company_1=Tercers (empreses/institucions) i atributs ImportDataset_company_2=Contactes (tercers o lliures) i atributs +ImportDataset_company_3=Comptes bancaris PriceLevel=Nivell de preus DeliveriesAddress=Adreça(es) d'enviament DeliveryAddress=Adreça d'enviament diff --git a/htdocs/langs/ca_ES/exports.lang b/htdocs/langs/ca_ES/exports.lang index be2f30d45c8..77d8e30c30b 100644 --- a/htdocs/langs/ca_ES/exports.lang +++ b/htdocs/langs/ca_ES/exports.lang @@ -119,4 +119,8 @@ ExportFieldAutomaticallyAdded=S'ha afegit automàticament el camp %s, ja CsvOptions=Opcions de l'arxiu CSV Separator=Separador Enclosure=Delimitador de camps -SuppliersProducts=Productes de proveïdors \ No newline at end of file +SuppliersProducts=Productes de proveïdors +BankCode=Codi banc +DeskCode=Codi oficina +BankAccountNumber=Número compte +BankAccountNumberKey=Dígit Control \ No newline at end of file diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 60276959b8e..241dcd9f9d5 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -359,6 +359,7 @@ ExportDataset_company_1=Third parties (Companies/foundations) and properties ExportDataset_company_2=Contacts and properties ImportDataset_company_1=Third parties (Companies/foundations) and properties ImportDataset_company_2=Contacts (of thirdparties or not) and attributes +ImportDataset_company_3=Bank details PriceLevel=Price level DeliveriesAddress=Delivery addresses DeliveryAddress=Delivery address diff --git a/htdocs/langs/en_US/exports.lang b/htdocs/langs/en_US/exports.lang index 2d332ff25ca..0031c86240e 100644 --- a/htdocs/langs/en_US/exports.lang +++ b/htdocs/langs/en_US/exports.lang @@ -119,4 +119,8 @@ ExportFieldAutomaticallyAdded=Field %s was automatically added. It will a CsvOptions=Csv Options Separator=Separator Enclosure=Enclosure -SuppliersProducts=Suppliers Products \ No newline at end of file +SuppliersProducts=Suppliers Products +BankCode=Bank code +DeskCode=Desk code +BankAccountNumber=Account number +BankAccountNumberKey=Key \ No newline at end of file diff --git a/htdocs/langs/es_ES/companies.lang b/htdocs/langs/es_ES/companies.lang index 90f1529acd7..9313df97434 100644 --- a/htdocs/langs/es_ES/companies.lang +++ b/htdocs/langs/es_ES/companies.lang @@ -343,6 +343,7 @@ ExportDataset_company_1=Terceros (empresas/instituciones) y atributos ExportDataset_company_2=Contactos de terceros y atributos ImportDataset_company_1=Terceros (empresas/instituciones) y atributos ImportDataset_company_2=Contactos (terceros o libres) y atributos +ImportDataset_company_3=Cuentas bancarias PriceLevel=Nivel de precios DeliveriesAddress=Dirección(es) de envío DeliveryAddress=Dirección de envío diff --git a/htdocs/langs/es_ES/exports.lang b/htdocs/langs/es_ES/exports.lang index 0889e50e1f9..667c2a645e1 100644 --- a/htdocs/langs/es_ES/exports.lang +++ b/htdocs/langs/es_ES/exports.lang @@ -119,4 +119,8 @@ ExportFieldAutomaticallyAdded=Se ha añadido automáticamente el campo %s CsvOptions=Opciones del archivo CSV Separator=Separador Enclosure=Delimitador de campos -SuppliersProducts=Productos de proveedores \ No newline at end of file +SuppliersProducts=Productos de proveedores +BankCode=Código banco +DeskCode=Código oficina +BankAccountNumber=Número cuenta +BankAccountNumberKey=Dígito Control \ No newline at end of file diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index 60c5f8be6aa..f00b80e6aa6 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -360,6 +360,7 @@ ExportDataset_company_1=Tiers (sociétés/institutions) et attributs ExportDataset_company_2=Contacts (de tiers) et attributs ImportDataset_company_1=Tiers (sociétés/institutions) et attributs ImportDataset_company_2=Contacts (de tiers ou libre) et attributs +ImportDataset_company_3=Coordonnées bancaires PriceLevel=Niveau de prix DeliveriesAddress=Adresse(s) de livraison DeliveryAddress=Adresse de livraison diff --git a/htdocs/langs/fr_FR/exports.lang b/htdocs/langs/fr_FR/exports.lang index ca317e2dcbc..4665da31baf 100644 --- a/htdocs/langs/fr_FR/exports.lang +++ b/htdocs/langs/fr_FR/exports.lang @@ -119,4 +119,8 @@ ExportFieldAutomaticallyAdded=Le champ %s a été ajouté automatiquement CsvOptions=Options du fichier Csv Separator=Séparateur de champs Enclosure=Encadrement des chaines de textes -SuppliersProducts=Produits Fournisseurs \ No newline at end of file +SuppliersProducts=Produits Fournisseurs +BankCode=Code banque +DeskCode=Code guichet +BankAccountNumber=Numéro compte +BankAccountNumberKey=Clé RIB \ No newline at end of file