diff --git a/include/class/acc_ledger_history.class.php b/include/class/acc_ledger_history.class.php index 7b2a4b6f7..45b0a0c71 100644 --- a/include/class/acc_ledger_history.class.php +++ b/include/class/acc_ledger_history.class.php @@ -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) diff --git a/include/class/acc_ledger_history_financial.class.php b/include/class/acc_ledger_history_financial.class.php index 0294bd7b9..9b5a1d931 100644 --- a/include/class/acc_ledger_history_financial.class.php +++ b/include/class/acc_ledger_history_financial.class.php @@ -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); } /** diff --git a/include/class/acc_ledger_history_purchase.class.php b/include/class/acc_ledger_history_purchase.class.php index 5f813c2ae..9db214052 100644 --- a/include/class/acc_ledger_history_purchase.class.php +++ b/include/class/acc_ledger_history_purchase.class.php @@ -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']." ". diff --git a/include/class/acc_ledger_history_sale.class.php b/include/class/acc_ledger_history_sale.class.php index aed349554..400de9944 100644 --- a/include/class/acc_ledger_history_sale.class.php +++ b/include/class/acc_ledger_history_sale.class.php @@ -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']." ". diff --git a/include/class/print_ledger.class.php b/include/class/print_ledger.class.php index ac3bf4a4a..ef43f9ea7 100644 --- a/include/class/print_ledger.class.php +++ b/include/class/print_ledger.class.php @@ -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; ; } diff --git a/include/class/print_ledger_misc.class.php b/include/class/print_ledger_misc.class.php index 8534f8be7..72910b4e6 100644 --- a/include/class/print_ledger_misc.class.php +++ b/include/class/print_ledger_misc.class.php @@ -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); diff --git a/include/export/export_ledger_csv.php b/include/export/export_ledger_csv.php index 73e8008cd..82e7203c7 100644 --- a/include/export/export_ledger_csv.php +++ b/include/export/export_ledger_csv.php @@ -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) { diff --git a/include/template/acc_ledger_history_financial_oneline.php b/include/template/acc_ledger_history_financial_oneline.php index 67929719b..bdcff150b 100644 --- a/include/template/acc_ledger_history_financial_oneline.php +++ b/include/template/acc_ledger_history_financial_oneline.php @@ -28,7 +28,9 @@ if (!defined('ALLOWED')) ?> + + @@ -41,9 +43,15 @@ if (!defined('ALLOWED')) $class=($i%2==0)?' class="even" ':' class="odd" '; ?> > + + "; // Date - echo ""; - echo ""; + echo ""; + echo ""; // Internal with detail echo ""; diff --git a/include/template/acc_ledger_history_purchase_extended.php b/include/template/acc_ledger_history_purchase_extended.php index a30de3321..8f7b4eec1 100644 --- a/include/template/acc_ledger_history_purchase_extended.php +++ b/include/template/acc_ledger_history_purchase_extended.php @@ -69,10 +69,10 @@ for ($i=0;$i<$nb_data;$i++): ?> > > "; // Date - echo ""; - echo ""; + echo ""; + echo ""; // Internal with detail echo ""; diff --git a/include/template/acc_ledger_history_sale_extended.php b/include/template/acc_ledger_history_sale_extended.php index effaf4365..4e7fa1856 100644 --- a/include/template/acc_ledger_history_sale_extended.php +++ b/include/template/acc_ledger_history_sale_extended.php @@ -69,10 +69,10 @@ for ($i=0;$i<$nb_data;$i++): ?> > >
+ data[$i]['str_date']?> + data[$i]['bk_qcode']; ?> + data[$i]['jr_pj_number']; ?> + data[$i]['tiers_f_id'], diff --git a/include/template/acc_ledger_history_purchase_detail.php b/include/template/acc_ledger_history_purchase_detail.php index ea39c3fc7..d563af211 100644 --- a/include/template/acc_ledger_history_purchase_detail.php +++ b/include/template/acc_ledger_history_purchase_detail.php @@ -79,8 +79,8 @@ foreach ($this->data as $line) { echo "" . h($line['jr_pj_number']) . "" . smaller_date($line['jr_date']) . "" . smaller_date($line['jr_date_paid']) . "" . smaller_date($line['str_date']) . "" . smaller_date($line['str_date_paid']) . "" . HtmlInput::detail_op($line['jr_id'], $line['jr_internal']) . "
- data[$i]['jr_date']?> + data[$i]['str_date']?> - data[$i]['jr_date_paid']?> + data[$i]['str_date_paid']?> data[$i]['jr_pj_number']?> diff --git a/include/template/acc_ledger_history_purchase_oneline.php b/include/template/acc_ledger_history_purchase_oneline.php index 3a6d78320..f60544d97 100644 --- a/include/template/acc_ledger_history_purchase_oneline.php +++ b/include/template/acc_ledger_history_purchase_oneline.php @@ -84,10 +84,10 @@ for ($i=0;$i<$nb_data;$i++): ?>
- data[$i]['jr_date']?> + data[$i]['str_date']?> - data[$i]['jr_date_paid']?> + data[$i]['str_date_paid']?> data[$i]['jr_pj_number']?> diff --git a/include/template/acc_ledger_history_sale_detail.php b/include/template/acc_ledger_history_sale_detail.php index a48516380..e747884a3 100644 --- a/include/template/acc_ledger_history_sale_detail.php +++ b/include/template/acc_ledger_history_sale_detail.php @@ -77,8 +77,8 @@ foreach ($this->data as $line) { echo "" . h($line['jr_pj_number']) . "" . smaller_date($line['jr_date']) . "" . smaller_date($line['jr_date_paid']) . "" . smaller_date($line['str_date']) . "" . smaller_date($line['str_date_paid']) . "" . HtmlInput::detail_op($line['jr_id'], $line['jr_internal']) . "
- data[$i]['jr_date']?> + data[$i]['str_date']?> - data[$i]['jr_date_paid']?> + data[$i]['str_date_paid']?> data[$i]['jr_pj_number']?> diff --git a/include/template/acc_ledger_history_sale_oneline.php b/include/template/acc_ledger_history_sale_oneline.php index 45e1294b5..a24b9ee11 100644 --- a/include/template/acc_ledger_history_sale_oneline.php +++ b/include/template/acc_ledger_history_sale_oneline.php @@ -70,10 +70,10 @@ for ($i=0;$i<$nb_data;$i++): ?>
- data[$i]['jr_date']?> + data[$i]['str_date']?> - data[$i]['jr_date_paid']?> + data[$i]['str_date_paid']?> data[$i]['jr_pj_number']?>