[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 110/238: Currency : All ledger's listing mode
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 110/238: Currency : All ledger's listing mode , html , csv and pdf |
Date: |
Sat, 26 Oct 2019 04:40:47 -0400 (EDT) |
sparkyx pushed a commit to annotated tag rel7110
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] 86/238: Currency : show the currency of the ledger when entering info, (continued)
- [Noalyss-commit] [noalyss] 86/238: Currency : show the currency of the ledger when entering info, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 94/238: acc_ledger_fin : cosmetic : input, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 97/238: Fin : currency , add missing info into Operation_Currency, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 95/238: currency : adapt for FIN, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 103/238: reverse for quant_fin, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 96/238: Merge branch 'master' into r700-currency, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 106/238: Currency : adapt for bank saldo, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 102/238: Version DB 131, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 113/238: change background, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 112/238: currency : sale extended html , csv, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 110/238: Currency : All ledger's listing mode , html , csv and pdf,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 119/238: currency : adapt middle of payment, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 124/238: Currency : when we pay at the same time as we record the sale / purchase , either the bank is in euro (default currency) or the sale/purchase has the same currency than the financial ledger, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 126/238: Merge branch 'master' into r700-currency, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 146/238: Currency : history for accounting , correct amount in currency, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 139/238: Translation, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 133/238: Translation, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 142/238: Currency : Precision 6, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 156/238: Merge branch 'r700-currency' of gitlab.noalyss.eu:noalyss/noalyss into r700-currency, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 143/238: Currency : precision 6, display default currency , protect used currency against delete, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 134/238: use of httpInput, Dany De Bontridder, 2019/10/26