New : [FP17] Accountancy - Add export of charts of accounts

This commit is contained in:
Alexandre SPANGARO 2017-02-08 06:18:56 +01:00
parent e58743ea5b
commit e4fc52497e
2 changed files with 19 additions and 1 deletions

View File

@ -72,7 +72,7 @@ class modAccounting extends DolibarrModules
$this->conflictwith = array("modComptabilite"); // List of modules are in conflict with this module
$this->phpmin = array(5, 3); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(3, 9); // Minimum version of Dolibarr required by module
$this->langfiles = array("accountancy");
$this->langfiles = array("accountancy","compta");
// Constants
$this->const = array();
@ -288,6 +288,23 @@ class modAccounting extends DolibarrModules
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
// Exports
//--------
$r=0;
$r++;
$this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='Chartofaccounts';
$this->export_icon[$r]='accounting';
$this->export_permission[$r]=array(array("accounting","chartofaccount"));
$this->export_fields_array[$r]=array('ac.rowid'=>'ChartofaccountsId','ac.pcg_version'=>'Chartofaccounts','aa.rowid'=>'Id','aa.account_number'=>"AccountAccounting",'aa.label'=>"Label",'aa.account_parent'=>"Accountparent",'aa.pcg_type'=>"Pcgtype",'aa.pcg_subtype'=>'Pcgsubtype','aa.active'=>'Status');
$this->export_TypeFields_array[$r]=array('ac.rowid'=>'List:accounting_system:pcg_version','aa.account_number'=>"Text",'aa.label'=>"Text",'aa.pcg_type'=>'Text','aa.pcg_subtype'=>'Text','aa.active'=>'Status');
$this->export_entities_array[$r]=array('ac.rowid'=>"accounting",'ac.pcg_version'=>"accounting",'aa.rowid'=>'accounting','aa.account_number'=>"accounting",'aa.label'=>"accounting",'aa.accountparent'=>"accounting",'aa.pcg_type'=>"accounting",'aa.pcgsubtype'=>"accounting",'aa_active'=>"accounting");
$this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'accounting_account as aa, '.MAIN_DB_PREFIX.'accounting_system as ac';
$this->export_sql_end[$r] .=' WHERE ac.pcg_version = aa.fk_pcg_version AND aa.entity IN ('.getEntity('accounting', 1).') ';
}
}

View File

@ -211,6 +211,7 @@ Modelcsv_ciel=Export towards Sage Ciel Compta or Compta Evolution
Modelcsv_quadratus=Export towards Quadratus QuadraCompta
Modelcsv_ebp=Export towards EBP
Modelcsv_cogilog=Export towards Cogilog
ChartofaccountsId=Chart of accounts Id
## Tools - Init accounting account on product / service
InitAccountancy=Init accountancy