diff --git a/html/jrn_csv.php b/html/jrn_csv.php
index 0b6648d7c..27e189308 100644
--- a/html/jrn_csv.php
+++ b/html/jrn_csv.php
@@ -74,8 +74,9 @@ if ( $_GET['p_simple'] == 0 )
$desc=str_replace('"',"'",$desc);
$desc=str_replace(";",",",$desc);
- printf("\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";%s;%s\n",
+ printf("\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";%s;%s\n",
$op['j_id'],
+ $op['jr_pj_number'],
$op['internal'],
$op['j_date'],
$op['poste'],
diff --git a/html/poste_csv.php b/html/poste_csv.php
index 9737638b2..815441578 100644
--- a/html/poste_csv.php
+++ b/html/poste_csv.php
@@ -44,11 +44,11 @@ $User->can_request(IMPPOSTE,0);
if ( isset ( $_REQUEST['poste_fille']) )
{ //choisit de voir tous les postes
- $a_poste=$cn->get_array("select pcm_val from tmp_pcmn where pcm_val::text like '".$_REQUEST["poste_id"]."%'");
+ $a_poste=$cn->get_array("select pcm_val from tmp_pcmn where pcm_val::text like $1||'%'",array($_REQUEST["poste_id"]));
}
else
{
- $a_poste=$cn->get_array("select pcm_val from tmp_pcmn where pcm_val = '".$_REQUEST['poste_id']."'");
+ $a_poste=$cn->get_array("select pcm_val from tmp_pcmn where pcm_val = $1",array($_REQUEST['poste_id']));
}
if ( ! isset ($_REQUEST['oper_detail']))
@@ -61,13 +61,15 @@ if ( ! isset ($_REQUEST['oper_detail']))
$Poste=new Acc_Account_Ledger($cn,$pos['pcm_val']);
$name=$Poste->get_name();
list($array,$tot_deb,$tot_cred)=$Poste->get_row_date( $_REQUEST['from_periode'],
- $_REQUEST['to_periode'],
- $_GET['ople']
- );
+ $_REQUEST['to_periode'],
+ $_GET['ople']
+ );
if ( count($Poste->row ) == 0 )
continue;
- echo '"Poste";'.'"Lib.";'.
+ echo '"Poste";'.
+ '"n° pièce";'.
+ '"Lib.";'.
"\"Code interne\";".
"\"Date\";".
"\"Description\";".
@@ -81,10 +83,11 @@ if ( ! isset ($_REQUEST['oper_detail']))
{
$prog+=$op['deb_montant']-$op['cred_montant'];
echo '"'.$pos['pcm_val'].'";'.
+ '"'.$op['jr_pj_number'].'"'.";".
'"'.$name.'";'.
'"'.$op['jr_internal'].'"'.";".
'"'.$op['j_date_fmt'].'"'.";".
- '"'.$op['description']." ".$op['jr_pj_number'].'"'.";".
+ '"'.$op['description'].'",'.
nb($op['deb_montant']).";".
nb($op['cred_montant']).";".
nb(abs($prog));
diff --git a/html/poste_pdf.php b/html/poste_pdf.php
index 69bdf77a4..369cb3d4f 100644
--- a/html/poste_pdf.php
+++ b/html/poste_pdf.php
@@ -111,7 +111,10 @@ foreach ($a_poste as $poste)
$date=shrink_date($row['j_date_fmt']);
$pdf->Cell($size[$l],6,$date,0,0,$align[$l]);
$l++;
- $pdf->Cell($size[$l],6,$row['jr_internal'],0,0,$align[$l]);
+ if ( $row['jr_pj_number'] == '')
+ $pdf->Cell($size[$l],6,$row['jr_internal'],0,0,$align[$l]);
+ else
+ $pdf->Cell($size[$l],6,$row['jr_pj_number'],0,0,$align[$l]);
$l++;
$pdf->Cell($size[$l],6,substr($row['jrn_name'],0,14),0,0,$align[$l]);
$l++;
diff --git a/html/quick_code_csv.php b/html/quick_code_csv.php
index d02ef03a9..1780cf2e6 100644
--- a/html/quick_code_csv.php
+++ b/html/quick_code_csv.php
@@ -56,12 +56,14 @@ if ( count($Fiche->row ) == 0 )
if ( ! isset ($_REQUEST['oper_detail']))
{
echo '"Qcode";'.
- "\"Code interne\";".
"\"Date\";".
+ "\"n° pièce\";".
+ "\"Code interne\";".
"\"Description\";".
"\"Débit\";".
"\"Crédit\";".
- "\"Prog.\"";
+ "\"Prog.\";".
+ "\"Let.\"" ;
printf("\n");
$progress=0;
foreach ( $Fiche->row as $op )
@@ -69,21 +71,22 @@ if ( ! isset ($_REQUEST['oper_detail']))
$progress+=$op['deb_montant']-$op['cred_montant'];
echo '"'.$op['j_qcode'].'";'.
- '"'.$op['jr_internal'].'"'.";".
- '"'.$op['j_date_fmt'].'"'.";".
- '"'.$op['description'].'"'.";".
- nb($op['deb_montant']).";".
- nb($op['cred_montant']).";".
- nb(abs($progress));
+ '"'.$op['j_date_fmt'].'"'.";".
+ '"'.$op['jr_pj_number'].'"'.";".
+ '"'.$op['jr_internal'].'"'.";".
+ '"'.$op['description'].'"'.";".
+ nb($op['deb_montant']).";".
+ nb($op['cred_montant']).";".
+ nb(abs($progress)).';'.
+ '"'.(($op['letter']==-1)?'':$op['letter']).'"';
printf("\n");
}
}
else
{
- echo '"Poste";"Qcode";"internal";';
- echo '"Date";'.
- "\"Description\";".
+ echo '"Poste";"Qcode";"date";"ref";"internal";';
+ echo "\"Description\";".
"\"Montant\";".
"\"D/C\"";
@@ -99,8 +102,9 @@ else
printf('"%s";"%s";"%s";"%s";"%s";%s;"%s"',
$r['j_poste'],
$r['j_qcode'],
- $r['jr_internal'],
$r['jr_date'],
+ $op['jr_pj_number'],
+ $r['jr_internal'],
$r['description'],
nb($r['j_montant']),
$r['debit']);
diff --git a/html/quick_code_pdf.php b/html/quick_code_pdf.php
index 676daade5..8397a8178 100644
--- a/html/quick_code_pdf.php
+++ b/html/quick_code_pdf.php
@@ -94,11 +94,16 @@ for ($e=0;$eCell($size[$l],6,$date,0,0,$align[$l]);
$l++;
- $pdf->Cell($size[$l],6,$row['jr_internal'],0,0,$align[$l]);
+ if ( $row['jr_pj_number'] == '')
+ $pdf->Cell($size[$l],6,"",0,0,$align[$l]);
+ else
+ $pdf->Cell($size[$l],6,$row['jr_pj_number'],0,0,$align[$l]);
+
$l++;
$pdf->Cell($size[$l],6,substr($row['jrn_name'],0,14),0,0,$align[$l]);
$l++;
- $pdf->Cell($size[$l],6,$row['description'],0,0,$align[$l]);
+ $pdf->Cell($size[$l],6,$row['description'].'('.$row['jr_internal'].')',0,0,$align[$l]);
+
$l++;
$pdf->Cell($size[$l],6,(($row['letter']!=-1)?$row['letter']:''),0,0,$align[$l]);
$l++;
diff --git a/include/class_acc_account_ledger.php b/include/class_acc_account_ledger.php
index 8dc121892..23fe4b8d1 100644
--- a/include/class_acc_account_ledger.php
+++ b/include/class_acc_account_ledger.php
@@ -135,7 +135,7 @@ class Acc_Account_Ledger
" ( to_date($2,'DD.MM.YYYY') <= j_date and ".
" to_date($3,'DD.MM.YYYY') >= j_date )".
" and $filter_sql $sql_let ".
- " order by j_date",array($this->id,$p_from,$p_to));
+ " order by j_date,substring(jr_pj_number,'\\\\d+$') asc",array($this->id,$p_from,$p_to));
return $this->get_row_sql($Res);
}
@@ -311,8 +311,9 @@ class Acc_Account_Ledger
echo "