[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r4072 - phpcompta/trunk/include
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r4072 - phpcompta/trunk/include |
Date: |
Mon, 25 Apr 2011 22:55:55 +0200 (CEST) |
Author: danydb
Date: 2011-04-25 22:55:55 +0200 (Mon, 25 Apr 2011)
New Revision: 4072
Modified:
phpcompta/trunk/include/class_acc_ledger.php
phpcompta/trunk/include/class_print_ledger_fin.php
phpcompta/trunk/include/class_print_ledger_simple.php
phpcompta/trunk/include/class_print_ledger_simple_without_vat.php
phpcompta/trunk/include/export_ledger_csv.php
phpcompta/trunk/include/impress_jrn.inc.php
Log:
Add view for third in ACH/VEN/FIN (html+csv) pdf must be done
Modified: phpcompta/trunk/include/class_acc_ledger.php
===================================================================
--- phpcompta/trunk/include/class_acc_ledger.php 2011-04-25 20:35:36 UTC
(rev 4071)
+++ phpcompta/trunk/include/class_acc_ledger.php 2011-04-25 20:55:55 UTC
(rev 4072)
@@ -2855,5 +2855,31 @@
);
return $r;
}
+ /**
+ *Retrieve the third : supplier for purchase, customer for sale, bank for
fin,
+ address@hidden $p_jrn_type type of the ledger FIN, VEN ACH or ODS
+ */
+ function get_tiers($p_jrn_type,$jr_id)
+ {
+ if ( $p_jrn_type == 'ODS') return ' ';
+ $tiers='';
+ switch ($p_jrn_type)
+ {
+ case 'VEN':
+ $tiers=$this->db->get_value('select max(qs_client) from quant_sold
join jrnx using (j_id) join jrn on (jr_grpt_id=j_grpt) where
jrn.jr_id=$1',array($jr_id));
+ break ;
+ case 'ACH':
+ $tiers=$this->db->get_value('select max(qp_supplier) from
quant_purchase join jrnx using (j_id) join jrn on (jr_grpt_id=j_grpt) where
jrn.jr_id=$1',array($jr_id));
+ break ;
+ case 'FIN':
+ $tiers=$this->db->get_value('select qf_bank from quant_fin where
jr_id=$1',array($jr_id));
+ break ;
+
+ }
+ if ($this->db->count()==0) return '';
+ $name=$this->db->get_value('select ad_value from fiche_detail where
ad_id=1 and f_id=$1',array($tiers));
+ $first_name=$this->db->get_value('select ad_value from fiche_detail
where ad_id=32 and f_id=$1',array($tiers));
+ return $name.' '.$first_name;
+ }
}
Modified: phpcompta/trunk/include/class_print_ledger_fin.php
===================================================================
--- phpcompta/trunk/include/class_print_ledger_fin.php 2011-04-25 20:35:36 UTC
(rev 4071)
+++ phpcompta/trunk/include/class_print_ledger_fin.php 2011-04-25 20:55:55 UTC
(rev 4072)
@@ -22,6 +22,7 @@
/*!\file
* \brief print a listing of financial
+ *\todo Must add the third part
*/
require_once('class_pdf.php');
class Print_Ledger_Financial extends PDF
Modified: phpcompta/trunk/include/class_print_ledger_simple.php
===================================================================
--- phpcompta/trunk/include/class_print_ledger_simple.php 2011-04-25
20:35:36 UTC (rev 4071)
+++ phpcompta/trunk/include/class_print_ledger_simple.php 2011-04-25
20:55:55 UTC (rev 4072)
@@ -23,6 +23,7 @@
/*!\file
* \brief this class extends PDF and let you export the detailled printing
* of any ledgers
+ *\todo Must add the third part
*/
require_once('class_pdf.php');
Modified: phpcompta/trunk/include/class_print_ledger_simple_without_vat.php
===================================================================
--- phpcompta/trunk/include/class_print_ledger_simple_without_vat.php
2011-04-25 20:35:36 UTC (rev 4071)
+++ phpcompta/trunk/include/class_print_ledger_simple_without_vat.php
2011-04-25 20:55:55 UTC (rev 4072)
@@ -23,6 +23,7 @@
/*!\file
* \brief this class extends PDF and let you export the detailled printing
* of any ledgers
+ * *\todo Must add the third part
*/
require_once('class_pdf.php');
Modified: phpcompta/trunk/include/export_ledger_csv.php
===================================================================
--- phpcompta/trunk/include/export_ledger_csv.php 2011-04-25 20:35:36 UTC
(rev 4071)
+++ phpcompta/trunk/include/export_ledger_csv.php 2011-04-25 20:55:55 UTC
(rev 4072)
@@ -99,6 +99,7 @@
printf ('" operation";'.
'"Date";'.
'"N° Pièce";'.
+ '"Tiers";'.
'"commentaire";'.
'"internal";'.
'"montant";'.
@@ -109,6 +110,7 @@
echo $line['num'].";";
echo $line['date'].";";
echo $line['jr_pj_number'].";";
+ echo $Jrn->get_tiers($line['jrn_def_type'],$line['jr_id']).";";
echo $line['comment'].";";
echo $line['jr_internal'].";";
// echo "<TD>".$line['pj'].";";
@@ -151,7 +153,7 @@
printf('"%s";"%s";"%s";"%s";"%s";%s;',
$line['date'],
$line['num'],
- $line['client'],
+ $Jrn->get_tiers($line['jrn_def_type'],$line['jr_id']),
$line['comment'],
$line['jr_internal'],
nb($line['HTVA']));
Modified: phpcompta/trunk/include/impress_jrn.inc.php
===================================================================
--- phpcompta/trunk/include/impress_jrn.inc.php 2011-04-25 20:35:36 UTC (rev
4071)
+++ phpcompta/trunk/include/impress_jrn.inc.php 2011-04-25 20:55:55 UTC (rev
4072)
@@ -238,6 +238,7 @@
"<th>Date</th>".
"<th> n° de pièce </th>".
"<th>internal</th>".
+ th('Tiers').
"<th>Commentaire</th>".
"<th> montant</th>".
"</TR>";
@@ -250,8 +251,11 @@
echo "<TD>".$line['date']."</TD>";
echo "<TD>".h($line['jr_pj_number'])."</TD>";
echo
"<TD>".HtmlInput::detail_op($line['jr_id'],$line['jr_internal'])."</TD>";
+ $tiers=$Jrn->get_tiers($line['jrn_def_type'],$line['jr_id']);
+ echo td($tiers);
echo "<TD>".h($line['comment'])."</TD>";
+
// echo "<TD>".$line['pj']."</TD>";
// If the ledger is financial :
// the credit must be negative and written in red
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r4072 - phpcompta/trunk/include,
phpcompta-dev <=