Task #1654 - PRINTJRN : Opération mal classé
#0001654 : PRINTJRN , opérations mal classées, date malformée, ...
This commit is contained in:
parent
e20c151ef0
commit
9bb7edbdc8
14 changed files with 57 additions and 35 deletions
|
|
@ -125,6 +125,11 @@ abstract class Acc_Ledger_History
|
|||
|
||||
/**
|
||||
* Build the right object
|
||||
* @param Database $cn database conx
|
||||
* @param array $pa_ledger ledger of array
|
||||
* @param integer $p_from periode id
|
||||
* @param integer $p_to periode id
|
||||
* @param char $p_mode L (list operation) E (extended detail) A (accouting writing) D (Detailled VAT)
|
||||
* @return Acc_Ledger_History_Generic Acc_Ledger_History_Sale Acc_Ledger_History_Financial Acc_Ledger_History_Purchase
|
||||
*/
|
||||
static function factory(Database $cn, $pa_ledger, $p_from, $p_to, $p_mode)
|
||||
|
|
|
|||
|
|
@ -119,8 +119,8 @@ class Acc_Ledger_History_Financial extends Acc_Ledger_History
|
|||
tiers.qcode as tiers_qcode,
|
||||
jr_id,
|
||||
jr_pj_number,
|
||||
jr_date,
|
||||
jr_date_paid,
|
||||
to_char(jr_date,'DD.MM.YYYY') as str_date,
|
||||
to_char(jr_date_paid,'DD.MM.YYYY') as str_date_paid,
|
||||
jr_internal,
|
||||
jrn.jr_comment,
|
||||
jr_pj_name,
|
||||
|
|
@ -133,7 +133,8 @@ class Acc_Ledger_History_Financial extends Acc_Ledger_History
|
|||
where
|
||||
jr_def_id in ({$ledger_list})
|
||||
and {$periode}
|
||||
{$cond_limite}";
|
||||
{$cond_limite}
|
||||
order by jr_date, substring(jr_pj_number,'[0-9]+$')::numeric ";
|
||||
$this->data=$this->db->get_array($sql);
|
||||
}
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -139,8 +139,8 @@ class Acc_Ledger_History_Purchase extends Acc_Ledger_History
|
|||
qcode,
|
||||
jr_id,
|
||||
jr_pj_number,
|
||||
jr_date,
|
||||
jr_date_paid,
|
||||
to_char(jr_date,'DD.MM.YYYY') as str_date,
|
||||
to_char(jr_date_paid,'DD.MM.YYYY') as str_date_paid,
|
||||
jr_internal,
|
||||
qp_supplier,
|
||||
jrn.jr_comment,
|
||||
|
|
@ -161,7 +161,8 @@ class Acc_Ledger_History_Purchase extends Acc_Ledger_History
|
|||
where
|
||||
jr_def_id in ({$ledger_list})
|
||||
and {$periode}
|
||||
{$cond_limite}";
|
||||
{$cond_limite}
|
||||
order by jrn.jr_date, substring(jr_pj_number,'[0-9]+$')::numeric ";
|
||||
$this->data=$this->db->get_array($sql);
|
||||
}
|
||||
|
||||
|
|
@ -272,8 +273,8 @@ class Acc_Ledger_History_Purchase extends Acc_Ledger_History
|
|||
|
||||
foreach ($this->data as $line)
|
||||
{
|
||||
$export->add($line['jr_date']);
|
||||
$export->add($line['jr_date_paid']);
|
||||
$export->add($line['str_date']);
|
||||
$export->add($line['str_date_paid']);
|
||||
$export->add($line['jr_id']);
|
||||
$export->add($line['jr_pj_number']);
|
||||
$export->add($line['name']." ".
|
||||
|
|
|
|||
|
|
@ -133,8 +133,8 @@ class Acc_Ledger_History_Sale extends Acc_Ledger_History
|
|||
qcode,
|
||||
jr_id,
|
||||
jr_pj_number,
|
||||
jr_date,
|
||||
jr_date_paid,
|
||||
to_char(jr_date,'DD.MM.YYYY') as str_date,
|
||||
to_char(jr_date_paid,'DD.MM.YYYY') as str_date_paid,
|
||||
jr_internal,
|
||||
qs_client,
|
||||
jrn.jr_comment,
|
||||
|
|
@ -150,7 +150,8 @@ class Acc_Ledger_History_Sale extends Acc_Ledger_History
|
|||
where
|
||||
jr_def_id in ({$ledger_list})
|
||||
and {$periode}
|
||||
{$cond_limite}";
|
||||
{$cond_limite}
|
||||
order by jr_date, substring(jr_pj_number,'[0-9]+$')::numeric ";
|
||||
$this->data=$this->db->get_array($sql);
|
||||
|
||||
}
|
||||
|
|
@ -264,8 +265,8 @@ class Acc_Ledger_History_Sale extends Acc_Ledger_History
|
|||
|
||||
foreach ($this->data as $line)
|
||||
{
|
||||
$export->add($line['jr_date']);
|
||||
$export->add($line['jr_date_paid']);
|
||||
$export->add($line['str_date']);
|
||||
$export->add($line['str_date_paid']);
|
||||
$export->add($line['jr_id']);
|
||||
$export->add($line['jr_pj_number']);
|
||||
$export->add($line['name']." ".
|
||||
|
|
|
|||
|
|
@ -83,8 +83,14 @@ class Print_Ledger {
|
|||
return $pdf;
|
||||
}
|
||||
}
|
||||
else
|
||||
elseif ($jrn_type=='FIN')
|
||||
{
|
||||
$pdf=new Print_Ledger_Financial($cn, $p_ledger);
|
||||
return $pdf;
|
||||
} else
|
||||
{
|
||||
return new Print_Ledger_Detail($cn, $p_ledger);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
|
|
@ -141,7 +147,7 @@ class Print_Ledger {
|
|||
$jrn_type=$p_ledger->get_type();
|
||||
if ($jrn_type=='FIN')
|
||||
{
|
||||
$pdf=new Print_Ledger_Financial($cn, $p_ledger);
|
||||
$pdf=new Print_Ledger_Detail($cn, $p_ledger);
|
||||
return $pdf;
|
||||
;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,12 +40,12 @@ class Print_Ledger_Misc extends PDF
|
|||
//Line break
|
||||
$this->Ln(20);
|
||||
$this->SetFont('DejaVu', 'B', 7);
|
||||
$this->Cell(30,6,'Piece');
|
||||
$this->Cell(10,6,'Date');
|
||||
$this->Cell(20,6,'Interne');
|
||||
$this->Cell(25,6,'Tiers');
|
||||
$this->Cell(80,6,'Commentaire');
|
||||
$this->Cell(15,6,'Montant');
|
||||
$this->Cell(10,6,_('Date'));
|
||||
$this->Cell(30,6,_('Piece'));
|
||||
$this->Cell(20,6,_('Interne'));
|
||||
$this->Cell(25,6,_('Tiers'));
|
||||
$this->Cell(80,6,_('Commentaire'));
|
||||
$this->Cell(15,6,_('Montant'));
|
||||
$this->Ln(6);
|
||||
|
||||
}
|
||||
|
|
@ -78,8 +78,8 @@ class Print_Ledger_Misc extends PDF
|
|||
{
|
||||
$row=$a_jrn[$i];
|
||||
|
||||
$this->LongLine(30,5,$row['jr_pj_number']);
|
||||
$this->write_cell(10,5, smaller_date($row['date']));
|
||||
$this->LongLine(30,5,$row['jr_pj_number']);
|
||||
$this->write_cell(20,5,$row['jr_internal']);
|
||||
$type=$this->cn->get_value("select jrn_def_type from jrn_def where jrn_def_id=$1",array($a_jrn[$i]['jr_def_id']));
|
||||
$other=mb_substr($this->ledger->get_tiers($type,$a_jrn[$i]['jr_id']),0,25);
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ if ( $get_option=="E")
|
|||
{
|
||||
if ($jrn_type=='FIN')
|
||||
{
|
||||
$get_option='L';
|
||||
$get_option='A';
|
||||
}
|
||||
elseif ($jrn_type=='ODS'||$Jrn->id==0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,7 +28,9 @@ if (!defined('ALLOWED'))
|
|||
?>
|
||||
<table class="result">
|
||||
<tr>
|
||||
<th><?= _('Date') ?></th>
|
||||
<th><?= _('Banque') ?></th>
|
||||
<th><?=_('Pièce')?></th>
|
||||
<th><?= _("Tiers") ?></th>
|
||||
<th><?= _("Libellé") ?></th>
|
||||
<th><?= _("Montant") ?></th>
|
||||
|
|
@ -41,9 +43,15 @@ if (!defined('ALLOWED'))
|
|||
$class=($i%2==0)?' class="even" ':' class="odd" ';
|
||||
?>
|
||||
<tr <?= $class ?> >
|
||||
<td>
|
||||
<?=$this->data[$i]['str_date']?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->data[$i]['bk_qcode']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->data[$i]['jr_pj_number']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo HtmlInput::history_card($this->data[$i]['tiers_f_id'],
|
||||
|
|
|
|||
|
|
@ -79,8 +79,8 @@ foreach ($this->data as $line) {
|
|||
echo "<TD>" . h($line['jr_pj_number']) . "</TD>";
|
||||
|
||||
// Date
|
||||
echo "<TD>" . smaller_date($line['jr_date']) . "</TD>";
|
||||
echo "<TD>" . smaller_date($line['jr_date_paid']) . "</TD>";
|
||||
echo "<TD>" . smaller_date($line['str_date']) . "</TD>";
|
||||
echo "<TD>" . smaller_date($line['str_date_paid']) . "</TD>";
|
||||
|
||||
// Internal with detail
|
||||
echo "<TD>" . HtmlInput::detail_op($line['jr_id'], $line['jr_internal']) . "</TD>";
|
||||
|
|
|
|||
|
|
@ -69,10 +69,10 @@ for ($i=0;$i<$nb_data;$i++):
|
|||
?>
|
||||
<tr <?=$odd?> >
|
||||
<td>
|
||||
<?=$this->data[$i]['jr_date']?>
|
||||
<?=$this->data[$i]['str_date']?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$this->data[$i]['jr_date_paid']?>
|
||||
<?=$this->data[$i]['str_date_paid']?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$this->data[$i]['jr_pj_number']?>
|
||||
|
|
|
|||
|
|
@ -84,10 +84,10 @@ for ($i=0;$i<$nb_data;$i++):
|
|||
?>
|
||||
<tr <?=$odd?> >
|
||||
<td>
|
||||
<?=$this->data[$i]['jr_date']?>
|
||||
<?=$this->data[$i]['str_date']?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$this->data[$i]['jr_date_paid']?>
|
||||
<?=$this->data[$i]['str_date_paid']?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$this->data[$i]['jr_pj_number']?>
|
||||
|
|
|
|||
|
|
@ -77,8 +77,8 @@ foreach ($this->data as $line) {
|
|||
echo "<TD>" . h($line['jr_pj_number']) . "</TD>";
|
||||
|
||||
// Date
|
||||
echo "<TD>" . smaller_date($line['jr_date']) . "</TD>";
|
||||
echo "<TD>" . smaller_date($line['jr_date_paid']) . "</TD>";
|
||||
echo "<TD>" . smaller_date($line['str_date']) . "</TD>";
|
||||
echo "<TD>" . smaller_date($line['str_date_paid']) . "</TD>";
|
||||
|
||||
// Internal with detail
|
||||
echo "<TD>" . HtmlInput::detail_op($line['jr_id'], $line['jr_internal']) . "</TD>";
|
||||
|
|
|
|||
|
|
@ -69,10 +69,10 @@ for ($i=0;$i<$nb_data;$i++):
|
|||
?>
|
||||
<tr <?=$odd?> >
|
||||
<td>
|
||||
<?=$this->data[$i]['jr_date']?>
|
||||
<?=$this->data[$i]['str_date']?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$this->data[$i]['jr_date_paid']?>
|
||||
<?=$this->data[$i]['str_date_paid']?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$this->data[$i]['jr_pj_number']?>
|
||||
|
|
|
|||
|
|
@ -70,10 +70,10 @@ for ($i=0;$i<$nb_data;$i++):
|
|||
?>
|
||||
<tr <?=$odd?> >
|
||||
<td>
|
||||
<?=$this->data[$i]['jr_date']?>
|
||||
<?=$this->data[$i]['str_date']?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$this->data[$i]['jr_date_paid']?>
|
||||
<?=$this->data[$i]['str_date_paid']?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$this->data[$i]['jr_pj_number']?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue