[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 110/218: Currency : All ledger's listing mode
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 110/218: Currency : All ledger's listing mode , html , csv and pdf |
Date: |
Thu, 12 Sep 2019 15:58:50 -0400 (EDT) |
sparkyx pushed a commit to branch entreprise
in repository noalyss.
commit 5dda688b9dd1039d6396fcee3d024fba73bf7460
Author: Dany De Bontridder <address@hidden>
Date: Wed Dec 5 08:51:10 2018 +0100
Currency : All ledger's listing mode , html , csv and pdf
---
include/class/acc_ledger_history_generic.class.php | 18 +++++++++++++-----
include/class/print_ledger_misc.class.php | 14 +++++++++-----
include/export/export_ledger_csv.php | 11 ++++++++---
3 files changed, 30 insertions(+), 13 deletions(-)
diff --git a/include/class/acc_ledger_history_generic.class.php
b/include/class/acc_ledger_history_generic.class.php
index 95729ca..5fd4e3c 100644
--- a/include/class/acc_ledger_history_generic.class.php
+++ b/include/class/acc_ledger_history_generic.class.php
@@ -449,7 +449,6 @@ class Acc_Ledger_History_Generic extends Acc_Ledger_History
join jrn as jrn2 on (j_grpt=jrn2.jr_grpt_Id)
where
j_id in (select j_id from jrnx where
j_grpt=jrn2.jr_grpt_id)
- and j_debit='t'
group by jr_id
) as OC1 using (jr_id)
WHERE $periode and $jrn order by
jr_date,substring(jrn.jr_pj_number,'[0-9]+$')::numeric asc $cond_limite";
@@ -521,9 +520,11 @@ class Acc_Ledger_History_Generic extends Acc_Ledger_History
jrn_def_type,
jr_rapt as oc, j_tech_per as periode,
j_id,
- currency_id,
- currency_rate,
- currency_rate_ref
+ jrn.currency_id,
+ jrn.currency_rate,
+ jrn.currency_rate_ref,
+ operation_currency.oc_amount,
+ operation_currency.oc_vat_amount
from jrnx
join jrn on (jr_grpt_id=j_grpt )
left join operation_currency using (j_id)
@@ -702,6 +703,7 @@ class Acc_Ledger_History_Generic extends Acc_Ledger_History
th(_("internal")).
th(_("Tiers")).
th(_("Commentaire")).
+ th(_("Devise")).
th(_("Total opération")).
"</TR>";
// set a filter for the FIN
@@ -719,6 +721,12 @@ class Acc_Ledger_History_Generic extends Acc_Ledger_History
$tiers=$this->get_tiers($line['jrn_def_type'], $line['jr_id']);
echo td($tiers);
echo "<TD>".h($line['comment'])."</TD>";
+ if ( $line['currency_id'] != 0) {
+ echo
td(bcadd($line['sum_ocamount'],$line['sum_ocvat_amount'])."
".$line['cr_code_iso'],'class="num"');
+ } else {
+ echo td("");
+ }
+
// echo "<TD>".$line['pj']."</TD>";
@@ -756,7 +764,7 @@ class Acc_Ledger_History_Generic extends Acc_Ledger_History
}
echo '<tr class="highlight">';
echo '<td>'._('Totaux').'</td>';
- echo td().td().td().td();
+ echo td().td().td().td().td();
echo '<td class="num">'.nbm($tot_amount).'</td>';
echo '</tr>';
echo "</table>";
diff --git a/include/class/print_ledger_misc.class.php
b/include/class/print_ledger_misc.class.php
index 72910b4..ece4cc6 100644
--- a/include/class/print_ledger_misc.class.php
+++ b/include/class/print_ledger_misc.class.php
@@ -44,8 +44,9 @@ class Print_Ledger_Misc extends PDF
$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->Cell(60,6,_('Commentaire'));
+ $this->Cell(20,6,_('Devise'),0,0,'R');
+ $this->Cell(15,6,_('Montant'),0,0,'R');
$this->Ln(6);
}
@@ -70,8 +71,10 @@ class Print_Ledger_Misc extends PDF
*/
function export()
{
- $a_jrn=$this->ledger->get_rowSimple($_GET['from_periode'],
- $_GET['to_periode']);
+ $http=new HttpInput();
+
+
$a_jrn=$this->ledger->get_rowSimple($http->get('from_periode','number'),
+ $http->get('to_periode','number'));
$this->SetFont('DejaVu', '', 6);
if ( $a_jrn == null ) return;
for ( $i=0;$i<count($a_jrn);$i++)
@@ -85,11 +88,12 @@ class Print_Ledger_Misc extends PDF
$other=mb_substr($this->ledger->get_tiers($type,$a_jrn[$i]['jr_id']),0,25);
$this->LongLine(25,5,$other,0,'L');
$positive=$row['montant'];
- $this->LongLine(80,5,$row['comment'],0,'L');
+ $this->LongLine(60,5,$row['comment'],0,'L');
if ( $type == 'FIN' ) {
$positive = $this->cn->get_value("select qf_amount from
quant_fin ".
" where jr_id=".$row['jr_id']);
}
+
$this->write_cell(20,5,nbm(bcadd($row['sum_ocvat_amount'],$row['sum_ocamount']),4).$row['cr_code_iso'],0,0,'R');
$this->write_cell(15,5,nbm($positive),0,0,'R');
$this->line_new(5);
diff --git a/include/export/export_ledger_csv.php
b/include/export/export_ledger_csv.php
index 16b9e2d..4ab8799 100644
--- a/include/export/export_ledger_csv.php
+++ b/include/export/export_ledger_csv.php
@@ -178,9 +178,9 @@ if ($get_option=='A')
$acc_ledger_history->export_csv();
exit;
}
-/**
- * Mode list for ODS , FIN and GL
- */
+//-----------------------------------------------------------------------------
+// Mode list for ODS , FIN and GL
+//-----------------------------------------------------------------------------
if ($get_option=="L" && ($jrn_type=='ODS'||$jrn_type=='FIN'||$jrn_type=='GL') )
{
if ( $get_jrn==0) {
@@ -215,6 +215,8 @@ if ($get_option=="L" &&
($jrn_type=='ODS'||$jrn_type=='FIN'||$jrn_type=='GL') )
$title[]=_("montant");
$title[]=_("montant devise");
$title[]=_("devise");
+ $title[]=_("taux");
+ $title[]=_("taux réf");
$export->write_header($title);
foreach ($Row as $line)
{
@@ -249,6 +251,9 @@ if ($get_option=="L" &&
($jrn_type=='ODS'||$jrn_type=='FIN'||$jrn_type=='GL') )
//-- add currency
$export->add(bcadd($line['sum_ocamount'],$line['sum_ocvat_amount']),"number");
$export->add($line['cr_code_iso']);
+ $export->add($line['currency_rate']);
+ $export->add($line['currency_rate_ref']);
+
//------ Add reconcilied operation ---------------
$ret_reconcile=$cn->execute('reconcile_date_csv',
array($line['jr_id']));
- [Noalyss-commit] [noalyss] 102/218: Version DB 131, (continued)
- [Noalyss-commit] [noalyss] 102/218: Version DB 131, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 101/218: Currency : SQL quant_fin is adapted, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 103/218: reverse for quant_fin, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 100/218: Currency : financial use the rate depending of the operation date, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 94/218: acc_ledger_fin : cosmetic : input, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 99/218: Modify quant_fin , we add a column j_id to have a fk to jrnx and operation_currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 108/218: acc_ledger_fin . translation, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 111/218: Currency : sales in listing mode, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 106/218: Currency : adapt for bank saldo, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 112/218: currency : sale extended html , csv, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 110/218: Currency : All ledger's listing mode , html , csv and pdf,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 119/218: currency : adapt middle of payment, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 107/218: Currency : export PDF and CSV with currency for printing financial ledger listing(oneline), Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 130/218: typo doc, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 129/218: Esthetic with button "Add accounting", Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 114/218: Currency : purchase oneline + extended html and csv, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 125/218: Merge branch 'master' into r700-currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 128/218: Missing bracket, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 127/218: Merge commit '3f53de417dd89e9a90a386404f93f8648155e046' into r700-currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 132/218: Translation, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 133/218: Translation, Dany De Bontridder, 2019/09/12