Skip to content
Snippets Groups Projects
Commit 4efc0dc6 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

New: Ajout des fonctions export des taxes et charges sociales et leurs reglements.

parent d74190c4
Branches
Tags
No related merge requests found
......@@ -71,7 +71,7 @@ class modTax extends DolibarrModules
$this->depends = array();
$this->requiredby = array();
$this->conflictwith = array();
$this->langfiles = array("compta");
$this->langfiles = array("compta","bills");
// Constantes
$this->const = array();
......@@ -112,6 +112,37 @@ class modTax extends DolibarrModules
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'charges';
$this->rights[$r][5] = 'supprimer';
$r++;
$this->rights[$r][0] = 94;
$this->rights[$r][1] = 'Exporter les charges';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'charges';
$this->rights[$r][5] = 'export';
// Exports
//--------
$r=0;
$r++;
$this->export_code[$r]=$this->id.'_'.$r;
$this->export_label[$r]='Taxes et charges sociales, et leurs ventuels rglements';
$this->export_fields_array[$r]=array('cc.libelle'=>"Type",'c.libelle'=>"Label",'c.date_ech'=>'DateDue','c.periode'=>'Period','c.amount'=>"AmountExpected","c.paye"=>"Status",'p.datep'=>'DatePayment','p.amount'=>'AmountPayment','p.num_paiement'=>'Numero');
$this->export_entities_array[$r]=array('cc.libelle'=>"tax_type",'c.libelle'=>'tax','c.date_ech'=>'tax','c.periode'=>'tax','c.amount'=>"tax","c.paye"=>"tax",'p.datep'=>'payment','p.amount'=>'payment','p.num_paiement'=>'payment');
$this->export_alias_array[$r]=array('cc.libelle'=>"type",'c.libelle'=>'label','c.date_ech'=>'datedue','c.periode'=>'period','c.amount'=>"amount_clamed","c.paye"=>"status",'p.datep'=>'date_payment','p.amount'=>'amount_payment','p.num_paiement'=>'num_payment');
$this->export_sql[$r]="select distinct ";
$i=0;
foreach ($this->export_alias_array[$r] as $key => $value)
{
if ($i > 0) $this->export_sql[$r].=', ';
else $i++;
$this->export_sql[$r].=$key.' as '.$value;
}
$this->export_sql[$r].=' from '.MAIN_DB_PREFIX.'c_chargesociales as cc, '.MAIN_DB_PREFIX.'chargesociales as c LEFT JOIN '.MAIN_DB_PREFIX.'paiementcharge as p ON p.fk_charge = c.rowid WHERE c.fk_type = cc.id';
$this->export_permission[$r]=array(array("tax","charges","export"));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment