Task #0000874: Amélioration impression journaux

This commit is contained in:
Dany De Bontridder 2013-08-13 06:51:13 +00:00
parent 898c603fcd
commit 5ead468d7d
6 changed files with 35 additions and 21 deletions

View file

@ -1070,6 +1070,8 @@ class Acc_Ledger extends jrn_def_sql
$p_array['TVA'] = array();
$p_array['AMOUNT_TVA'] = 0.0;
$p_array['dep_priv'] = 0;
$p_array['dna'] = 0;
$p_array['tva_dna'] = 0;
$dep_priv = 0.0;
//
// Retrieve data from jrnx
@ -1179,7 +1181,10 @@ class Acc_Ledger extends jrn_def_sql
$purchase->load();
$dep_priv+=$purchase->qp_dep_priv;
$p_array['dep_priv'] = $dep_priv;
$p_array['dna']=$purchase->qp_nd_amount;
$p_array['tva_dna']=$purchase->qp_nd_tva;
}
}
$p_array['TVAC'] = sprintf('% 10.2f', $p_array['TVAC'] );
$p_array['HTVA'] = sprintf('% 10.2f', $p_array['TVAC'] - $p_array['AMOUNT_TVA']);
@ -2912,7 +2917,7 @@ class Acc_Ledger extends jrn_def_sql
if ($this->type == 'ACH')
{
$array = $this->db->get_array('select sum(qp_price) as price,sum(qp_vat) as vat ' .
',sum(qp_dep_priv) as priv' .
',coalesce(sum(qp_nd_amount),0)+coalesce(sum(qp_dep_priv),0) as priv' .
',sum(qp_nd_tva_recup)+sum(qp_nd_tva) as tva_nd' .
' from quant_purchase join jrnx using(j_id)
where j_grpt=$1 ', array($p_jr_id));

View file

@ -59,10 +59,9 @@ class Print_Ledger_Detail extends PDF
//Arial italic 8
$this->SetFont('Arial', 'I', 8);
//Page number
$this->Cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'C');
$this->Ln(3);
$this->Cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'L');
// Created by PhpCompta
$this->Cell(0,8,'Created by Phpcompta, online on http://www.aevalys.eu',0,0,'C',false,'http://www.aevalys.eu');
$this->Cell(0,8,'Created by Phpcompta, online on http://www.aevalys.eu',0,0,'R',false,'http://www.aevalys.eu');
}
function Cell ($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')

View file

@ -104,7 +104,7 @@ class Print_Ledger_Simple extends PDF
$this->Cell(15,6,'HTVA',0,0,'R');
if ( $this->jrn_type=='ACH')
{
$this->Cell(15,6,'Privé',0,0,'R');
$this->Cell(15,6,'Priv/DNA',0,0,'R');
$this->Cell(15,6,'TVA ND',0,0,'R');
}
foreach($this->a_Tva as $line_tva)
@ -181,10 +181,9 @@ class Print_Ledger_Simple extends PDF
//Arial italic 8
$this->SetFont('Arial', 'I', 8);
//Page number
$this->Cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'C');
$this->Ln(3);
$this->Cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'L');
// Created by PhpCompta
$this->Cell(0,8,'Created by Phpcompta, online on http://www.aevalys.eu',0,0,'C',false,'http://www.aevalys.eu');
$this->Cell(0,8,'Created by Phpcompta, online on http://www.aevalys.eu',0,0,'R',false,'http://www.aevalys.eu');
}
function Cell ($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')

View file

@ -132,10 +132,9 @@ class Print_Ledger_Simple_Without_Vat extends PDF
//Arial italic 8
$this->SetFont('Arial', 'I', 8);
//Page number
$this->Cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'C');
$this->Ln(3);
$this->Cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'L');
// Created by PhpCompta
$this->Cell(0,8,'Created by Phpcompta, online on http://www.aevalys.eu',0,0,'C',false,'http://www.aevalys.eu');
$this->Cell(0,8,'Created by Phpcompta, online on http://www.aevalys.eu',0,0,'R',false,'http://www.aevalys.eu');
}
function Cell ($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')

View file

@ -144,17 +144,20 @@ else
$col_tva.='"Tva '.$line_tva['tva_label'].'";';
}
}
echo '"Date";"operation";"Client/Fourn.";"Commentaire";"inter.";"HTVA";privé;'.$col_tva.'"TVAC"'."\n\r";
echo '"Date";"operation";"Client/Fourn.";"Commentaire";"inter.";"HTVA";privé;DNA;tva non ded.;'.$col_tva.'"TVAC"'."\n\r";
foreach ($Row as $line)
{
printf('"%s";"%s";"%s";"%s";"%s";%s;%s;',
printf('"%s";"%s";"%s";"%s";"%s";%s;%s;%s;%s;',
$line['date'],
$line['num'],
$Jrn->get_tiers($line['jrn_def_type'],$line['jr_id']),
$line['comment'],
$line['jr_internal'],
nb($line['HTVA']),
nb($line['dep_priv']));
nb($line['dep_priv']),
nb($line['dna']),
nb($line['tva_dna'])
);
$a_tva_amount=array();
foreach ($line['TVA'] as $lineTVA)
{

View file

@ -64,13 +64,12 @@ $NoPriv = $cn->count_sql("select jrn_def_id,jrn_def_name,jrn_def_class_deb,jrn_d
uj_login='$g_user->id'
and uj_priv ='X'
");
// Pour voir tout les journal ?
if ($NoPriv == 0 && $ret != null)
{
$a = count($ret);
$all = array('value' => 0, 'label' => 'Tous les journaux');
$ret[$a] = $all;
}
/*
* Show all the available ledgers
*/
$a = count($ret);
$all = array('value' => 0, 'label' => 'Tous les journaux disponibles');
$ret[$a] = $all;
if (count($ret) < 1)
NoAccess();
$exercice = (isset($_GET['exercice'])) ? $_GET['exercice'] : $g_user->get_exercice();
@ -255,6 +254,8 @@ if (isset($_REQUEST['bt_html']))
/////////////////////////////////////////////////////////////////////////////////////
elseif ($_GET['p_simple'] == 1)
{
if ( $Jrn->get_type() != 'ACH' && $Jrn->get_type() != 'VEN')
{
// Simple printing
//---
echo '<TABLE class="result">';
@ -307,6 +308,14 @@ if (isset($_REQUEST['bt_html']))
echo "</tr>";
}
echo "</table>";
} else {
/*
* Ledger ACH or VEN
*/
$own=new Own($cn);
require_once 'template/print_ledger_simple.php';
}
}
/////////////////////////////////////////////////////////////////////////////////////
// Détaillé