From MAILER-DAEMON Wed Dec 05 15:18:23 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TgLQF-0004uY-Oq
	for mharc-phpcompta-dev@gnu.org; Wed, 05 Dec 2012 15:18:23 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed,  5 Dec 2012 21:08:08 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.915245.1354738702.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5157 - in phpcompta/tags/rel650/include: . template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 05 Dec 2012 20:18:22 -0000

Author: danydb
Date: 2012-12-05 21:08:07 +0100 (Wed, 05 Dec 2012)
New Revision: 5157

Modified:
   phpcompta/tags/rel650/include/class_acc_ledger_purchase.php
   phpcompta/tags/rel650/include/class_acc_ledger_sold.php
   phpcompta/tags/rel650/include/class_acc_payment.php
   phpcompta/tags/rel650/include/template/form_ledger_detail.php
Log:
0000766: Utilisation des moyens de paiements : libell?\195?\169 diff?\195=
?\169rent pour l'op?\195?\169ration de paiement et d'achat/vente.
0000765: affichage des colonnes Prix HTVA quand la soci?\195?\169t?\195?\=
169 n'est pas assujettie ?\195?\160 la TVA

Modified: phpcompta/tags/rel650/include/class_acc_ledger_purchase.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/class_acc_ledger_purchase.php	2012-11-2=
9 22:17:33 UTC (rev 5156)
+++ phpcompta/tags/rel650/include/class_acc_ledger_purchase.php	2012-12-0=
5 20:08:07 UTC (rev 5157)
@@ -795,7 +795,7 @@
=20
                 /* insert into jrn */
                 $acc_pay->mt=3D$mt;
-				$acc_pay->desc=3D$e_comm;
+				$acc_pay->desc=3D(!isset($e_comm_paiement) || strlen(trim($e_comm_pa=
iement)) =3D=3D 0) ?$e_comm:$e_comm_paiement;
                 $mp_jr_id=3D$acc_pay->insert_jrn();
                 $acjrn->grpt_id=3D$acseq;
                 $acjrn->update_internal_code($acinternal);
@@ -1529,13 +1529,16 @@
         {
             $r.=3DHtmlInput::hidden('e_mp_qcode_'.$e_mp,${'e_mp_qcode_'.=
$e_mp});
             $r.=3DHtmlInput::hidden('acompte',$acompte);
+			$r.=3DHtmlInput::hidden('e_comm_paiement',$e_comm_paiement);
             /* needed for generating a invoice */
             $r.=3DHtmlInput::hidden('qcode_benef', ${'e_mp_qcode_' . $e_=
mp});
 			$fname =3D new Fiche($this->db);
 			$fname->get_by_qcode(${'e_mp_qcode_' . $e_mp});
 			$r.=3D"<div style=3D\"clear:both\"></div>";
 			$r.=3D'<div style=3D"float:left"><h2 class=3D"info">' . "Pay=C3=A9 pa=
r " . ${'e_mp_qcode_' . $e_mp} .
-					" ".$fname->getName() ."</h2> ". _('D=C3=A9duction acompte ').h($ac=
ompte).'</div>';
+					" ".$fname->getName() ."</h2> ".
+					'<p>'._('D=C3=A9duction acompte ').h($acompte).'</p>'.
+					_('Libell=C3=A9 :' ).h($e_comm_paiement).'</div>';
             $r.=3D'<br>';
         }
         // check for upload piece

Modified: phpcompta/tags/rel650/include/class_acc_ledger_sold.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/class_acc_ledger_sold.php	2012-11-29 22=
:17:33 UTC (rev 5156)
+++ phpcompta/tags/rel650/include/class_acc_ledger_sold.php	2012-12-05 20=
:08:07 UTC (rev 5157)
@@ -565,8 +565,9 @@
                 $let_other=3D$acc_pay->insert_jrnx();
=20
                 /* insert into jrn */
-				$acjrn->desc=3D$e_comm;
+				$acc_pay->mt=3D$mt;
                 $acjrn->grpt_id=3D$acseq;
+				$acc_pay->desc=3D(!isset($e_comm_paiement) || strlen(trim($e_comm_pa=
iement)) =3D=3D 0) ?$e_comm:$e_comm_paiement;
                 $mp_jr_id=3D$acc_pay->insert_jrn();
                 $acjrn->update_internal_code($acinternal);
=20
@@ -905,6 +906,7 @@
         {
             $r.=3DHtmlInput::hidden('e_mp_qcode_'.$e_mp,${'e_mp_qcode_'.=
$e_mp});
             $r.=3DHtmlInput::hidden('acompte',$acompte);
+			$r.=3DHtmlInput::hidden('e_comm_paiement',$e_comm_paiement);
             /* needed for generating a invoice */
             $r.=3DHtmlInput::hidden('qcode_benef',${'e_mp_qcode_'.$e_mp}=
);
=20
@@ -912,7 +914,8 @@
 			$fname->get_by_qcode(${'e_mp_qcode_'.$e_mp});
 			$r.=3D"<div style=3D\"clear:both\"></div>";
 			$r.=3D'<div style=3D"float:left"><h2 class=3D"info">'."Pay=C3=A9 par =
".${'e_mp_qcode_'.$e_mp}.
-				   " ".$fname->getName().'</H2> '._('D=C3=A9duction acompte ').h($ac=
ompte).'</div>';
+				   " ".$fname->getName().'</H2> '.'<p>'._('D=C3=A9duction acompte ')=
.h($acompte).'</p>'.
+					_('Libell=C3=A9 :' ).h($e_comm_paiement).'</div>';
             $r.=3D'<br>';
         }
=20

Modified: phpcompta/tags/rel650/include/class_acc_payment.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/class_acc_payment.php	2012-11-29 22:17:=
33 UTC (rev 5156)
+++ phpcompta/tags/rel650/include/class_acc_payment.php	2012-12-05 20:08:=
07 UTC (rev 5157)
@@ -335,7 +335,16 @@
             $acompte->value=3D0;
             $r.=3D_(" Acompte =C3=A0 d=C3=A9duire");
             $r.=3D$acompte->input();
-        }
+			$r.=3D'<p>';
+			$e_comm_paiement=3Dnew IText('e_comm_paiement');
+			$e_comm_paiement->table =3D 0;
+			$e_comm_paiement->setReadOnly(false);
+			$e_comm_paiement->size =3D 60;
+			$e_comm_paiement->tabindex =3D 3;
+			$r.=3D_(" Libell=C3=A9 du paiement");
+			$r.=3D$e_comm_paiement->input();
+			$r.=3D'</p>';
+		}
=20
         $r.=3D'<ol>';
         $r.=3D'<li ><input type=3D"radio" name=3D"e_mp" value=3D"0" chec=
ked>'._('Paiement encod=C3=A9 plus tard');
@@ -350,7 +359,7 @@
                 {
                     $a=3Dnew ICard();
                     $a->jrn=3D$row->mp_jrn_def_id;
-		    $a->set_attribute('typecard',$row->mp_fd_id);
+					$a->set_attribute('typecard',$row->mp_fd_id);
                     $a->name=3D'e_mp_qcode_'.$row->mp_id;
                     $a->set_dblclick("fill_ipopcard(this);");
                     $a->set_callback('filter_card');

Modified: phpcompta/tags/rel650/include/template/form_ledger_detail.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/template/form_ledger_detail.php	2012-11=
-29 22:17:33 UTC (rev 5156)
+++ phpcompta/tags/rel650/include/template/form_ledger_detail.php	2012-12=
-05 20:08:07 UTC (rev 5157)
@@ -22,13 +22,17 @@
 <tr>
 <th style=3D"width:auto"colspan=3D"2">Code <?=3DHtmlInput::infobulle(0)?=
></th>
       <th><?=3D_('D=C3=A9nomination')?></th>
+<? if ($flag_tva =3D=3D'Y') : ?>
       <th><?=3D_('prix/unit=C3=A9 htva')?><?=3DHtmlInput::infobulle(6)?>=
</th>
       <th><?=3D_('quantit=C3=A9')?></th>
       <th><?=3D_('Total HTVA')?></th>
-<? if ($flag_tva =3D=3D'Y') : ?>
- <th><?=3D_('tva')?></th>
- <th><?=3D_('tot.tva')?></th>
-<th><?=3D_('tvac')?></th>
+	  <th><?=3D_('tva')?></th>
+      <th><?=3D_('tot.tva')?></th>
+      <th><?=3D_('tvac')?></th>
+<? else: ?>
+	  <th><?=3D_('prix/unit=C3=A9 ')?><?=3DHtmlInput::infobulle(6)?></th>
+      <th><?=3D_('quantit=C3=A9')?></th>
+      <th><?=3D_('Total ')?></th>
 <? endif;?>
=20
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Dec 06 15:53:04 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TgiRM-0004n3-FR
	for mharc-phpcompta-dev@gnu.org; Thu, 06 Dec 2012 15:53:04 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu,  6 Dec 2012 21:42:51 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.918731.1354827183.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5158 - phpcompta/tags/rel650/include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 06 Dec 2012 20:53:03 -0000

Author: danydb
Date: 2012-12-06 21:42:51 +0100 (Thu, 06 Dec 2012)
New Revision: 5158

Modified:
   phpcompta/tags/rel650/include/template/ledger_detail_ach.php
   phpcompta/tags/rel650/include/template/ledger_detail_ven.php
Log:
0000762: TVA intracommunautaire

Modified: phpcompta/tags/rel650/include/template/ledger_detail_ach.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/template/ledger_detail_ach.php	2012-12-=
05 20:08:07 UTC (rev 5157)
+++ phpcompta/tags/rel650/include/template/ledger_detail_ach.php	2012-12-=
06 20:42:51 UTC (rev 5158)
@@ -179,10 +179,15 @@
=20
     if ($owner->MY_TVA_USE=3D=3D'Y')
       {
-	$tva_amount=3Dbcadd($q['qp_vat'],$q['qp_nd_tva']);
-	$tva_amount=3Dbcadd($tva_amount,$q['qp_nd_tva_recup']);
-	$row.=3Dtd(nbm($tva_amount),'class=3D"num"');
-	$row.=3Dtd(nbm($tvac),'class=3D"num"');
+		$tva_amount=3Dbcadd($q['qp_vat'],$q['qp_nd_tva']);
+		$tva_amount=3Dbcadd($tva_amount,$q['qp_nd_tva_recup']);
+		$class=3D"";
+		if ($tva->get_parameter("both_side")=3D=3D1) {
+			$class=3D' style=3D"text-decoration:line-through"';
+			$tvac=3Dbcsub($tvac,$q['qp_vat']);
+		}
+		$row.=3Dtd(nbm($tva_amount),'class=3D"num" '.$class);
+		$row.=3Dtd(nbm($tvac),'class=3D"num"');
       }
     $total_tvac+=3D$tvac;
     $total_htva+=3D$htva;

Modified: phpcompta/tags/rel650/include/template/ledger_detail_ven.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/template/ledger_detail_ven.php	2012-12-=
05 20:08:07 UTC (rev 5157)
+++ phpcompta/tags/rel650/include/template/ledger_detail_ven.php	2012-12-=
06 20:42:51 UTC (rev 5158)
@@ -175,8 +175,12 @@
     $tvac=3Dbcadd($htva,$q['qs_vat']);
     if ($owner->MY_TVA_USE=3D=3D'Y')
       {
-	$row.=3Dtd(nbm($q['qs_vat']),'class=3D"num"');
-	$row.=3Dtd(nbm($tvac),'class=3D"num"');
+		if ($tva->get_parameter("both_side")=3D=3D1) {
+			$class=3D' style=3D"text-decoration:line-through"';
+			$tvac=3Dbcsub($tvac,$q['qs_vat']);
+		}
+		$row.=3Dtd(nbm($q['qs_vat']),'class=3D"num"'.$class);
+		$row.=3Dtd(nbm($tvac),'class=3D"num"');
       }
     $total_tvac=3Dbcadd($total_tvac,$tvac);
     $total_htva=3Dbcadd($total_htva,$htva);



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Dec 06 15:53:29 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TgiRl-0004qz-KO
	for mharc-phpcompta-dev@gnu.org; Thu, 06 Dec 2012 15:53:29 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu,  6 Dec 2012 21:43:22 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.918732.1354827208.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5159 - phpcompta/tags/rel650/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 06 Dec 2012 20:53:28 -0000

Author: danydb
Date: 2012-12-06 21:43:22 +0100 (Thu, 06 Dec 2012)
New Revision: 5159

Modified:
   phpcompta/tags/rel650/include/class_acc_ledger.php
Log:
Bug : the history doesn't show the first_name for VEN

Modified: phpcompta/tags/rel650/include/class_acc_ledger.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/class_acc_ledger.php	2012-12-06 20:42:5=
1 UTC (rev 5158)
+++ phpcompta/tags/rel650/include/class_acc_ledger.php	2012-12-06 20:43:2=
2 UTC (rev 5159)
@@ -2528,7 +2528,7 @@
 		and f_id=3D(select qf_other from quant_fin where quant_fin.jr_id=3Dx.j=
r_id))
 	    end as name,
 	   case
-	     when jrn_def_type=3D'VEB' then (select ad_value from fiche_detail =
where ad_id=3D32 and f_id=3D(select max(qs_client) from quant_sold join j=
rnx using (j_id) join jrn as e on (e.jr_grpt_id=3Dj_grpt) where e.jr_id=3D=
x.jr_id))
+	     when jrn_def_type=3D'VEN' then (select ad_value from fiche_detail =
where ad_id=3D32 and f_id=3D(select max(qs_client) from quant_sold join j=
rnx using (j_id) join jrn as e on (e.jr_grpt_id=3Dj_grpt) where e.jr_id=3D=
x.jr_id))
 	    when jrn_def_type =3D 'ACH' then (select ad_value from fiche_detail=
 where ad_id=3D32 and f_id=3D(select max(qp_supplier) from quant_purchase=
 join jrnx using (j_id) join jrn as e on (e.jr_grpt_id=3Dj_grpt) where e.=
jr_id=3Dx.jr_id))
 	    when jrn_def_type =3D 'FIN' then (select ad_value from fiche_detail=
 where ad_id=3D32 and f_id=3D(select qf_other from quant_fin where quant_=
fin.jr_id=3Dx.jr_id))
 	    end as first_name,



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Dec 06 16:01:24 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TgiZQ-0006D3-Ju
	for mharc-phpcompta-dev@gnu.org; Thu, 06 Dec 2012 16:01:24 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu,  6 Dec 2012 21:51:10 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.918742.1354827683.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5160 - phpcompta/tags/rel650/include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 06 Dec 2012 21:01:22 -0000

Author: danydb
Date: 2012-12-06 21:51:09 +0100 (Thu, 06 Dec 2012)
New Revision: 5160

Modified:
   phpcompta/tags/rel650/include/template/ledger_detail_ven.php
Log:
0000762: TVA intracommunautaire typo

Modified: phpcompta/tags/rel650/include/template/ledger_detail_ven.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/template/ledger_detail_ven.php	2012-12-=
06 20:43:22 UTC (rev 5159)
+++ phpcompta/tags/rel650/include/template/ledger_detail_ven.php	2012-12-=
06 20:51:09 UTC (rev 5160)
@@ -175,6 +175,7 @@
     $tvac=3Dbcadd($htva,$q['qs_vat']);
     if ($owner->MY_TVA_USE=3D=3D'Y')
       {
+		$class=3D"";
 		if ($tva->get_parameter("both_side")=3D=3D1) {
 			$class=3D' style=3D"text-decoration:line-through"';
 			$tvac=3Dbcsub($tvac,$q['qs_vat']);



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Dec 06 17:06:48 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Tgjai-0000C6-O9
	for mharc-phpcompta-dev@gnu.org; Thu, 06 Dec 2012 17:06:48 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu,  6 Dec 2012 22:56:37 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.918834.1354831607.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5161 - in phpcompta/tags/rel650/include: . template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 06 Dec 2012 22:06:46 -0000

Author: danydb
Date: 2012-12-06 22:56:36 +0100 (Thu, 06 Dec 2012)
New Revision: 5161

Modified:
   phpcompta/tags/rel650/include/class_acc_ledger.php
   phpcompta/tags/rel650/include/class_acc_ledger_purchase.php
   phpcompta/tags/rel650/include/class_acc_ledger_sold.php
   phpcompta/tags/rel650/include/class_acc_operation.php
   phpcompta/tags/rel650/include/export_histo_csv.php
   phpcompta/tags/rel650/include/template/ledger_detail_ach.php
   phpcompta/tags/rel650/include/template/ledger_detail_ven.php
Log:
0000762: TVA intracommunautaire : montant facture au lieu montant op?\195=
?\169ration

Modified: phpcompta/tags/rel650/include/class_acc_ledger.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/class_acc_ledger.php	2012-12-06 20:51:0=
9 UTC (rev 5160)
+++ phpcompta/tags/rel650/include/class_acc_ledger.php	2012-12-06 21:56:3=
6 UTC (rev 5161)
@@ -799,6 +799,7 @@
 	public function list_operation($sql, $offset, $p_paid =3D 0)
 	{
 		global $g_parameter, $g_user;
+		bcscale(2);
 		$table =3D new Sort_Table();
 		$gDossier =3D dossier::id();
 		$amount_paid =3D 0.0;
@@ -924,10 +925,12 @@
 					$positive =3D ($positive < 0) ? 1 : 0;
 			}
 			$r.=3D"<TD align=3D\"right\">";
-
-			$tot =3D ($positive !=3D 0) ? $tot - $row['jr_montant'] : $tot + $row=
['jr_montant'];
+			$t_amount=3D$row['jr_montant'];
+			if ($row['total_invoice'] !=3D null && $row['total_invoice'] !=3D $ro=
w['jr_montant'])
+				$t_amount=3D$row['total_invoice'];
+			$tot =3D ($positive !=3D 0) ? bcsub($tot , $t_amount ): bcadd($tot , =
$t_amount);
 			//STAN $positive always =3D=3D 0
-			$r.=3D( $positive !=3D 0 ) ? "<font color=3D\"red\">  - " . nbm($row[=
'jr_montant']) . "</font>" : nbm($row['jr_montant']);
+			$r.=3D( $positive !=3D 0 ) ? "<font color=3D\"red\">  - " . nbm($t_am=
ount) . "</font>" : nbm($t_amount);
 			$r.=3D"</TD>";
=20
=20
@@ -2536,7 +2539,20 @@
 	     when jrn_def_type=3D'VEN' then (select ad_value from fiche_detail =
where ad_id=3D23 and f_id=3D(select max(qs_client) from quant_sold join j=
rnx using (j_id) join jrn as e on (e.jr_grpt_id=3Dj_grpt) where e.jr_id=3D=
x.jr_id))
 	    when jrn_def_type =3D 'ACH' then (select ad_value from fiche_detail=
 where ad_id=3D23 and f_id=3D(select max(qp_supplier) from quant_purchase=
 join jrnx using (j_id) join jrn as e on (e.jr_grpt_id=3Dj_grpt) where e.=
jr_id=3Dx.jr_id))
 	    when jrn_def_type =3D 'FIN' then (select ad_value from fiche_detail=
 where ad_id=3D23 and f_id=3D(select qf_other from quant_fin where quant_=
fin.jr_id=3Dx.jr_id))
-	    end as quick_code
+	    end as quick_code,
+	    case
+	     when jrn_def_type=3D'VEN' then
+		     (select sum(qs_price)+sum(vat) from
+				(select qs_internal,qs_price,case when qs_vat_sided<>0 then 0 else q=
s_vat end as vat from quant_sold where qs_internal=3DX.jr_internal) as ve=
n_invoice
+			  )
+	    when jrn_def_type =3D 'ACH' then
+			(
+				select sum(qp_price)+sum(vat)+sum(qp_nd_tva)+sum(qp_nd_tva_recup)
+				from
+				 (select qp_internal,qp_price,qp_nd_tva,qp_nd_tva_recup,case when qp=
_vat_sided<>0 then 0 else qp_vat end as vat from quant_purchase where qp_=
internal=3DX.jr_internal) as invoice_purchase
+			)
+		else null
+		end as total_invoice
=20
=20
              from

Modified: phpcompta/tags/rel650/include/class_acc_ledger_purchase.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/class_acc_ledger_purchase.php	2012-12-0=
6 20:51:09 UTC (rev 5160)
+++ phpcompta/tags/rel650/include/class_acc_ledger_purchase.php	2012-12-0=
6 21:56:36 UTC (rev 5161)
@@ -354,7 +354,7 @@
                 /* First we save all the items without vat */
                 $fiche=3Dnew Fiche($this->db);
                 $fiche->get_by_qcode(${"e_march".$i});
-
+				$tva_both=3D0;
                 /* tva */
                 if ($g_parameter->MY_TVA_USE=3D=3D'Y')
                 {
@@ -362,6 +362,7 @@
                     $oTva=3Dnew Acc_Tva($this->db);
                     $oTva->set_parameter('id',$idx_tva);
                     $oTva->load();
+					$tva_both=3D$oTva->get_parameter("both_side");
                 }
=20
                 /* We have to compute all the amount thanks Acc_Compute =
*/
@@ -382,7 +383,7 @@
                         $acc_amount->amount_vat=3D ${'e_march'.$i.'_tva_=
amount'};
=20
                     }
-                    if ($oTva->get_parameter("both_side")=3D=3D0) $tot_t=
va=3Dbcadd($tot_tva,$acc_amount->amount_vat);
+                    if ($tva_both=3D=3D0) $tot_tva=3Dbcadd($tot_tva,$acc=
_amount->amount_vat);
                 }
=20
                 $acc_operation=3Dnew Acc_Operation($this->db);
@@ -415,7 +416,7 @@
                     $tot_perso+=3D$acc_amount->amount_perso;
                 }
=20
-                if ( ! $fiche->empty_attribute(ATTR_DEF_TVA_NON_DEDUCTIB=
LE))
+                if ( ! $fiche->empty_attribute(ATTR_DEF_TVA_NON_DEDUCTIB=
LE) && $tva_both=3D=3D0)
                 {
                     $acc_amount->nd_vat_rate=3D$fiche->strAttribut(ATTR_=
DEF_TVA_NON_DEDUCTIBLE);
                     $acc_amount->compute_nd_vat();
@@ -423,7 +424,7 @@
                     /* save op. */
=20
                 }
-                if ( ! $fiche->empty_attribute(ATTR_DEF_TVA_NON_DEDUCTIB=
LE_RECUP))
+                if ( ! $fiche->empty_attribute(ATTR_DEF_TVA_NON_DEDUCTIB=
LE_RECUP) && $tva_both=3D=3D0)
                 {
                     $acc_amount->nd_ded_vat_rate=3D$fiche->strAttribut(A=
TTR_DEF_TVA_NON_DEDUCTIBLE_RECUP);
                     $acc_amount->compute_ndded_vat();
@@ -492,7 +493,7 @@
                 //-----
                 if ( $g_parameter->MY_TVA_USE=3D=3D'Y')
                 {
-                    if ( $oTva->get_parameter("both_side")=3D=3D1) $n_bo=
th=3D$acc_amount->amount_vat;
+                    if ( $tva_both=3D=3D1) $n_both=3D$acc_amount->amount=
_vat;
=20
                     $r=3D$this->db->exec_sql("select insert_quant_purcha=
se ".
                                            "(null".
@@ -602,7 +603,7 @@
                 /* save op. */
                 $acc_operation->type=3D'd';
                 $acc_operation->qcode=3D'';
-	      if ( ! $fiche->empty_attribute(ATTR_DEF_ACCOUNT_ND_TVA_ND))
+	      if ( ! $fiche->empty_attribute(ATTR_DEF_ACCOUNT_ND_TVA_ND) && $tv=
a_both=3D=3D0)
 		{
 		  $dna=3D$fiche->strAttribut(ATTR_DEF_ACCOUNT_ND_TVA_ND);
 		}
@@ -622,7 +623,7 @@
             {
 	      $dna_default=3Dnew Acc_Parm_Code($this->db,'TVA_DED_IMPOT');
                 /* save op. */
-	      if ( ! $fiche->empty_attribute(ATTR_DEF_ACCOUNT_ND_TVA))
+	      if ( ! $fiche->empty_attribute(ATTR_DEF_ACCOUNT_ND_TVA) && $tva_b=
oth=3D=3D0)
 		{
 		  $dna=3D$fiche->strAttribut(ATTR_DEF_ACCOUNT_ND_TVA);
 		}
@@ -1087,10 +1088,8 @@
             /* use vat */
             if ( $g_parameter->MY_TVA_USE=3D=3D'Y')
             {
-                $march_tva_id=3D(isset(${"e_march$i"."_tva_id"}))?${"e_m=
arch$i"."_tva_id"}:""
-                              ;
-                $march_tva_amount=3D(isset(${"e_march$i"."_tva_amount"})=
)?${"e_march$i"."_tva_amount"}:""
-                                  ;
+                $march_tva_id=3D(isset(${"e_march$i"."_tva_id"}))?${"e_m=
arch$i"."_tva_id"}:"";
+                $march_tva_amount=3D(isset(${"e_march$i"."_tva_amount"})=
)?${"e_march$i"."_tva_amount"}:"";
             }
=20
=20

Modified: phpcompta/tags/rel650/include/class_acc_ledger_sold.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/class_acc_ledger_sold.php	2012-12-06 20=
:51:09 UTC (rev 5160)
+++ phpcompta/tags/rel650/include/class_acc_ledger_sold.php	2012-12-06 21=
:56:36 UTC (rev 5161)
@@ -324,8 +324,8 @@
                     $oTva=3Dnew Acc_Tva($this->db);
                     $idx_tva=3D${'e_march'.$i.'_tva_id'};
                     $tva_item=3D${'e_march'.$i.'_tva_amount'};
-		    $oTva->set_parameter("id",$idx_tva);
-		    $oTva->load();
+					$oTva->set_parameter("id",$idx_tva);
+					$oTva->load();
                     /* if empty then we need to compute it */
                     if (trim($tva_item)=3D=3D'')
                     {

Modified: phpcompta/tags/rel650/include/class_acc_operation.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/class_acc_operation.php	2012-12-06 20:5=
1:09 UTC (rev 5160)
+++ phpcompta/tags/rel650/include/class_acc_operation.php	2012-12-06 21:5=
6:36 UTC (rev 5161)
@@ -602,7 +602,7 @@
     {
         parent::get();
         $sql=3D"SELECT qs_id, qs_internal, qs_fiche, qs_quantite, qs_pri=
ce, qs_vat,
-             qs_vat_code, qs_client, qs_valid, j_id,j_text
+             qs_vat_code, qs_client, qs_valid, j_id,j_text,qs_vat_sided
              FROM quant_sold  join jrnx using(j_id) where j_grpt=3D$1";
         $this->det->array=3D$this->db->get_array($sql,array($this->det->=
jr_grpt_id));
     }
@@ -627,7 +627,7 @@
         parent::get();
         $sql=3D"SELECT qp_id, qp_internal, j_id, qp_fiche, qp_quantite, =
qp_price, qp_vat,
              qp_vat_code, qp_nd_amount, qp_nd_tva, qp_nd_tva_recup, qp_s=
upplier,
-             qp_valid, qp_dep_priv,j_text
+             qp_valid, qp_dep_priv,j_text,qp_vat_sided
              FROM quant_purchase  join jrnx using(j_id) where j_grpt=3D$=
1";
         $this->det->array=3D$this->db->get_array($sql,array($this->det->=
jr_grpt_id));
     }

Modified: phpcompta/tags/rel650/include/export_histo_csv.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/export_histo_csv.php	2012-12-06 20:51:0=
9 UTC (rev 5160)
+++ phpcompta/tags/rel650/include/export_histo_csv.php	2012-12-06 21:56:3=
6 UTC (rev 5161)
@@ -43,7 +43,7 @@
 printf('"%s";',"Tiers");
 printf('"%s";',"Description");
 printf('"%s";',"Note");
-printf('"%s"',"Montant");
+printf('"%s"',"Montant op=C3=A9ration");
 printf("\r\n");
=20
 for ($i=3D0;$i<count($res);$i++)
@@ -60,12 +60,13 @@
=20
     $amount=3D$res[$i]['jr_montant'];
=20
+	if ( $res[$i]['total_invoice']!=3Dnull && $res[$i]['jr_montant']!=3D$re=
s[$i]['total_invoice'])
+		$amount=3D$res[$i]['total_invoice'];
     if ( $res[$i]['jrn_def_type'] =3D=3D 'FIN')
       {
-	$positive =3D $cn->get_value("select qf_amount from quant_fin where jr_=
id=3D$1",array($res[$i]['jr_id']));
-	if ( $positive !=3D'' ) $amount=3D$positive;
+		$positive =3D $cn->get_value("select qf_amount from quant_fin where jr=
_id=3D$1",array($res[$i]['jr_id']));
+		if ( $positive !=3D'' ) $amount=3D$positive;
       }
-
     printf('%s',nb($amount));
=20
     printf("\r\n");

Modified: phpcompta/tags/rel650/include/template/ledger_detail_ach.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/template/ledger_detail_ach.php	2012-12-=
06 20:51:09 UTC (rev 5160)
+++ phpcompta/tags/rel650/include/template/ledger_detail_ach.php	2012-12-=
06 21:56:36 UTC (rev 5161)
@@ -182,7 +182,7 @@
 		$tva_amount=3Dbcadd($q['qp_vat'],$q['qp_nd_tva']);
 		$tva_amount=3Dbcadd($tva_amount,$q['qp_nd_tva_recup']);
 		$class=3D"";
-		if ($tva->get_parameter("both_side")=3D=3D1) {
+		if ($q['qp_vat_sided']<>0) {
 			$class=3D' style=3D"text-decoration:line-through"';
 			$tvac=3Dbcsub($tvac,$q['qp_vat']);
 		}

Modified: phpcompta/tags/rel650/include/template/ledger_detail_ven.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/template/ledger_detail_ven.php	2012-12-=
06 20:51:09 UTC (rev 5160)
+++ phpcompta/tags/rel650/include/template/ledger_detail_ven.php	2012-12-=
06 21:56:36 UTC (rev 5161)
@@ -176,7 +176,7 @@
     if ($owner->MY_TVA_USE=3D=3D'Y')
       {
 		$class=3D"";
-		if ($tva->get_parameter("both_side")=3D=3D1) {
+		if ($q['qs_vat_sided'] !=3D 0) {
 			$class=3D' style=3D"text-decoration:line-through"';
 			$tvac=3Dbcsub($tvac,$q['qs_vat']);
 		}



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Dec 06 17:19:33 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Tgjn3-0002Xp-Ug
	for mharc-phpcompta-dev@gnu.org; Thu, 06 Dec 2012 17:19:33 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu,  6 Dec 2012 23:09:21 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.918856.1354832373.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5162 - phpcompta/tags/rel650/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 06 Dec 2012 22:19:32 -0000

Author: danydb
Date: 2012-12-06 23:09:20 +0100 (Thu, 06 Dec 2012)
New Revision: 5162

Modified:
   phpcompta/tags/rel650/include/param_pcmn.inc.php
Log:
0000745: en bas de page il appara?\195?\174t un pop up

Modified: phpcompta/tags/rel650/include/param_pcmn.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/param_pcmn.inc.php	2012-12-06 21:56:36 =
UTC (rev 5161)
+++ phpcompta/tags/rel650/include/param_pcmn.inc.php	2012-12-06 22:09:20 =
UTC (rev 5162)
@@ -38,7 +38,8 @@
=20
 include_once ("user_menu.php");
=20
-echo '<div id=3D"acc_update" style=3D"border:1px solid blue;width:40%;di=
splay:none;background-color:lightgrey;padding:3;position:absolute;text-al=
ign:left;line-height:3em;z-index:1">';
+echo '<div id=3D"acc_update" style=3D"border:1px solid blue;width:40%;di=
splay:none;background-color:lightgrey;padding:0;position:absolute;text-al=
ign:left;z-index:1">';
+echo HtmlInput::title_box("Poste comptable", "acc_update", "hide");
 echo '<form method=3D"post">';
 $val=3Dnew IText('p_valu');
 $parent=3Dnew IText('p_parentu');
@@ -285,9 +286,9 @@
     echo $A['pcm_val'];
     echo '</td>';
     echo "$td";
-    printf ("<A HREF=3D\"javascript:PcmnUpdate('%s','%s','%s','%s',%d)\"=
>",
+    printf ("<A HREF=3D\"javascript:void(0)\" onclick=3D\"PcmnUpdate('%s=
','%s','%s','%s',%d)\">",
             $A['pcm_val'],
-            sql_string($A['pcm_lib']),
+			str_replace("'","\'",$A['pcm_lib']),
             $A['pcm_val_parent'],
             $A['pcm_type'],
             dossier::id());



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Dec 08 13:20:57 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ThP1F-00072J-I2
	for mharc-phpcompta-dev@gnu.org; Sat, 08 Dec 2012 13:20:57 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat,  8 Dec 2012 19:10:53 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.923519.1354990856.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5163 - phpcompta/tags/rel650/html/admin/sql/patch
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 08 Dec 2012 18:20:55 -0000

Author: danydb
Date: 2012-12-08 19:10:52 +0100 (Sat, 08 Dec 2012)
New Revision: 5163

Added:
   phpcompta/tags/rel650/html/admin/sql/patch/upgrade103.sql
Log:
patch version 104

Added: phpcompta/tags/rel650/html/admin/sql/patch/upgrade103.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/html/admin/sql/patch/upgrade103.sql	           =
             (rev 0)
+++ phpcompta/tags/rel650/html/admin/sql/patch/upgrade103.sql	2012-12-08 =
18:10:52 UTC (rev 5163)
@@ -0,0 +1,37 @@
+begin;
+CREATE OR REPLACE FUNCTION comptaproc.format_account(p_account account_t=
ype)
+  RETURNS account_type AS
+$BODY$
+
+declare
+
+sResult account_type;
+
+begin
+sResult :=3D lower(p_account);
+
+sResult :=3D translate(sResult,E'=C3=A9=C3=A8=C3=AA=C3=AB=C3=A0=C3=A2=C3=
=A4=C3=AF=C3=AE=C3=BC=C3=BB=C3=B9=C3=B6=C3=B4=C3=A7','eeeeaaaiiuuuooc');
+sResult :=3D translate(sResult,E' $=E2=82=AC=C2=B5=C2=A3%.+-/\\!(){}(),;=
_&|"#''^<>*','');
+
+return upper(sResult);
+
+end;
+$BODY$
+  LANGUAGE plpgsql ;
+
+COMMENT ON FUNCTION comptaproc.format_account(account_type) IS 'format t=
he accounting :
+- upper case
+- remove space and special char.
+';
+
+update tmp_pcmn  set pcm_val_parent  =3D '62' where pcm_val=3D'6202';
+
+update fiche_detail set ad_value =3D (to_number(ad_value,'9.99')*100)::t=
ext where ad_id in  (21,22,20,31) and ad_value is not null and ad_value <=
> '';
+
+update menu_ref set me_code=3D'ACHISTO' WHERE me_code=3D'ACHIMP';
+update menu_ref set me_code=3D'VEHISTO' WHERE me_code=3D'VENIMP';
+update menu_ref set me_code=3D'FIHISTO' WHERE me_code=3D'FIMP';
+update menu_ref set me_code=3D'ODHISTO' WHERE me_code=3D'ODSIMP';
+update version set val=3D104;
+
+commit;
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Dec 08 14:58:58 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ThQY6-0005bz-QH
	for mharc-phpcompta-dev@gnu.org; Sat, 08 Dec 2012 14:58:58 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat,  8 Dec 2012 20:48:58 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.923597.1354996738.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5164 - phpcompta/tags/rel650/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 08 Dec 2012 19:58:58 -0000

Author: danydb
Date: 2012-12-08 20:48:57 +0100 (Sat, 08 Dec 2012)
New Revision: 5164

Modified:
   phpcompta/tags/rel650/include/constant.php
Log:
patch version 104

Modified: phpcompta/tags/rel650/include/constant.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/constant.php	2012-12-08 18:10:52 UTC (r=
ev 5163)
+++ phpcompta/tags/rel650/include/constant.php	2012-12-08 19:48:57 UTC (r=
ev 5164)
@@ -47,7 +47,7 @@
 define ("SITE_UPDATE_PLUGIN",'http://www.phpcompta.eu/plugin_last_versio=
n.txt');
=20
=20
-define ("DBVERSION",103);
+define ("DBVERSION",104);
=20
 define ("DBVERSIONREPO",14);
 define ('NOTFOUND','--not found--');



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Dec 08 15:22:16 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ThQue-0006me-Mf
	for mharc-phpcompta-dev@gnu.org; Sat, 08 Dec 2012 15:22:16 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat,  8 Dec 2012 21:12:15 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.923614.1354998135.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5165 - phpcompta/tags/rel650/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 08 Dec 2012 20:22:15 -0000

Author: danydb
Date: 2012-12-08 21:12:14 +0100 (Sat, 08 Dec 2012)
New Revision: 5165

Modified:
   phpcompta/tags/rel650/include/class_user.php
Log:
cosmetique

Modified: phpcompta/tags/rel650/include/class_user.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/class_user.php	2012-12-08 19:48:57 UTC =
(rev 5164)
+++ phpcompta/tags/rel650/include/class_user.php	2012-12-08 20:12:14 UTC =
(rev 5165)
@@ -1032,7 +1032,7 @@
 			}
 			$cn =3D new Database();
 			if (isset($_REQUEST['gDossier']))
-				$p_module.=3D "dossier : " . $_REQUEST['gDossier'];
+				$p_module.=3D " dossier : " . $_REQUEST['gDossier'];
 			$sql =3D "insert into audit_connect (ac_user,ac_ip,ac_module,ac_url,a=
c_state) values ($1,$2,$3,$4,$5)";
=20
 			$cn->exec_sql($sql, array(



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Dec 08 15:40:45 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ThRCX-0001sa-QH
	for mharc-phpcompta-dev@gnu.org; Sat, 08 Dec 2012 15:40:45 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat,  8 Dec 2012 21:30:45 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.923647.1354999245.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5166 - phpcompta/tags/rel650/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 08 Dec 2012 20:40:45 -0000

Author: danydb
Date: 2012-12-08 21:30:44 +0100 (Sat, 08 Dec 2012)
New Revision: 5166

Modified:
   phpcompta/tags/rel650/include/impress_jrn.inc.php
Log:
rewriting

Modified: phpcompta/tags/rel650/include/impress_jrn.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/impress_jrn.inc.php	2012-12-08 20:12:14=
 UTC (rev 5165)
+++ phpcompta/tags/rel650/include/impress_jrn.inc.php	2012-12-08 20:30:44=
 UTC (rev 5166)
@@ -118,8 +118,8 @@
 print td('Jusque ').$w->input('to_periode',$periode_end);
 print "</TR><TR>";
 $a=3Darray(
-       array('value'=3D>0,'label'=3D>'Detaill=C3=A9'),
-       array('value'=3D>1,'label'=3D>'Simple')
+       array('value'=3D>0,'label'=3D>'Ecriture comptable'),
+       array('value'=3D>1,'label'=3D>'Liste op=C3=A9rations')
    );
 $w->selected=3D1;
 print '</TR>';
@@ -146,18 +146,18 @@
     $d=3Dvar_export($_GET,true);
     $Jrn=3Dnew Acc_Ledger($cn,$_GET['jrn_id']);
     $Jrn->get_name();
-    if ( $_GET['p_simple']=3D=3D0 )
-    {
-        $Row=3D$Jrn->get_row( $_GET['from_periode'],
-                            $_GET['to_periode']
-                          );
-    }
-    else
-    {
-        $Row=3D$Jrn->get_rowSimple($_GET['from_periode'],
-                                 $_GET['to_periode']
-                                );
-    }
+	switch ($_GET['p_simple'])
+	{
+		case "0":
+			 $Row=3D$Jrn->get_row( $_GET['from_periode'],$_GET['to_periode']);
+			break;
+		case "1":
+			$Row=3D$Jrn->get_rowSimple($_GET['from_periode'],$_GET['to_periode'])=
;
+			break;
+		default:
+			var_dump($_GET['p_simple']);
+			die (__FILE__.":".__LINE__." error unknown style ");
+	}
     $rep=3D"";
     $hid=3Dnew IHidden();
     echo '<div class=3D"content">';
@@ -199,7 +199,9 @@
         exit;
=20
     echo '<TABLE class=3D"result">';
-
+	///////////////////////////////////////////////////////////////////////=
//////////////
+	// Ecriture comptable
+	///////////////////////////////////////////////////////////////////////=
//////////////
     if ( $_GET['p_simple'] =3D=3D 0 )
     {
         // detailled printing
@@ -230,7 +232,11 @@
             "</TR>";
         }// end loop
     } // if
-    else
+	///////////////////////////////////////////////////////////////////////=
//////////////
+	// Liste op=C3=A9rations
+	///////////////////////////////////////////////////////////////////////=
//////////////
+
+    elseif ( $_GET['p_simple'] =3D=3D 1 )
     {
         // Simple printing
         //---
@@ -242,7 +248,7 @@
         "<th>internal</th>".
 	  th('Tiers').
         "<th>Commentaire</th>".
-        "<th> montant</th>".
+        "<th>Total op=C3=A9ration</th>".
         "</TR>";
         // set a filter for the FIN
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Dec 08 17:58:44 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ThTM4-0001hg-ND
	for mharc-phpcompta-dev@gnu.org; Sat, 08 Dec 2012 17:58:44 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat,  8 Dec 2012 23:48:31 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.923692.1355007524.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5167 - in phpcompta/tags/rel650: doc include
	include/template sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 08 Dec 2012 22:58:43 -0000

Author: danydb
Date: 2012-12-08 23:48:30 +0100 (Sat, 08 Dec 2012)
New Revision: 5167

Added:
   phpcompta/tags/rel650/include/template/operation_detail_ach.php
   phpcompta/tags/rel650/include/template/operation_detail_fin.php
   phpcompta/tags/rel650/include/template/operation_detail_misc.php
   phpcompta/tags/rel650/include/template/operation_detail_ven.php
Modified:
   phpcompta/tags/rel650/doc/manuel-fr.odt
   phpcompta/tags/rel650/include/class_acc_ledger.php
   phpcompta/tags/rel650/include/impress_jrn.inc.php
   phpcompta/tags/rel650/include/template/ledger_detail_ach.php
   phpcompta/tags/rel650/sql/upgrade.sql
Log:
Ajout IMPJRN, d?\195?\169tail op?\195?\169ration

Modified: phpcompta/tags/rel650/doc/manuel-fr.odt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(Binary files differ)

Modified: phpcompta/tags/rel650/include/class_acc_ledger.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/class_acc_ledger.php	2012-12-08 20:30:4=
4 UTC (rev 5166)
+++ phpcompta/tags/rel650/include/class_acc_ledger.php	2012-12-08 22:48:3=
0 UTC (rev 5167)
@@ -545,7 +545,7 @@
              jrn_def_type,
              jrn.jr_tech_per
              FROM jrn join jrn_def on (jrn_def_id=3Djr_def_id)
-             WHERE $periode $jrn order by jr_date $cond_limite";
+             WHERE $periode $jrn order by jr_date,substring(jrn.jr_pj_nu=
mber,'\\\d+$')::numeric asc  $cond_limite";
=20
 		$Res =3D $this->db->exec_sql($sql);
 		$Max =3D Database::num_row($Res);

Modified: phpcompta/tags/rel650/include/impress_jrn.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/impress_jrn.inc.php	2012-12-08 20:30:44=
 UTC (rev 5166)
+++ phpcompta/tags/rel650/include/impress_jrn.inc.php	2012-12-08 22:48:30=
 UTC (rev 5167)
@@ -1,4 +1,5 @@
 <?php
+
 /*
  *   This file is part of PhpCompta.
  *
@@ -15,10 +16,10 @@
  *   You should have received a copy of the GNU General Public License
  *   along with PhpCompta; if not, write to the Free Software
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-130=
7  USA
-*/
+ */
 /* $Revision$ */
 // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-/*! \file
+/* ! \file
  * \brief ask for Printing the ledger (pdf,html)
  */
=20
@@ -28,32 +29,34 @@
 require_once('class_exercice.php');
 require_once('class_dossier.php');
 load_all_script();
-$gDossier=3Ddossier::id();
+$gDossier =3D dossier::id();
 global $g_user;
 //-----------------------------------------------------
 // Show the jrn and date
 //-----------------------------------------------------
 require_once('class_database.php');
=20
-if ( $g_user->Admin() =3D=3D 0 && $g_user->is_local_admin()=3D=3D0)
+if ($g_user->Admin() =3D=3D 0 && $g_user->is_local_admin() =3D=3D 0)
 {
-    $sql=3D"select jrn_def_id,jrn_def_name
+	$sql =3D "select jrn_def_id,jrn_def_name
          from jrn_def join jrn_type on jrn_def_type=3Djrn_type_id
          join user_sec_jrn on uj_jrn_id=3Djrn_def_id
          where
          uj_login=3D'$g_user->login'
          and uj_priv in ('R','W')
+		 order by jrn_def_name
          ";
-    $ret=3D$cn->make_array($sql);
+	$ret =3D $cn->make_array($sql);
 }
 else
 {
-    $ret=3D$cn->make_array("select jrn_def_id,jrn_def_name
-                         from jrn_def join jrn_type on jrn_def_type=3Djr=
n_type_id");
-
+	$ret =3D $cn->make_array("select jrn_def_id,jrn_def_name
+                         from jrn_def join jrn_type on jrn_def_type=3Djr=
n_type_id
+						 order by jrn_def_name
+						 ");
 }
 // Count the forbidden journaux
-$NoPriv=3D$cn->count_sql("select jrn_def_id,jrn_def_name,jrn_def_class_d=
eb,jrn_def_class_cred,jrn_type_id,jrn_desc,uj_priv,
+$NoPriv =3D $cn->count_sql("select jrn_def_id,jrn_def_name,jrn_def_class=
_deb,jrn_def_class_cred,jrn_type_id,jrn_desc,uj_priv,
                        jrn_deb_max_line,jrn_cred_max_line
                        from jrn_def join jrn_type on jrn_def_type=3Djrn_=
type_id
                        join  user_sec_jrn on uj_jrn_id=3Djrn_def_id
@@ -62,15 +65,15 @@
                        and uj_priv =3D'X'
                        ");
 // Pour voir tout les journal ?
-if ( $NoPriv =3D=3D 0 && $ret !=3D null )
+if ($NoPriv =3D=3D 0 && $ret !=3D null)
 {
-    $a=3Dcount($ret);
-    $all=3Darray('value'=3D>0,'label'=3D>'Tous les journaux');
-    $ret[$a]=3D$all;
+	$a =3D count($ret);
+	$all =3D array('value' =3D> 0, 'label' =3D> 'Tous les journaux');
+	$ret[$a] =3D $all;
 }
-if ( count($ret) < 1 )
-    NoAccess();
-$exercice=3D(isset($_GET['exercice']))?$_GET['exercice']:$g_user->get_ex=
ercice();
+if (count($ret) < 1)
+	NoAccess();
+$exercice =3D (isset($_GET['exercice'])) ? $_GET['exercice'] : $g_user->=
get_exercice();
=20
 //-----------------------------------------------------
 // Form
@@ -79,56 +82,58 @@
 /*
  * Let you change the exercice
  */
-echo '<fieldset><legend>'._('Choississez un autre exercice').'</legend>'=
;;
+echo '<fieldset><legend>' . _('Choississez un autre exercice') . '</lege=
nd>';
+;
 echo '<form method=3D"GET">';
 echo 'Choississez un autre exercice :';
-$ex=3Dnew Exercice($cn);
-$wex=3D$ex->select('exercice',$exercice,' onchange=3D"submit(this)"');
+$ex =3D new Exercice($cn);
+$wex =3D $ex->select('exercice', $exercice, ' onchange=3D"submit(this)"'=
);
 echo $wex->input();
 echo dossier::hidden();
-echo HtmlInput::get_to_hidden(array('ac','type'));
+echo HtmlInput::get_to_hidden(array('ac', 'type'));
 echo '</form>';
 echo '</fieldset>';
=20
=20
=20
-echo '<FORM METHOD=3D"GET">'.dossier::hidden();
-echo HtmlInput::get_to_hidden(array('ac','type'));
-echo HtmlInput::hidden('type','jrn');
+echo '<FORM METHOD=3D"GET">' . dossier::hidden();
+echo HtmlInput::get_to_hidden(array('ac', 'type'));
+echo HtmlInput::hidden('type', 'jrn');
 echo HtmlInput::get_to_hidden(array('exercice'));
 echo '<TABLE  ><TR>';
-$w=3Dnew ISelect();
-$w->table=3D1;
-$label=3D"Choississez le journal";
-$w->selected=3D(isset($_GET['jrn_id']))?$_GET['jrn_id']:'';
-print td($label).$w->input("jrn_id",$ret);
+$w =3D new ISelect();
+$w->table =3D 1;
+$label =3D "Choississez le journal";
+$w->selected =3D (isset($_GET['jrn_id'])) ? $_GET['jrn_id'] : '';
+print td($label) . $w->input("jrn_id", $ret);
 print '</TR>';
 print '<TR>';
 // filter on the current year
-$filter_year=3D" where p_exercice=3D'".sql_string($exercice)."'";
+$filter_year =3D " where p_exercice=3D'" . sql_string($exercice) . "'";
=20
-$periode_start=3D$cn->make_array("select p_id,to_char(p_start,'DD-MM-YYY=
Y') from parm_periode $filter_year order by p_start,p_end");
-$w->selected=3D(isset($_GET['from_periode']))?$_GET['from_periode']:'';
-print td('Depuis').$w->input('from_periode',$periode_start);
+$periode_start =3D $cn->make_array("select p_id,to_char(p_start,'DD-MM-Y=
YYY') from parm_periode $filter_year order by p_start,p_end");
+$w->selected =3D (isset($_GET['from_periode'])) ? $_GET['from_periode'] =
: '';
+print td('Depuis') . $w->input('from_periode', $periode_start);
 print '</TR>';
 print '<TR>';
=20
-$periode_end=3D$cn->make_array("select p_id,to_char(p_end,'DD-MM-YYYY') =
from parm_periode $filter_year order by p_start,p_end");
-$w->selected=3D(isset($_GET['to_periode']))?$_GET['to_periode']:'';
-print td('Jusque ').$w->input('to_periode',$periode_end);
+$periode_end =3D $cn->make_array("select p_id,to_char(p_end,'DD-MM-YYYY'=
) from parm_periode $filter_year order by p_start,p_end");
+$w->selected =3D (isset($_GET['to_periode'])) ? $_GET['to_periode'] : ''=
;
+print td('Jusque ') . $w->input('to_periode', $periode_end);
 print "</TR><TR>";
-$a=3Darray(
-       array('value'=3D>0,'label'=3D>'Ecriture comptable'),
-       array('value'=3D>1,'label'=3D>'Liste op=C3=A9rations')
-   );
-$w->selected=3D1;
+$a =3D array(
+	array('value' =3D> 0, 'label' =3D> 'Ecriture comptable'),
+	array('value' =3D> 1, 'label' =3D> 'Liste op=C3=A9rations'),
+	array('value' =3D> 2, 'label' =3D> 'Avec D=C3=A9tails op=C3=A9rations '=
)
+);
+$w->selected =3D 1;
 print '</TR>';
 print '<TR>';
-$w->selected=3D(isset($_GET['p_simple']))?$_GET['p_simple']:'';
-echo td('Style d\'impression').$w->input('p_simple',$a);
+$w->selected =3D (isset($_GET['p_simple'])) ? $_GET['p_simple'] : '';
+echo td('Style d\'impression') . $w->input('p_simple', $a);
 print "</TR>";
 echo '</TABLE>';
-print HtmlInput::submit('bt_html','Visualisation');
+print HtmlInput::submit('bt_html', 'Visualisation');
=20
 echo '</FORM>';
=20
@@ -139,168 +144,239 @@
 // First time in html
 // after in pdf or cvs
 //-----------------------------------------------------
-if ( isset( $_REQUEST['bt_html'] ) )
+if (isset($_REQUEST['bt_html']))
 {
-    require_once("class_acc_ledger.php");
+	require_once("class_acc_ledger.php");
=20
-    $d=3Dvar_export($_GET,true);
-    $Jrn=3Dnew Acc_Ledger($cn,$_GET['jrn_id']);
-    $Jrn->get_name();
+	$d =3D var_export($_GET, true);
+	$Jrn =3D new Acc_Ledger($cn, $_GET['jrn_id']);
+	$Jrn->get_name();
 	switch ($_GET['p_simple'])
 	{
 		case "0":
-			 $Row=3D$Jrn->get_row( $_GET['from_periode'],$_GET['to_periode']);
+			$Row =3D $Jrn->get_row($_GET['from_periode'], $_GET['to_periode']);
 			break;
 		case "1":
-			$Row=3D$Jrn->get_rowSimple($_GET['from_periode'],$_GET['to_periode'])=
;
+			$Row =3D $Jrn->get_rowSimple($_GET['from_periode'], $_GET['to_periode=
']);
 			break;
+		case "2":
+			$Row =3D $Jrn->get_rowSimple($_GET['from_periode'], $_GET['to_periode=
']);
+			break;
 		default:
 			var_dump($_GET['p_simple']);
-			die (__FILE__.":".__LINE__." error unknown style ");
+			die(__FILE__ . ":" . __LINE__ . " error unknown style ");
 	}
-    $rep=3D"";
-    $hid=3Dnew IHidden();
-    echo '<div class=3D"content">';
-    echo '<h2 class=3D"info">'.h($Jrn->name).'</h2>';
-    echo "<table>";
-    echo '<TR>';
-    echo '<TD><form method=3D"GET" ACTION=3D"?">'.dossier::hidden().
-    $hid->input("type","jrn").$hid->input('p_action','impress')."</form>=
</TD>";
+	$rep =3D "";
+	$hid =3D new IHidden();
+	echo '<div class=3D"content">';
+	echo '<h2 class=3D"info">' . h($Jrn->name) . '</h2>';
+	echo "<table>";
+	echo '<TR>';
+	if ($_GET['p_simple'] =3D=3D 0 || $_GET['p_simple'] =3D=3D 1)
+	{
+		echo '<TD><form method=3D"GET" ACTION=3D"?">' . dossier::hidden() .
+		$hid->input("type", "jrn") . $hid->input('p_action', 'impress') . "</f=
orm></TD>";
=20
-    echo '<TD><form method=3D"GET" ACTION=3D"export.php">'.dossier::hidd=
en().
-    HtmlInput::submit('bt_pdf',"Export PDF").
-      HtmlInput::hidden('act','PDF:ledger').
-    $hid->input("type","jrn").
-    $hid->input("jrn_id",$Jrn->id).
-    $hid->input("from_periode",$_GET['from_periode']).
-    $hid->input("to_periode",$_GET['to_periode']);
-    echo $hid->input("p_simple",$_GET['p_simple']);
-    echo HtmlInput::get_to_hidden(array('ac','type'));
-    echo "</form></TD>";
+		echo '<TD><form method=3D"GET" ACTION=3D"export.php">' . dossier::hidd=
en() .
+		HtmlInput::submit('bt_pdf', "Export PDF") .
+		HtmlInput::hidden('act', 'PDF:ledger') .
+		$hid->input("type", "jrn") .
+		$hid->input("jrn_id", $Jrn->id) .
+		$hid->input("from_periode", $_GET['from_periode']) .
+		$hid->input("to_periode", $_GET['to_periode']);
+		echo $hid->input("p_simple", $_GET['p_simple']);
+		echo HtmlInput::get_to_hidden(array('ac', 'type'));
+		echo "</form></TD>";
=20
-    echo '<TD><form method=3D"GET" ACTION=3D"export.php">'.dossier::hidd=
en().
-    HtmlInput::submit('bt_csv',"Export CSV").
-      HtmlInput::hidden('act','CSV:ledger').
-    $hid->input("type","jrn").
-    $hid->input("jrn_id",$Jrn->id).
-    $hid->input("from_periode",$_GET['from_periode']).
-    $hid->input("to_periode",$_GET['to_periode']);
-    echo $hid->input("p_simple",$_GET['p_simple']);
-    echo HtmlInput::get_to_hidden(array('ac','type'));
-    echo "</form></TD>";
+		echo '<TD><form method=3D"GET" ACTION=3D"export.php">' . dossier::hidd=
en() .
+		HtmlInput::submit('bt_csv', "Export CSV") .
+		HtmlInput::hidden('act', 'CSV:ledger') .
+		$hid->input("type", "jrn") .
+		$hid->input("jrn_id", $Jrn->id) .
+		$hid->input("from_periode", $_GET['from_periode']) .
+		$hid->input("to_periode", $_GET['to_periode']);
+		echo $hid->input("p_simple", $_GET['p_simple']);
+		echo HtmlInput::get_to_hidden(array('ac', 'type'));
+		echo "</form></TD>";
+	}
 	echo '<td style=3D"vertical-align:top">';
 	echo HtmlInput::print_window();
 	echo '</td>';
-    echo "</TR>";
+	echo "</TR>";
=20
-    echo "</table>";
-    if ( count($Jrn->row ) =3D=3D 0
-            && $Row=3D=3Dnull)
-        exit;
+	echo "</table>";
+	if (count($Jrn->row) =3D=3D 0
+			&& $Row =3D=3D null)
+		exit;
=20
-    echo '<TABLE class=3D"result">';
+
 	///////////////////////////////////////////////////////////////////////=
//////////////
 	// Ecriture comptable
 	///////////////////////////////////////////////////////////////////////=
//////////////
-    if ( $_GET['p_simple'] =3D=3D 0 )
-    {
-        // detailled printing
-        //---
-        foreach ( $Jrn->row as $op )
-        {
-	    $class=3D"";
-	    if ( $op['j_date'] !=3D '' )
-	      {
-		$class=3D"odd";
-	      }
+	if ($_GET['p_simple'] =3D=3D 0)
+	{
+		echo '<TABLE class=3D"result">';
+		// detailled printing
+		//---
+		foreach ($Jrn->row as $op)
+		{
+			$class =3D "";
+			if ($op['j_date'] !=3D '')
+			{
+				$class =3D "odd";
+			}
=20
-            echo "<TR  class=3D\"$class\">";
+			echo "<TR  class=3D\"$class\">";
=20
-            echo "<TD>".$op['j_date']."</TD>";
-            echo "<TD >".$op['jr_pj_number']."</TD>";
+			echo "<TD>" . $op['j_date'] . "</TD>";
+			echo "<TD >" . $op['jr_pj_number'] . "</TD>";
=20
=20
-            if ( $op['internal']!=3D'')
-                echo "<TD>".HtmlInput::detail_op($op['jr_id'],$op['inter=
nal'])."</TD>";
-            else
-                echo td();
+			if ($op['internal'] !=3D '')
+				echo "<TD>" . HtmlInput::detail_op($op['jr_id'], $op['internal']) . =
"</TD>";
+			else
+				echo td();
=20
-            echo "<TD >".$op['poste']."</TD>".
-            "<TD  >".$op['description']."</TD>".
-	      "<TD   style=3D\"text-align:right\">".nbm($op['deb_montant'])."</=
TD>".
-	      "<TD style=3D\"text-align:right\">".nbm($op['cred_montant'])."</T=
D>".
-            "</TR>";
-        }// end loop
-    } // if
+			echo "<TD >" . $op['poste'] . "</TD>" .
+			"<TD  >" . $op['description'] . "</TD>" .
+			"<TD   style=3D\"text-align:right\">" . nbm($op['deb_montant']) . "</=
TD>" .
+			"<TD style=3D\"text-align:right\">" . nbm($op['cred_montant']) . "</T=
D>" .
+			"</TR>";
+		}// end loop
+		echo "</table>";
+		// show the saldo
+
+		$solde =3D $Jrn->get_solde($_GET['from_periode'], $_GET['to_periode'])=
;
+		echo "solde d&eacute;biteur:" . $solde[0] . "<br>";
+		echo "solde cr&eacute;diteur:" . $solde[1];
+	} // if
 	///////////////////////////////////////////////////////////////////////=
//////////////
 	// Liste op=C3=A9rations
 	///////////////////////////////////////////////////////////////////////=
//////////////
+	elseif ($_GET['p_simple'] =3D=3D 1)
+	{
+		// Simple printing
+		//---
+		echo '<TABLE class=3D"result">';
+		echo "<TR>" .
+		"<th> operation </td>" .
+		"<th>Date</th>" .
+		"<th> n=C2=B0 de pi=C3=A8ce </th>" .
+		"<th>internal</th>" .
+		th('Tiers') .
+		"<th>Commentaire</th>" .
+		"<th>Total op=C3=A9ration</th>" .
+		"</TR>";
+		// set a filter for the FIN
+		$i =3D 0;
+		foreach ($Row as $line)
+		{
+			$i++;
+			$class =3D ($i % 2 =3D=3D 0) ? ' class=3D"even" ' : ' class=3D"odd" '=
;
+			echo "<tr $class>";
+			echo "<TD>" . $line['num'] . "</TD>";
+			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 =3D $Jrn->get_tiers($line['jrn_def_type'], $line['jr_id']);
+			echo td($tiers);
+			echo "<TD>" . h($line['comment']) . "</TD>";
=20
-    elseif ( $_GET['p_simple'] =3D=3D 1 )
-    {
-        // Simple printing
-        //---
=20
-        echo "<TR>".
-        "<th> operation </td>".
-        "<th>Date</th>".
-        "<th> n=C2=B0 de pi=C3=A8ce </th>".
-        "<th>internal</th>".
-	  th('Tiers').
-        "<th>Commentaire</th>".
-        "<th>Total op=C3=A9ration</th>".
-        "</TR>";
-        // set a filter for the FIN
+			//	  echo "<TD>".$line['pj']."</TD>";
+			// If the ledger is financial :
+			// the credit must be negative and written in red
+			// Get the jrn type
+			if ($line['jrn_def_type'] =3D=3D 'FIN')
+			{
+				$positive =3D $cn->get_value("select qf_amount from quant_fin where =
jr_id=3D$1", array($line['jr_id']));
+				if ($cn->count() =3D=3D 0)
+					$positive =3D 1;
+				else
+					$positive =3D ($positive > 0) ? 1 : 0;
=20
-        foreach ($Row as $line)
-        {
-            echo "<tr>";
-            echo "<TD>".$line['num']."</TD>";
-            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=3D$Jrn->get_tiers($line['jrn_def_type'],$line['jr_id']);
-	    echo td($tiers);
-            echo "<TD>".h($line['comment'])."</TD>";
+				echo "<TD align=3D\"right\">";
+				echo ( $positive =3D=3D 0 ) ? "<font color=3D\"red\">  - " . nbm($li=
ne['montant']) . "</font>" : nbm($line['montant']);
+				echo "</TD>";
+			}
+			else
+			{
+				echo "<TD align=3D\"right\">" . nbm($line['montant']) . "</TD>";
+			}
=20
+			echo "</tr>";
+		}
+		echo "</table>";
+	}
+	///////////////////////////////////////////////////////////////////////=
//////////////
+	// D=C3=A9taill=C3=A9
+	///////////////////////////////////////////////////////////////////////=
//////////////
+	elseif ($_GET['p_simple'] =3D=3D 2)
+	{
+		foreach ($Row as $line)
+		{
+			echo '<div style=3D"margin-top:2px;margin-bottom:10px;border:solid 1p=
x black">';
+			$class =3D ' class=3D"odd" style=3D"font-stretch: expanded;font-size:=
12px;"';
+			echo '<table class=3D"result" style=3D"font-weight: bolder;font-varia=
nt: small-caps;width:100%;">';
+			echo "<tr $class>";
+			echo '<TD style=3D"width:5%">' . $line['date'] . "</TD>";
+			echo '<TD style=3D"width:10%">' . h($line['jr_pj_number']) . "</TD>";
+			echo '<TD style=3D"width:5%">' . HtmlInput::detail_op($line['jr_id'],=
 $line['jr_internal']) . "</TD>";
+			$tiers =3D $Jrn->get_tiers($line['jrn_def_type'], $line['jr_id']);
+			$ledger_name =3D $cn->get_value("select jrn_def_name from jrn_def whe=
re jrn_def_id=3D$1", array($line['jr_def_id']));
+			echo '<TD style=3D"width:20%">' . h($ledger_name) . ' </td>';
+			echo '<TD style=3D"width:20%">' . h($tiers) . ' </td>';
+			echo '<TD style=3D"width:30%">' . h($line['comment']) . "</TD>";
+			echo '<TD style=3D"text-align:right">';
+			if ($line['jrn_def_type'] =3D=3D 'FIN')
+			{
+				$positive =3D $cn->get_value("select qf_amount from quant_fin where =
jr_id=3D$1", array($line['jr_id']));
+				if ($cn->count() =3D=3D 0)
+					$positive =3D 1;
+				else
+					$positive =3D ($positive > 0) ? 1 : 0;
=20
-            //	  echo "<TD>".$line['pj']."</TD>";
-            // If the ledger is financial :
-            // the credit must be negative and written in red
-            // Get the jrn type
-            if ( $line['jrn_def_type'] =3D=3D 'FIN' )
-            {
-	      $positive =3D $cn->get_value("select qf_amount from quant_fin whe=
re jr_id=3D$1",
-					       array($line['jr_id']));
-	      if ($cn->count() !=3D 0)
-		$positive =3D 1;
-	      else
-                $positive =3D ($positive > 0)?1:0;
+				echo ( $positive =3D=3D 0 ) ? "<font color=3D\"red\">  - " . nbm($li=
ne['montant']) . "</font>" : nbm($line['montant']);
+			}
+			else
+			{
+				echo  nbm($line['montant']) ;
+			}
+			echo  "</TD>";
+			echo "</tr>";
+			echo '</table>';
+			/////////////////////////////////////////////////////////////////////=
/////////////////////////////////
+			// Add detail for each operation
+			/////////////////////////////////////////////////////////////////////=
/////////////////////////////////
+			$op =3D new Acc_Operation($cn);
+			$op->jr_id =3D $line['jr_id'];
+			$op->get();
+			$obj =3D $op->get_quant();
+			switch ($obj->signature)
+			{
+				case 'FIN':
+					require 'template/operation_detail_fin.php';
+					break;
+				case 'ACH':
+					require 'template/operation_detail_ach.php';
+					break;
+				case 'VEN':
+					require 'template/operation_detail_ven.php';
+					break;
+				case 'ODS':
+					require 'template/operation_detail_misc.php';
+					break;
+				default:
+					die("unknown type of ledger");
+					break;
+			}
+			echo '</div>';
+			//echo '<div style=3D"display:block;height:15px"></div>';
+		} // end loop
+	}
=20
-                echo "<TD align=3D\"right\">";
-                echo ( $positive !=3D 0 )?"<font color=3D\"red\">  - ".n=
bm($line['montant'])."</font>":nbm($line['montant']);
-                echo "</TD>";
-            }
-            else
-            {
-	      echo "<TD align=3D\"right\">".nbm($line['montant'])."</TD>";
-            }
-
-            echo "</tr>";
-        }
-
-    } //else
-    echo "</table>";
-    // show the saldo
-
-    $solde=3D$Jrn->get_solde( $_GET['from_periode'],
-                            $_GET['to_periode']
-                          );
-    echo "solde d&eacute;biteur:".$solde[0]."<br>";
-    echo "solde cr&eacute;diteur:".$solde[1];
-
-    echo "</div>";
-    exit;
+	echo "</div>";
+	exit;
 }
=20
 echo '</div>';

Modified: phpcompta/tags/rel650/include/template/ledger_detail_ach.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/template/ledger_detail_ach.php	2012-12-=
08 20:30:44 UTC (rev 5166)
+++ phpcompta/tags/rel650/include/template/ledger_detail_ach.php	2012-12-=
08 22:48:30 UTC (rev 5167)
@@ -211,9 +211,9 @@
=20
   }
   if ($owner->MY_TVA_USE=3D=3D'Y')
-	  $row=3D td(_('Total'),' style=3D"font-style:italic;text-align:right;f=
ont-weight: bolder;widtg:auto" colspan=3D"6"');
+	  $row=3D td(_('Total'),' style=3D"font-style:italic;text-align:right;f=
ont-weight: bolder;width:auto" colspan=3D"6"');
   else
-	  $row=3D td(_('Total'),' style=3D"font-style:italic;text-align:right;f=
ont-weight: bolder;widtg:auto" colspan=3D"6"');
+	  $row=3D td(_('Total'),' style=3D"font-style:italic;text-align:right;f=
ont-weight: bolder;width:auto" colspan=3D"6"');
 $row.=3Dtd(nbm($total_htva),'class=3D"num" style=3D"font-style:italic;fo=
nt-weight: bolder;"');
 if ($owner->MY_TVA_USE=3D=3D'Y')
   $row.=3Dtd("").td(nbm($total_tvac),'class=3D"num" style=3D"font-style:=
italic;font-weight: bolder;"');

Added: phpcompta/tags/rel650/include/template/operation_detail_ach.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/template/operation_detail_ach.php	     =
                   (rev 0)
+++ phpcompta/tags/rel650/include/template/operation_detail_ach.php	2012-=
12-08 22:48:30 UTC (rev 5167)
@@ -0,0 +1,122 @@
+<?php
+/*
+ *   This file is part of PhpCompta.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published b=
y
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief show detail of a operation of purchase
+ *
+ */
+global $g_parameter;
+?>
+<table class=3D"result" >
+	<?
+	bcscale(2);
+	$total_htva =3D 0;
+	$total_tvac =3D 0;
+	echo th(_('Quick Code'));
+	echo th(_('Description'));
+	if ($g_parameter->MY_TVA_USE =3D=3D 'Y')
+	{
+		echo th(_('Taux TVA'), 'style=3D"text-align:right"');
+	}
+	else
+	{
+		echo th('');
+	}
+	echo th(_('Prix/Un.'), 'style=3D"text-align:right"');
+	echo th(_('Quantit=C3=A9'), 'style=3D"text-align:right"');
+	echo th(_('Non ded'), 'style=3D"text-align:right"');
+
+	if ($g_parameter->MY_TVA_USE =3D=3D 'Y')
+	{
+		echo th(_('HTVA'), 'style=3D"text-align:right"');
+		echo th(_('TVA'), 'style=3D"text-align:right"');
+		echo th(_('TVAC'), 'style=3D"text-align:right"');
+	}else
+		echo th(_('Total'), 'style=3D"text-align:right"');
+
+	echo '</tr>';
+	for ($e =3D 0; $e < count($obj->det->array); $e++)
+	{
+		$row =3D '';
+		$q =3D $obj->det->array[$e];
+		$fiche =3D new Fiche($cn, $q['qp_fiche']);
+		$view_card_detail =3D HtmlInput::card_detail($fiche->strAttribut(ATTR_=
DEF_QUICKCODE), "", ' class=3D"line" ');
+		$row =3D td($view_card_detail);
+		$sym_tva =3D '';
+
+		if ($g_parameter->MY_TVA_USE =3D=3D 'Y' && $q['qp_vat_code'] !=3D '')
+		{
+			/* retrieve TVA symbol */
+			$tva =3D new Acc_Tva($cn, $q['qp_vat_code']);
+			$tva->load();
+			$sym_tva =3D h($tva->get_parameter('label'));
+		}
+		$input =3D new ISpan("e_march" . $q['j_id'] . "_label");
+		$hidden =3D HtmlInput::hidden("j_id[]", $q['j_id']);
+		$input->value =3D $fiche->strAttribut(ATTR_DEF_NAME);
+		$row.=3Dtd($input->input() . $hidden);
+		$row.=3Dtd($sym_tva, 'style=3D"text-align:center"');
+		$pu =3D 0;
+		if ($q['qp_quantite'] !=3D 0)
+			$pu =3D bcdiv($q['qp_price'], $q['qp_quantite']);
+		$row.=3Dtd(nbm($pu), 'class=3D"num"');
+		$row.=3Dtd(nbm($q['qp_quantite']), 'class=3D"num"');
+
+		$no_ded =3D bcadd($q['qp_dep_priv'], $q['qp_nd_amount']);
+		$row.=3Dtd(nbm($no_ded), ' style=3D"text-align:right"');
+		$htva =3D $q['qp_price'];
+
+
+		$row.=3Dtd(nbm($htva), 'class=3D"num"');
+		$tvac =3D bcadd($htva, $q['qp_vat']);
+		$tvac =3D bcadd($tvac, $q['qp_nd_tva']);
+		$tvac =3D bcadd($tvac, $q['qp_nd_tva_recup']);
+
+
+		if ($g_parameter->MY_TVA_USE =3D=3D 'Y')
+		{
+			$tva_amount =3D bcadd($q['qp_vat'], $q['qp_nd_tva']);
+			$tva_amount =3D bcadd($tva_amount, $q['qp_nd_tva_recup']);
+			$class =3D "";
+			if ($q['qp_vat_sided'] <> 0)
+			{
+				$class =3D ' style=3D"text-decoration:line-through"';
+				$tvac =3D bcsub($tvac, $q['qp_vat']);
+			}
+			$row.=3Dtd(nbm($tva_amount), 'class=3D"num" ' . $class);
+			$row.=3Dtd(nbm($tvac), 'class=3D"num"');
+		}
+		$total_tvac+=3D$tvac;
+		$total_htva+=3D$htva;
+		echo tr($row);
+	}
+	if ($g_parameter->MY_TVA_USE =3D=3D 'Y')
+		$row =3D td(_('Total'), ' style=3D"font-style:italic;text-align:right;=
font-weight: bolder;width:auto" colspan=3D"6"');
+	else
+		$row =3D td(_('Total'), ' style=3D"font-style:italic;text-align:right;=
font-weight: bolder;width:auto" colspan=3D"6"');
+	$row.=3Dtd(nbm($total_htva), 'class=3D"num" style=3D"font-style:italic;=
font-weight: bolder;"');
+	if ($g_parameter->MY_TVA_USE =3D=3D 'Y')
+		$row.=3Dtd("") . td(nbm($total_tvac), 'class=3D"num" style=3D"font-sty=
le:italic;font-weight: bolder;"');
+	echo tr($row);
+	?>
+</table>

Added: phpcompta/tags/rel650/include/template/operation_detail_fin.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/template/operation_detail_fin.php	     =
                   (rev 0)
+++ phpcompta/tags/rel650/include/template/operation_detail_fin.php	2012-=
12-08 22:48:30 UTC (rev 5167)
@@ -0,0 +1,50 @@
+<?php
+
+/*
+ *   This file is part of PhpCompta.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published b=
y
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief show detail of a operation of fin
+ *
+ */
+echo '<table class=3D"result">';
+echo '<tr>';
+echo th('Compte en banque');
+echo th('Tiers');
+echo th('Libell=C3=A9');
+echo th('Montant');
+echo '</tr>';
+
+echo '<tr>';
+$bk =3D new Fiche($cn, $obj->det->array[0]['qf_bank']);
+$view_card_detail =3D HtmlInput::card_detail($bk->get_quick_code(), h($b=
k->getName()), ' class=3D"line" ');
+echo  td($view_card_detail);
+$other =3D new Fiche($cn, $obj->det->array[0]['qf_other']);
+$view_card_detail =3D HtmlInput::card_detail($other->get_quick_code(), h=
($other->getName()), ' class=3D"line" ');
+echo  td($view_card_detail);
+$comment =3D strip_tags($obj->det->jr_comment);
+echo  td($comment);
+echo td(nbm($obj->det->array[0]['qf_amount']), ' class=3D"inum"');
+echo '</tr>';
+echo '</table>';
+?>
+

Added: phpcompta/tags/rel650/include/template/operation_detail_misc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/template/operation_detail_misc.php	    =
                    (rev 0)
+++ phpcompta/tags/rel650/include/template/operation_detail_misc.php	2012=
-12-08 22:48:30 UTC (rev 5167)
@@ -0,0 +1,86 @@
+<?php
+/*
+ *   This file is part of PhpCompta.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published b=
y
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief how detail of a misc operation
+ *
+ */
+?>
+<table class=3D"result">
+<tr>
+<?
+    echo th(_('Poste Comptable'));
+    echo th(_('Quick Code'));
+    echo th(_('Libell=C3=A9'));
+echo th(_('D=C3=A9bit'), 'style=3D"text-align:right"');
+echo th(_('Cr=C3=A9dit'), 'style=3D"text-align:right"');
+echo '</tr>';
+$amount_idx=3D0;
+for ($e =3D 0; $e < count($obj->det->array); $e++)
+{
+	$row =3D '';
+	$q =3D $obj->det->array;
+	$view_history =3D sprintf('<A class=3D"detail" style=3D"text-decoration=
:underline" HREF=3D"javascript:view_history_account(\'%s\',\'%s\')" >%s</=
A>', $q[$e]['j_poste'], $gDossier, $q[$e]['j_poste']);
+
+	$row.=3Dtd($view_history);
+
+	if ($q[$e]['j_qcode'] !=3D '')
+	{
+		$fiche =3D new Fiche($cn);
+		$fiche->get_by_qcode($q[$e]['j_qcode']);
+		$view_history =3D sprintf('<A class=3D"detail" style=3D"text-decoratio=
n:underline" HREF=3D"javascript:view_history_card(\'%s\',\'%s\')" >%s</A>=
', $fiche->id, $gDossier, $q[$e]['j_qcode']);
+	}
+	else
+		$view_history =3D '';
+	$row.=3Dtd($view_history);
+	$l_lib =3D $q[$e]['j_text'];
+
+	if ($l_lib !=3D '')
+	{
+		$l_lib =3D $q[$e]['j_text'];
+	}
+	else if ($q[$e]['j_qcode'] !=3D '')
+	{
+		// nom de la fiche
+		$ff =3D new Fiche($cn);
+		$ff->get_by_qcode($q[$e]['j_qcode']);
+		$l_lib =3D $ff->strAttribut(ATTR_DEF_NAME);
+	}
+	else
+	{
+		// libell=C3=A9 du compte
+		$name =3D $cn->get_value('select pcm_lib from tmp_pcmn where pcm_val=3D=
$1', array($q[$e]['j_poste']));
+		$l_lib =3D $name;
+	}
+	$l_lib =3D strip_tags($l_lib);
+	$input =3D new ISpan("e_march" . $q[$e]['j_id'] . "_label");
+	$input->value =3D $l_lib;
+	$hidden =3D HtmlInput::hidden("j_id[]", $q[$e]['j_id']);
+	$row.=3Dtd($input->input() . $hidden);
+	$montant =3D td(nbm($q[$e]['j_montant']), 'class=3D"num"');
+	$row.=3D($q[$e]['j_debit'] =3D=3D 't') ? $montant : td('');
+	$row.=3D($q[$e]['j_debit'] =3D=3D 'f') ? $montant : td('');
+	echo tr($row);
+}
+?>
+</table>
\ No newline at end of file

Added: phpcompta/tags/rel650/include/template/operation_detail_ven.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/template/operation_detail_ven.php	     =
                   (rev 0)
+++ phpcompta/tags/rel650/include/template/operation_detail_ven.php	2012-=
12-08 22:48:30 UTC (rev 5167)
@@ -0,0 +1,107 @@
+<?php
+
+/*
+ *   This file is part of PhpCompta.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published b=
y
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief show detail of a operation of sale
+ *
+ */
+global $g_parameter;
+?>
+<table class=3D"result">
+<?
+  bcscale(2);
+  $total_htva=3D0;$total_tvac=3D0;
+  echo th(_('Quick Code'));
+echo th(_('Description'));
+echo th(_('Prix/Un'), 'style=3D"text-align:right"');
+echo th(_('Quantit=C3=A9'), 'style=3D"text-align:right"');
+if ( $g_parameter->MY_TVA_USE =3D=3D 'Y')
+  echo th(_('Taux TVA'), 'style=3D"text-align:right"');
+else
+  echo th('');
+if ( $g_parameter->MY_TVA_USE =3D=3D 'Y') {
+  echo th(_('HTVA'), 'style=3D"text-align:right"');
+  echo th(_('TVA'), 'style=3D"text-align:right"');
+  echo th(_('TVAC'), 'style=3D"text-align:right"');
+} else
+  echo th(_('Total'), 'style=3D"text-align:right"');
+
+
+echo '</tr>';
+  for ($e=3D0;$e<count($obj->det->array);$e++) {
+    $row=3D'';
+    $q=3D$obj->det->array[$e];
+    $fiche=3Dnew Fiche($cn,$q['qs_fiche']);
+	$view_card_detail=3DHtmlInput::card_detail($fiche->strAttribut(ATTR_DEF=
_QUICKCODE),"", ' class=3D"line" ');
+	$row.=3Dtd($view_card_detail);
+        $input =3D new ISpan("e_march" . $q['j_id'] . "_label");
+        $hidden =3D HtmlInput::hidden("j_id[]", $q['j_id']);
+        $input->value =3D $fiche->strAttribut(ATTR_DEF_NAME);
+
+    $row.=3Dtd($input->input().$hidden);
+    $sym_tva=3D'';
+	$pu=3D0;
+	if ($q['qs_quantite'] !=3D 0)	$pu=3Dbcdiv($q['qs_price'],$q['qs_quantit=
e']);
+    $row.=3Dtd(nbm($pu),'class=3D"num"');
+    $row.=3Dtd(nbm($q['qs_quantite']),'class=3D"num"');
+	$sym_tva=3D'';
+   if ( $g_parameter->MY_TVA_USE=3D=3D'Y' && $q['qs_vat_code'] !=3D '') =
{
+     /* retrieve TVA symbol */
+     $tva=3Dnew Acc_Tva($cn,$q['qs_vat_code']);
+     $tva->load();
+     $sym_tva=3D(h($tva->get_parameter('label')));
+     //     $sym_tva=3D$sym
+   }
+
+   $row.=3Dtd($sym_tva,'style=3D"text-align:center"');
+
+    $htva=3D$q['qs_price'];
+
+    $row.=3Dtd(nbm($htva),'class=3D"num"');
+    $tvac=3Dbcadd($htva,$q['qs_vat']);
+    if ($g_parameter->MY_TVA_USE=3D=3D'Y')
+      {
+		$class=3D"";
+		if ($q['qs_vat_sided'] !=3D 0) {
+			$class=3D' style=3D"text-decoration:line-through"';
+			$tvac=3Dbcsub($tvac,$q['qs_vat']);
+		}
+		$row.=3Dtd(nbm($q['qs_vat']),'class=3D"num"'.$class);
+		$row.=3Dtd(nbm($tvac),'class=3D"num"');
+      }
+    $total_tvac=3Dbcadd($total_tvac,$tvac);
+    $total_htva=3Dbcadd($total_htva,$htva);
+    echo tr($row);
+
+  }
+  if ($g_parameter->MY_TVA_USE=3D=3D'Y')
+	$row=3D td(_('Total'),' style=3D"font-style:italic;text-align:right;fon=
t-weight: bolder;" colspan=3D"5"');
+  else
+	$row=3D td(_('Total'),' style=3D"font-style:italic;text-align:right;fon=
t-weight: bolder;" colspan=3D"5"');
+$row.=3Dtd(nbm($total_htva),'class=3D"num" style=3D"font-style:italic;fo=
nt-weight: bolder;"');
+if ($g_parameter->MY_TVA_USE=3D=3D'Y')
+  $row.=3Dtd("").td(nbm($total_tvac),'class=3D"num" style=3D"font-style:=
italic;font-weight: bolder;"');
+echo tr($row);
+?>
+</table>
\ No newline at end of file

Modified: phpcompta/tags/rel650/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/sql/upgrade.sql	2012-12-08 20:30:44 UTC (rev 51=
66)
+++ phpcompta/tags/rel650/sql/upgrade.sql	2012-12-08 22:48:30 UTC (rev 51=
67)
@@ -25,7 +25,7 @@
=20
 update tmp_pcmn  set pcm_val_parent  =3D '62' where pcm_val=3D'6202';
=20
-update fiche_detail set ad_value =3D to_number(ad_value,'9.99')*100 wher=
e ad_id in  (21,22,20,31) and ad_value is not null and ad_value <> '';
+update fiche_detail set ad_value =3D (to_number(ad_value,'9.99')*100)::t=
ext where ad_id in  (21,22,20,31) and ad_value is not null and ad_value <=
> '';
=20
 update menu_ref set me_code=3D'ACHISTO' WHERE me_code=3D'ACHIMP';
 update menu_ref set me_code=3D'VEHISTO' WHERE me_code=3D'VENIMP';



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Dec 14 13:45:36 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TjaGO-0007Ab-V2
	for mharc-phpcompta-dev@gnu.org; Fri, 14 Dec 2012 13:45:36 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 14 Dec 2012 19:35:47 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.945059.1355510736.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5168 - phpcompta/tags/rel650/include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 14 Dec 2012 18:45:35 -0000

Author: danydb
Date: 2012-12-14 19:35:46 +0100 (Fri, 14 Dec 2012)
New Revision: 5168

Modified:
   phpcompta/tags/rel650/include/template/operation_detail_ach.php
Log:
add personal expense

Modified: phpcompta/tags/rel650/include/template/operation_detail_ach.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/template/operation_detail_ach.php	2012-=
12-08 22:48:30 UTC (rev 5167)
+++ phpcompta/tags/rel650/include/template/operation_detail_ach.php	2012-=
12-14 18:35:46 UTC (rev 5168)
@@ -44,6 +44,7 @@
 	}
 	echo th(_('Prix/Un.'), 'style=3D"text-align:right"');
 	echo th(_('Quantit=C3=A9'), 'style=3D"text-align:right"');
+	echo th(_('Personnel'), 'style=3D"text-align:right"');
 	echo th(_('Non ded'), 'style=3D"text-align:right"');
=20
 	if ($g_parameter->MY_TVA_USE =3D=3D 'Y')
@@ -82,7 +83,8 @@
 		$row.=3Dtd(nbm($pu), 'class=3D"num"');
 		$row.=3Dtd(nbm($q['qp_quantite']), 'class=3D"num"');
=20
-		$no_ded =3D bcadd($q['qp_dep_priv'], $q['qp_nd_amount']);
+		$no_ded =3D $q['qp_nd_amount'];
+		$row.=3Dtd(nbm($q['qp_dep_priv']), 'style=3D"text-align:right"');
 		$row.=3Dtd(nbm($no_ded), ' style=3D"text-align:right"');
 		$htva =3D $q['qp_price'];
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Dec 14 14:08:05 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Tjac8-0002wr-VT
	for mharc-phpcompta-dev@gnu.org; Fri, 14 Dec 2012 14:08:04 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 14 Dec 2012 19:58:23 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.945085.1355512084.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5169 - phpcompta/tags/rel650/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 14 Dec 2012 19:08:03 -0000

Author: danydb
Date: 2012-12-14 19:58:23 +0100 (Fri, 14 Dec 2012)
New Revision: 5169

Modified:
   phpcompta/tags/rel650/include/impress_jrn.inc.php
Log:
remove "choississez votre exercice"

Modified: phpcompta/tags/rel650/include/impress_jrn.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/impress_jrn.inc.php	2012-12-14 18:35:46=
 UTC (rev 5168)
+++ phpcompta/tags/rel650/include/impress_jrn.inc.php	2012-12-14 18:58:23=
 UTC (rev 5169)
@@ -82,17 +82,17 @@
 /*
  * Let you change the exercice
  */
+echo '<form method=3D"GET">';
 echo '<fieldset><legend>' . _('Choississez un autre exercice') . '</lege=
nd>';
 ;
-echo '<form method=3D"GET">';
 echo 'Choississez un autre exercice :';
 $ex =3D new Exercice($cn);
 $wex =3D $ex->select('exercice', $exercice, ' onchange=3D"submit(this)"'=
);
 echo $wex->input();
 echo dossier::hidden();
 echo HtmlInput::get_to_hidden(array('ac', 'type'));
+echo '</fieldset>';
 echo '</form>';
-echo '</fieldset>';
=20
=20
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Dec 14 15:51:03 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TjcDn-0004Th-1h
	for mharc-phpcompta-dev@gnu.org; Fri, 14 Dec 2012 15:51:03 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 14 Dec 2012 21:41:15 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.945184.1355518262.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r446 - in trunk/rapport_avance: . include
	include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 14 Dec 2012 20:51:01 -0000

Author: danydb
Date: 2012-12-14 21:41:14 +0100 (Fri, 14 Dec 2012)
New Revision: 446

Modified:
   trunk/rapport_avance/ajax_save_param_detail.php
   trunk/rapport_avance/include/class_formulaire_param.php
   trunk/rapport_avance/include/class_formulaire_param_detail.php
   trunk/rapport_avance/include/class_rapav_declaration.php
   trunk/rapport_avance/include/class_rapport_avance_sql.php
   trunk/rapport_avance/include/template/param_detail_new.php
   trunk/rapport_avance/rapav_javascript.js
Log:
Ajout formule : op?\195?\169ration rapproch?\195?\169es

Modified: trunk/rapport_avance/ajax_save_param_detail.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/rapport_avance/ajax_save_param_detail.php	2012-11-29 21:44:01 U=
TC (rev 445)
+++ trunk/rapport_avance/ajax_save_param_detail.php	2012-12-14 20:41:14 U=
TC (rev 446)
@@ -147,6 +147,37 @@
 			$html.=3D'</td>';
 		}
 		break;
+
+		case 'new_reconcile_id':
+		$acc_account =3D new RAPAV_Reconcile();
+		$acc_account->tmp_val =3D $acrec_first;
+		$acc_account->with_tmp_val =3D $acrec_second;
+		$acc_account->operation_pcm_val =3D $acrec_third;
+		$acc_account->p_id =3D $p_id;
+		$acc_account->type_detail =3D 5;
+		$acc_account->type_sum_account=3D $account_sum_type;
+		if ($acc_account->verify() =3D=3D 1)
+		{
+			$code =3D 'nok';
+			$html =3D $acc_account->errcode;
+		}
+		else
+		{
+			$acc_account->insert();
+			$fp_id =3D $acc_account->fp_id;
+			$code =3D 'ok';
+			$html =3D '<td>';
+			ob_start();
+			$acc_account->display_row();
+			$html.=3Dob_get_contents();
+			ob_end_clean();
+			$html.=3D '</td>';
+			$html.=3D'<td id=3D"del_' . $acc_account->fp_id . '">';
+			$html.=3DHtmlInput::anchor("Effacer", "", sprintf("onclick=3D\"delete=
_param_detail('%s','%s','%s','%s')\""
+									, $_REQUEST['plugin_code'], $_REQUEST['ac'], $_REQUEST['gDossie=
r'], $acc_account->fp_id));
+			$html.=3D'</td>';
+		}
+		break;
 }
 //echo $html;exit();
 $html =3D escape_xml($html);

Modified: trunk/rapport_avance/include/class_formulaire_param.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/rapport_avance/include/class_formulaire_param.php	2012-11-29 21=
:44:01 UTC (rev 445)
+++ trunk/rapport_avance/include/class_formulaire_param.php	2012-12-14 20=
:41:14 UTC (rev 446)
@@ -188,6 +188,9 @@
 			case '4':
 				return new RAPAV_Account($this->parametre[$p_index]['fp_id']);
 				break;
+			case '5':
+				return new RAPAV_Reconcile($this->parametre[$p_index]['fp_id']);
+				break;
 		}
 	}
 	/**

Modified: trunk/rapport_avance/include/class_formulaire_param_detail.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/rapport_avance/include/class_formulaire_param_detail.php	2012-1=
1-29 21:44:01 UTC (rev 445)
+++ trunk/rapport_avance/include/class_formulaire_param_detail.php	2012-1=
2-14 20:41:14 UTC (rev 446)
@@ -192,7 +192,7 @@
=20
 }
 /**
- * @TODO poste comptable utilis=C3=A9 avec le poste comptable, choix ent=
re diff cr=C3=A9dit - debit, diff d=C3=A9bit-cr=C3=A9dit, cr=C3=A9dit, d=C3=
=A9bit
+ *@brief poste comptable utilis=C3=A9 avec le poste comptable, choix ent=
re diff cr=C3=A9dit - debit, diff d=C3=A9bit-cr=C3=A9dit, cr=C3=A9dit, d=C3=
=A9bit
  */
 class RAPAV_Account extends Formulaire_Param_Detail
 {
@@ -228,11 +228,11 @@
 		echo $sum_type->input();
 		echo '</p>';
 		echo '<p>';
-		echo 'du poste comptable ';
+		echo 'du poste comptable '.HtmlInput::infobulle(203);
 		echo $account->input();
 		echo '</p>';
 		echo '<p>';
-		echo ' utilis=C3=A9 avec le poste comptable ';
+		echo ' utilis=C3=A9 avec le poste comptable '.HtmlInput::infobulle(203=
);
 		echo $account_second->input();
 		echo '</p>';
 	}
@@ -248,5 +248,74 @@
 	}
=20
 }
+/**
+ *@brief poste comptable utilis=C3=A9 avec le poste comptable, choix ent=
re diff cr=C3=A9dit - debit, diff d=C3=A9bit-cr=C3=A9dit, cr=C3=A9dit, d=C3=
=A9bit
+ */
+class RAPAV_Reconcile extends Formulaire_Param_Detail
+{
=20
+	function display_row()
+	{
+		global $cn;
+		$total_type_account=3D$cn->get_value('select tt_label from rapport_adv=
anced.total_type_account where tt_id=3D$1',
+				array($this->type_sum_account));
+		printf("Total %s poste comptable %s utilis=C3=A9 avec le poste comptab=
le %s rapproch=C3=A9e dans la p=C3=A9riode donn=C3=A9e
+			avec une op=C3=A9ration utilisant le poste comptable %s",
+				$total_type_account,$this->tmp_val,$this->with_tmp_val,$this->operat=
ion_pcm_val);
+	}
+
+	static function new_row($p_id)
+	{
+		global $cn;
+		$sum_type=3Dnew ISelect('account_sum_type');
+		$sum_type->value=3D$cn->make_array("select tt_id, tt_label from rappor=
t_advanced.total_type_account ");
+
+		$account =3D new IPoste("acrec_first", "", "acrec_first_id");
+		$account->size =3D 10;
+		$account->label =3D _("Recherche poste");
+		$account->set_attribute('gDossier', dossier::id());
+		$account->set_attribute('account', $account->id);
+
+		$account_second =3D new IPoste("acrec_second", "", "acrec_second_id");
+		$account_second->size =3D 10;
+		$account_second->label =3D _("Recherche poste");
+		$account_second->set_attribute('gDossier', dossier::id());
+		$account_second->set_attribute('account', $account_second->id);
+
+		$account_third =3D new IPoste("acrec_third", "", "acrec_third_id");
+		$account_third->size =3D 10;
+		$account_third->label =3D _("Recherche poste");
+		$account_third->set_attribute('gDossier', dossier::id());
+		$account_third->set_attribute('account', $account_third->id);
+		echo '<p>';
+		echo 'Calculer ';
+		echo $sum_type->input();
+		echo '</p>';
+		echo '<p>';
+		echo 'du poste comptable '.HtmlInput::infobulle(203);
+		echo $account->input();
+		echo '</p>';
+		echo '<p>';
+		echo ' utilis=C3=A9 avec le poste comptable '.HtmlInput::infobulle(203=
);
+		echo $account_second->input();
+		echo '</p>';
+		echo '<p>';
+		echo ' rapproch=C3=A9 avec une op=C3=A9ration dans la p=C3=A9riode don=
n=C3=A9e utilisant le poste comptable '.HtmlInput::infobulle(203);
+		echo $account_third->input();
+
+		echo '</p>';
+	}
+	function verify()
+	{
+
+		if ( trim($this->tmp_val)=3D=3D"" || trim($this->with_tmp_val)=3D=3D""=
 ||trim($this->operation_pcm_val)=3D=3D'')
+		{
+			$this->errcode=3D" Un poste comptable est manquant";
+			return 1;
+		}
+		return 0;
+	}
+
+}
+
 ?>

Modified: trunk/rapport_avance/include/class_rapav_declaration.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/rapport_avance/include/class_rapav_declaration.php	2012-11-29 2=
1:44:01 UTC (rev 445)
+++ trunk/rapport_avance/include/class_rapav_declaration.php	2012-12-14 2=
0:41:14 UTC (rev 446)
@@ -250,7 +250,7 @@
 		$this->amount =3D "0";
=20
 		$array =3D $cn->get_array("select fp_id,p_id,tmp_val,tva_id,fp_formula=
,fp_signed,jrn_def_type,tt_id,type_detail,
-			with_tmp_val,type_sum_account
+			with_tmp_val,type_sum_account,operation_pcm_val
 			from rapport_advanced.formulaire_param_detail where p_id=3D$1", array=
($this->param->p_id));
 		$this->compute_date($p_start, $p_end);
 		for ($e =3D 0; $e < count($array); $e++)
@@ -294,6 +294,9 @@
 			case '4':
 				$ret =3D new Rapav_dd_Account();
 				break;
+			case '5':
+				$ret =3D new Rapav_dd_Reconcile();
+				break;
 			default:
 				throw new Exception("Type inconnu");
 		}
@@ -311,7 +314,8 @@
 	function from_array($p_array)
 	{
 		$this->form =3D new Formulaire_Param_Detail();
-		$attribute =3D explode(',', 'fp_id,p_id,tmp_val,tva_id,fp_formula,fp_s=
igned,jrn_def_type,tt_id,type_detail,with_tmp_val,type_sum_account');
+		$attribute =3D explode(',',
+				'fp_id,p_id,tmp_val,tva_id,fp_formula,fp_signed,jrn_def_type,tt_id,t=
ype_detail,with_tmp_val,type_sum_account,operation_pcm_val');
 		foreach ($attribute as $e)
 		{
 			$this->form->$e =3D $p_array[$e];
@@ -635,5 +639,135 @@
 	}
=20
 }
+/**
+ * @brief handle the param_detail type Account
+ * The type_sum_account gives the type of total
+ *   - 0 D-C
+ *   - 1 C-D
+ *   - 2 D
+ *   - 4 C
+ * it uses tmp_val, with_tmp_val and type_sum_account
+ * @see RAPAV_Account
+ */
+class Rapav_dd_Reconcile extends Rapav_Declaration_Detail
+{
=20
+	function compute($p_start, $p_end)
+	{
+		global $cn;
+		bcscale(2);
+		switch ($this->form->type_sum_account)
+		{
+			// Saldo
+			case 1:
+			case 2:
+				// Compute D-C
+				$sql =3D "
+						select sum(tv_amount.jrnx_amount)
+							from (
+								select distinct jrn1.j_id,j1.jr_id,
+								case when jrn1.j_debit =3D 't' then jrn1.j_montant else jrn1.j_m=
ontant*(-1) end as jrnx_amount
+								from jrnx as jrn1
+								join jrnx as jrn2 on (jrn1.j_grpt=3Djrn2.j_grpt)
+								join jrn as j1 on (jrn1.j_grpt=3Dj1.jr_grpt_id)
+								where
+								jrn1.j_poste like $1
+								and	jrn2.j_poste like $2
+								) as tv_amount
+							join jrn_rapt as rap1 on (rap1.jr_id=3Dtv_amount.jr_id or rap1.jr=
a_concerned=3Dtv_amount.jr_id)
+							join (select distinct jrn3.j_id,j2.jr_id
+								from jrnx as jrn3
+								join jrn as j2 on (j2.jr_grpt_id=3Djrn3.j_grpt)
+								where
+							(jrn3.j_date >=3D to_date($3,'DD.MM.YYYY') and jrn3.j_date <=3D t=
o_date($4,'DD.MM.YYYY')) and
+								 jrn3.j_poste like $5) as reconc on (rap1.jr_id=3Dreconc.jr_id o=
r rap1.jra_concerned=3Dreconc.jr_id)
+
+							 ";
+				$amount=3D$cn->get_value($sql,array(
+					$this->form->tmp_val,
+					$this->form->with_tmp_val,
+					$p_start,
+					$p_end,
+					$this->form->operation_pcm_val
+					));
+				// if C-D is asked then reverse the result
+				if ($this->form->type_sum_account=3D=3D2) $amount=3Dbcmul($amount,-1=
);
+				break;
+			// Only DEBIT
+			case 3:
+					$sql =3D "
+						select sum(tv_amount.jrnx_amount)
+							from (
+								select distinct jrn1.j_id,j1.jr_id,
+								jrn1.j_montant as jrnx_amount
+								from jrnx as jrn1
+								join jrnx as jrn2 on (jrn1.j_grpt=3Djrn2.j_grpt)
+								join jrn as j1 on (jrn1.j_grpt=3Dj1.jr_grpt_id)
+								where
+								jrn1.j_poste like $1
+								and	jrn2.j_poste like $2
+								and jrn1.j_debit=3D't'
+								) as tv_amount
+							join jrn_rapt as rap1 on (rap1.jr_id=3Dtv_amount.jr_id or rap1.jr=
a_concerned=3Dtv_amount.jr_id)
+							join (select distinct jrn3.j_id,j2.jr_id
+								from jrnx as jrn3
+								join jrn as j2 on (j2.jr_grpt_id=3Djrn3.j_grpt)
+								where
+							(jrn3.j_date >=3D to_date($3,'DD.MM.YYYY') and jrn3.j_date <=3D t=
o_date($4,'DD.MM.YYYY')) and
+								 jrn3.j_poste like $5) as reconc on (rap1.jr_id=3Dreconc.jr_id o=
r rap1.jra_concerned=3Dreconc.jr_id)
+
+							 ";
+				$amount=3D$cn->get_value($sql,array(
+					$this->form->tmp_val,
+					$this->form->with_tmp_val,
+					$p_start,
+					$p_end,
+					$this->form->operation_pcm_val
+					));
+				break;
+			// Only CREDIT
+			case 4:
+					$sql =3D "
+					select sum(tv_amount.jrnx_amount)
+							from (
+								select distinct jrn1.j_id,j1.jr_id,
+								jrn1.j_montant  as jrnx_amount
+								from jrnx as jrn1
+								join jrnx as jrn2 on (jrn1.j_grpt=3Djrn2.j_grpt)
+								join jrn as j1 on (jrn1.j_grpt=3Dj1.jr_grpt_id)
+								where
+								jrn1.j_poste like $1
+								and	jrn2.j_poste like $2
+								and jrn1.j_debit=3D'f'
+								) as tv_amount
+							join jrn_rapt as rap1 on (rap1.jr_id=3Dtv_amount.jr_id or rap1.jr=
a_concerned=3Dtv_amount.jr_id)
+							join (select distinct jrn3.j_id,j2.jr_id
+								from jrnx as jrn3
+								join jrn as j2 on (j2.jr_grpt_id=3Djrn3.j_grpt)
+								where
+							(jrn3.j_date >=3D to_date($3,'DD.MM.YYYY') and jrn3.j_date <=3D t=
o_date($4,'DD.MM.YYYY')) and
+								 jrn3.j_poste like $5) as reconc on (rap1.jr_id=3Dreconc.jr_id o=
r rap1.jra_concerned=3Dreconc.jr_id)
+
+							 ";
+				$amount=3D$cn->get_value($sql,array(
+					$this->form->tmp_val,
+					$this->form->with_tmp_val,
+					$p_start,
+					$p_end,
+					$this->form->operation_pcm_val
+					));
+				break;
+
+			default:
+				if ( DEBUG) var_dump($this);
+				die (__FILE__.":".__LINE__." UNKNOW SUM TYPE");
+				break;
+		}
+		/*
+		 * 4 possibilities with type_sum_account
+		 */
+		return $amount;
+	}
+
+}
 ?>

Modified: trunk/rapport_avance/include/class_rapport_avance_sql.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/rapport_avance/include/class_rapport_avance_sql.php	2012-11-29 =
21:44:01 UTC (rev 445)
+++ trunk/rapport_avance/include/class_rapport_avance_sql.php	2012-12-14 =
20:41:14 UTC (rev 446)
@@ -120,7 +120,8 @@
 			"tt_id"=3D>"tt_id",
 			"type_detail"=3D>"type_detail",
 			"with_tmp_val"=3D>"with_tmp_val",
-			"type_sum_account"=3D>"type_sum_account"
+			"type_sum_account"=3D>"type_sum_account",
+			"operation_pcm_val"=3D>"operation_pcm_val"
 		);
=20
 		$this->type =3D array(
@@ -134,7 +135,8 @@
 			"tt_id"=3D>"numeric",
 			"type_detail"=3D>"numeric",
 			"with_tmp_val"=3D>"text",
-			"type_sum_account"=3D>"numeric"
+			"type_sum_account"=3D>"numeric",
+			"operation_pcm_val"=3D>"text"
=20
 		);
=20

Modified: trunk/rapport_avance/include/template/param_detail_new.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/rapport_avance/include/template/param_detail_new.php	2012-11-29=
 21:44:01 UTC (rev 445)
+++ trunk/rapport_avance/include/template/param_detail_new.php	2012-12-14=
 20:41:14 UTC (rev 446)
@@ -52,10 +52,17 @@
 			Poste comptable
 		</a>
 	</td>
+	<td id=3D"new_reconcile_id_bt"  class=3D"tool" style=3D"background:inhe=
rit">
+		<a class=3D"mtitle" href=3D"javascript:void(0)"   onclick=3D"show_type=
_formula('new_reconcile_id')">
+			Op=C3=A9rations rapproch=C3=A9es
+		</a>
+	</td>
 </tr>
 </table>
 <div style=3D"width:100%;height:290px;margin:1px">
 	<span class=3D"error" id=3D"param_detail_info_div"></span>
+
+	<div style=3D"padding: 10px">
 <div id=3D"new_formula_id" style=3D"display: block">
 	<p>
 	Entrer une formule avec des postes comptables, la syntaxe est la m=C3=AA=
me que celle des "rapports"
@@ -111,4 +118,16 @@
=20
 </form>
 </div>
+		<div id=3D"new_reconcile_id" style=3D"display: none">
+<form id=3D"new_padee" method=3D"POST" onsubmit=3D"save_param_detail('ne=
w_padee');return false">
+
+	<?=3DHtmlInput::request_to_hidden(array('gDossier','ac','plugin_code','=
p_id'))?>
+
+	<?=3DHtmlInput::hidden('tab','new_reconcile_id')?>
+		<?=3DRAPAV_Reconcile::new_row($p_id)?>
+<?=3DHtmlInput::submit('save','Sauve')?>
+
+</form>
+</div>
+	</div>
 </div>
\ No newline at end of file

Modified: trunk/rapport_avance/rapav_javascript.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/rapport_avance/rapav_javascript.js	2012-11-29 21:44:01 UTC (rev=
 445)
+++ trunk/rapport_avance/rapav_javascript.js	2012-12-14 20:41:14 UTC (rev=
 446)
@@ -2,6 +2,7 @@
=20
 content[200]=3D"Le code doit =C3=AAtre unique pour ce formulaire";
 content[201]=3D"Formula TODO";
+content[203]=3D"Utiliser le % pour indiquer les postes comptables qui en=
 d=C3=A9pendent ex: 70% pour reprendre tous les comptes commen=C3=A7ant p=
ar 70";
=20
 /**
  *@brief show the definition of a form and let it modify it
@@ -87,9 +88,9 @@
 				onSuccess:function(req){
 					remove_waiting_box();
 					removeDiv('param_detail_div');
-					var nTop=3Dcalcy(100);
+					var nTop=3Dcalcy(90);
 					var nLeft=3D"200px";
-					var str_style=3D"top:"+nTop+"px;left:"+nLeft+";width:50em;height:au=
to";
+					var str_style=3D"top:"+nTop+"px;left:"+nLeft+";width:70em;height:au=
to";
 					add_div({
 						id:'param_detail_div',
 						style:str_style,
@@ -214,7 +215,7 @@
 {
 	try
 	{
-		var div=3D['new_account_tva_id','new_formula_id','new_compute_id','new=
_account_id'];
+		var div=3D['new_account_tva_id','new_formula_id','new_compute_id','new=
_account_id','new_reconcile_id'];
 		for (var r =3D0;r<div.length;r++ ) {
 			$(div[r]).hide();
 			$(div[r]+'_bt').style.backgroundColor=3D"inherit";



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Dec 14 15:59:18 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TjcLm-0007J1-UD
	for mharc-phpcompta-dev@gnu.org; Fri, 14 Dec 2012 15:59:18 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 14 Dec 2012 21:49:33 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.945188.1355518758.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r447 - trunk/rapport_avance/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 14 Dec 2012 20:59:17 -0000

Author: danydb
Date: 2012-12-14 21:49:32 +0100 (Fri, 14 Dec 2012)
New Revision: 447

Modified:
   trunk/rapport_avance/include/class_rapav_declaration.php
Log:
Ajout d'une p?\195?\169riode : depuis d?\195?\169but exercice jusque date=
 de fin

Modified: trunk/rapport_avance/include/class_rapav_declaration.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/rapport_avance/include/class_rapav_declaration.php	2012-12-14 2=
0:41:14 UTC (rev 446)
+++ trunk/rapport_avance/include/class_rapav_declaration.php	2012-12-14 2=
0:49:32 UTC (rev 447)
@@ -213,6 +213,11 @@
 				$exercice =3D $g_user->get_exercice();
 				$exercice-=3D3;
 				break;
+			case 6:
+				list($this->start, $this->end) =3D $g_user->get_limit_current_exerci=
ce();
+				$this->end=3D$p_end;
+				return;
+				break;
 			default:
 				throw new Exception('compute_date : t_id est incorrect');
 		}



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Dec 14 18:35:06 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TjemY-00040L-Cy
	for mharc-phpcompta-dev@gnu.org; Fri, 14 Dec 2012 18:35:06 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 15 Dec 2012 00:25:18 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.945561.1355528105.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r448 - in trunk/rapport_avance: . include
	include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 14 Dec 2012 23:35:05 -0000

Author: danydb
Date: 2012-12-15 00:25:17 +0100 (Sat, 15 Dec 2012)
New Revision: 448

Modified:
   trunk/rapport_avance/include/class_formulaire_param.php
   trunk/rapport_avance/include/formulaire.inc.php
   trunk/rapport_avance/include/template/formulaire_listing.php
   trunk/rapport_avance/rapav_javascript.js
   trunk/rapport_avance/raw.php
Log:
Ajout import / export d'une definition de formulaire

Modified: trunk/rapport_avance/include/class_formulaire_param.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/rapport_avance/include/class_formulaire_param.php	2012-12-14 20=
:49:32 UTC (rev 447)
+++ trunk/rapport_avance/include/class_formulaire_param.php	2012-12-14 23=
:25:17 UTC (rev 448)
@@ -34,6 +34,7 @@
  */
 class Formulaire_Param extends Formulaire_Param_Sql
 {
+
 	/**
 	 * Factory, create an object following the $form->p_type,
 	 * @param Formulaire_Param_Sql $form
@@ -54,7 +55,115 @@
 		}
 	}
=20
+	/**
+	 * @brief export a form to CSV to stdout
+	 * @global type $cn database connx
+	 * @param type $p_id the formulaire.f_id
+	 */
+	static function to_csv($p_id)
+	{
+		global $cn;
+		$form =3D new formulaire_sql($p_id);
+		$form->load();
+		$title =3D mb_strtolower($form->f_title, 'UTF-8');
+		$title =3D str_replace(array('/', '*', '<', '>', '*', '.', '+', ':', '=
?', '!', " ", ";"), "_", $title);
+
+		$out =3D fopen("php://output", "w");
+		header('Pragma: public');
+		header('Content-type: application/bin');
+		header('Content-Disposition: attachment;filename=3D"' . $title . '.bin=
"', FALSE);
+		fputcsv($out, array("RAPAV", '2'), ";");
+		fputcsv($out, array($form->f_title, $form->f_description));
+		$array =3D $cn->get_array("select p_id,p_code, p_libelle, p_type, p_or=
der, f_id, p_info, t_id
+			from rapport_advanced.formulaire_param where f_id=3D$1", array($p_id)=
);
+		for ($i =3D 0; $i < count($array); $i++)
+		{
+			fputcsv($out, $array[$i], ";");
+		}
+		fputcsv($out, array('RAPAV_DETAIL'), ";");
+		$array =3D $cn->get_array("select
+			fp_id, p_id, tmp_val, tva_id, fp_formula, fp_signed, jrn_def_type,
+			tt_id, type_detail, with_tmp_val, type_sum_account, operation_pcm_val
+			from rapport_advanced.formulaire_param_detail where p_id in (select p=
_id from rapport_advanced.formulaire_param where f_id=3D$1)", array($p_id=
));
+		for ($i =3D 0; $i < count($array); $i++)
+		{
+			fputcsv($out, $array[$i], ";");
+		}
+	}
+
+	static function from_csv($filename)
+	{
+		global $cn;
+		$in =3D fopen($filename, "r");
+		$cn->start();
+		try
+		{
+			$a =3D fgetcsv($in, 0, ";");
+			if ($a[0] !=3D "RAPAV")
+			{
+				throw new Exception('Formulaire invalide');
+			}
+			// $a[1] contains the version
+			// first line is the title and description
+			$form =3D new formulaire_sql();
+			$first =3D fgetcsv($in, 0, ";");
+			var_dump($first);
+			$form->f_title =3D $first[0];
+			if (isset($first[1]))
+				$form->f_description =3D $first[1];
+			$form->insert();
+			// now come the formulaire_param until the keyword RAPAV_DETAIL is me=
t
+			while (($csv =3D fgetcsv($in, 0, ";")) !=3D FALSE)
+			{
+				if ($csv[0] !=3D "RAPAV_DETAIL")
+				{
+					$csv[5]=3D$form->f_id;
+					$cn->get_array("INSERT INTO rapport_advanced.restore_formulaire_par=
am(
+						    p_id, p_code, p_libelle, p_type, p_order, f_id, p_info, t_id)
+								VALUES ($1, $2, $3, $4, $5, $6, $7, $8)", $csv);
+				} else
+					break;
+			}
+			while (($csv =3D fgetcsv($in, 0, ";")) !=3D FALSE)
+			{
+				$t =3D array();
+				for ($o =3D 0; $o < count($csv); $o++)
+				{
+					if ($csv[$o] =3D=3D "")
+						$t[$o] =3D null;
+					else
+					{
+						$t[$o] =3D $csv[$o];
+					}
+				}
+				$cn->get_array("INSERT INTO rapport_advanced.restore_formulaire_para=
m_detail(
+            fp_id, p_id, tmp_val, tva_id, fp_formula, fp_signed, jrn_def=
_type,
+            tt_id, type_detail, with_tmp_val, type_sum_account, operatio=
n_pcm_val)
+				VALUES ($1, $2, $3, $4, $5, $6, $7,$8, $9, $10, $11, $12)", $t);
+			}
+			/// Update now the table  rapport_advanced.restore_formulaire_param a=
nd set the correct pk
+			$cn->exec_sql("update rapport_advanced.restore_formulaire_param set p=
_id=3Dnextval('rapport_advanced.formulaire_param_p_id_seq')");
+			$cn->exec_sql("update rapport_advanced.restore_formulaire_param_detai=
l set fp_id=3Dnextval('rapport_advanced.formulaire_param_detail_fp_id_seq=
')");
+
+			$cn->exec_sql('insert into rapport_advanced.formulaire_param select  =
p_id, p_code, p_libelle, p_type, p_order, f_id, p_info, t_id
+				from rapport_advanced.restore_formulaire_param where f_id=3D$1',arra=
y($form->f_id));
+
+			$cn->exec_sql('insert into rapport_advanced.formulaire_param_detail s=
elect fp_id, p_id, tmp_val, tva_id, fp_formula, fp_signed, jrn_def_type,
+            tt_id, type_detail, with_tmp_val, type_sum_account, operatio=
n_pcm_val from  rapport_advanced.restore_formulaire_param_detail where p_=
id in (
+			select p_id from rapport_advanced.restore_formulaire_param where f_id=
=3D$1)',array($form->f_id));
+
+			$cn->exec_sql('delete from  rapport_advanced.restore_formulaire_param=
 where f_id=3D$1',array($form->f_id));
+			$cn->commit();
+		}
+		catch (Exception $exc)
+		{
+			echo $exc->getTraceAsString();
+			throw $exc;
+		}
+	}
+
 }
+
 /**
  * @brief mother class of \Formulaire_Title1|\Formulaire_Title2|\Formula=
ire_Title3|\Formulaire_Formula
  */
@@ -84,12 +193,12 @@
 	static function load_all($p_id)
 	{
 		global $cn;
-		$a_value =3D $cn->get_array("select fp_id,type_detail from rapport_adv=
anced.formulaire_param_detail where p_id=3D$1",
-				array($p_id));
+		$a_value =3D $cn->get_array("select fp_id,type_detail from rapport_adv=
anced.formulaire_param_detail where p_id=3D$1", array($p_id));
 		return $a_value;
 	}
=20
 }
+
 /**
  * @brief display title level 1
  */
@@ -101,17 +210,16 @@
 		echo h1($this->obj->p_libelle, "");
 	}
=20
-
 	function input()
 	{
 		echo h1($this->obj->p_libelle, ' class=3D"title"');
 	}
=20
 }
+
 /**
  * @brief display title level 2
  */
-
 class formulaire_title2 extends Formulaire_Row
 {
=20
@@ -120,17 +228,16 @@
 		echo h2($this->obj->p_libelle, 'class=3D"title"');
 	}
=20
-
 	function input()
 	{
 		echo h2($this->obj->p_libelle, 'class=3D"title"');
 	}
=20
 }
+
 /**
  * @brief display title level 3
  */
-
 class formulaire_title3 extends Formulaire_Row
 {
=20
@@ -139,18 +246,17 @@
 		echo "<h3>" . $this->obj->p_libelle . "</h3>";
 	}
=20
-
 	function input()
 	{
 		echo "<h3 class=3D\"title\">" . $this->obj->p_libelle . "</h3>";
 	}
=20
 }
+
 /**
  * @brief display the formula : depending of the type of formula, a fact=
ory is used and an object RAPAV_Formula, RAPAV_Account_TVA
  * or RAPAV_compute will be used for the display of the details
  */
-
 class Formulaire_Formula extends Formulaire_Row
 {
=20
@@ -165,6 +271,7 @@
 	{
 		echo $this->obj->p_libelle;
 	}
+
 	/**
 	 * @brief return an object following the key type_detail of the array p=
assed in parameter
 	 *
@@ -173,7 +280,7 @@
 	 */
 	function make_object($p_index)
 	{
-		$elt=3D$this->parametre[$p_index]['type_detail'];
+		$elt =3D $this->parametre[$p_index]['type_detail'];
 		switch ($elt)
 		{
 			case '1':
@@ -193,6 +300,7 @@
 				break;
 		}
 	}
+
 	/**
 	 * @brief input value
 	 */
@@ -207,30 +315,27 @@
 		echo '<table id=3D"table_' . $this->id . '">';
 		for ($i =3D 0; $i < $max; $i++)
 		{
-			$formula=3D$this->make_object($i);
+			$formula =3D $this->make_object($i);
=20
-			echo '<tr id=3D"tr_'.$formula->fp_id.'">';
+			echo '<tr id=3D"tr_' . $formula->fp_id . '">';
 			echo '<td>';
 			echo $formula->display_row();
 			echo '</td>';
-			echo "<td id=3D\"del_".$formula->fp_id."\">";
-			echo HtmlInput::anchor("Effacer","",sprintf("onclick=3D\"delete_param=
_detail('%s','%s','%s','%s')\""
-					, $_REQUEST['plugin_code'], $_REQUEST['ac'], $_REQUEST['gDossier'],=
 $formula->fp_id));
+			echo "<td id=3D\"del_" . $formula->fp_id . "\">";
+			echo HtmlInput::anchor("Effacer", "", sprintf("onclick=3D\"delete_par=
am_detail('%s','%s','%s','%s')\""
+							, $_REQUEST['plugin_code'], $_REQUEST['ac'], $_REQUEST['gDossier'=
], $formula->fp_id));
 			echo '</td>';
 			echo '</tr>';
 		}
-		if ($max=3D=3D0) echo '<tr></tr>';
+		if ($max =3D=3D 0)
+			echo '<tr></tr>';
 		echo "</table>";
 		echo '</p>';
 		echo HtmlInput::button_anchor(
-				"Ajout d'une ligne", "javascript:void(0)", "add_row" . $this->id, sp=
rintf("onclick=3D\"add_param_detail('%s','%s','%s','%s');\"",
-						$_REQUEST['plugin_code'], $_REQUEST['ac'], $_REQUEST['gDossier'], =
$this->id)
+				"Ajout d'une ligne", "javascript:void(0)", "add_row" . $this->id, sp=
rintf("onclick=3D\"add_param_detail('%s','%s','%s','%s');\"", $_REQUEST['=
plugin_code'], $_REQUEST['ac'], $_REQUEST['gDossier'], $this->id)
 		);
 	}
=20
 }
=20
-
-
-
 ?>

Modified: trunk/rapport_avance/include/formulaire.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/rapport_avance/include/formulaire.inc.php	2012-12-14 20:49:32 U=
TC (rev 447)
+++ trunk/rapport_avance/include/formulaire.inc.php	2012-12-14 23:25:17 U=
TC (rev 448)
@@ -27,6 +27,7 @@
  *
  */
 require_once 'class_rapav_formulaire.php';
+require_once 'class_formulaire_param.php';
 if ( isset($_POST['form_def_sub']))
 {
 	if (isset($_POST['delete']))
@@ -46,6 +47,15 @@
 	$form->f_description=3Dtrim($_POST['description']);
 	$form->insert();
 }
+if ( isset ($_POST['restore_form'])) {
+	// Sauver fichier
+	if ( $_FILES['form']['name']=3D=3D""||$_FILES["form"]["error"] !=3D 0)
+	{
+		echo "Fichier non charg=C3=A9";
+	}
+	Formulaire_Param::from_csv($_FILES['form']['tmp_name']);
+
+}
 RAPAV_formulaire::listing();
=20
 ?>

Modified: trunk/rapport_avance/include/template/formulaire_listing.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/rapport_avance/include/template/formulaire_listing.php	2012-12-=
14 20:49:32 UTC (rev 447)
+++ trunk/rapport_avance/include/template/formulaire_listing.php	2012-12-=
14 23:25:17 UTC (rev 448)
@@ -34,6 +34,7 @@
 		<th>Description</th>
 		<th></th>
 		<th></th>
+		<th></th>
 	</tr>
 <?
 	for ($i=3D0;$i<count($alist);$i++):
@@ -51,6 +52,9 @@
 		<td>
 			<?=3DHtmlInput::anchor('Param=C3=A8tre', "",sprintf('onclick=3D"rapav=
_form_param(\'%s\',\'%s\',\'%s\',\'%s\')"',$_REQUEST['plugin_code'],$_REQ=
UEST['ac'],dossier::id(),$alist[$i]['f_id']))?>
 		</td>
+		<td>
+			<?=3DHtmlInput::anchor('Export d=C3=A9finition', sprintf("extension.r=
aw.php?plugin_code=3D%s&ac=3D%s&gDossier=3D%s&d_id=3D%s&act=3Drapav_form_=
export",$_REQUEST['plugin_code'],$_REQUEST['ac'],dossier::id(),$alist[$i]=
['f_id']))?>
+		</td>
 	</tr>
=20
 <?	endfor; ?>
@@ -59,6 +63,7 @@
 	echo HtmlInput::button("add_form_bt","Ajout d'un formulaire",'onclick=3D=
"$(\'add_form_div\').show();$(\'add_form_bt\').hide()"');
 echo '<div id=3D"add_form_div" style=3D"display:none">';
 echo '<form method=3D"POST">';
+echo '<h2> Nouveau formulaire</h2>';
 $name=3Dnew IText("titre");
 $description=3Dnew IText("description");
 echo '<table>';
@@ -67,6 +72,12 @@
 echo '</table>';
 echo HtmlInput::submit ("add_form","Sauver");
 echo '</form>';
+echo '<form enctype=3D"multipart/form-data"  method=3D"POST"> ';
+echo '<h2> Depuis un fichier</h2>';
+$file=3Dnew IFile('form');
+echo $file->input();
+echo HtmlInput::submit ("restore_form","Sauver");
+echo '</form>';
 ?>
 </div>
 </div>

Modified: trunk/rapport_avance/rapav_javascript.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/rapport_avance/rapav_javascript.js	2012-12-14 20:49:32 UTC (rev=
 447)
+++ trunk/rapport_avance/rapav_javascript.js	2012-12-14 23:25:17 UTC (rev=
 448)
@@ -356,4 +356,23 @@
 	{
 		alert(e.message);
 	}
+}
+function rapav_form_export(plugin_code,ac,dossier,d_id)
+{
+	try {
+		var querystring=3D'plugin_code=3D'+plugin_code+'&ac=3D'+ac+'&gDossier=3D=
'+dossier+'&act=3Drapav_form_export'+"&d_id=3D"+d_id;
+		var action=3Dnew Ajax.Request(
+			"ajax.php",
+			{
+				method:'get',
+				parameters:querystring,
+				onFailure:error_get_predef,
+				onSuccess:null
+			}
+			);
+
+	}catch (e)
+	{
+		alert(e.message);
+	}
 }
\ No newline at end of file

Modified: trunk/rapport_avance/raw.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/rapport_avance/raw.php	2012-12-14 20:49:32 UTC (rev 447)
+++ trunk/rapport_avance/raw.php	2012-12-14 23:25:17 UTC (rev 448)
@@ -23,7 +23,9 @@
 /*!\file
  * \brief raw file for PDF ewa
  */
-
+require_once 'include/class_formulaire_param.php';
 extract ($_REQUEST);
-
+if ( $act=3D=3D'rapav_form_export') {
+	Formulaire_Param::to_csv($d_id);
+}
 ?>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Dec 26 13:53:50 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Tnw6w-0007VB-H9
	for mharc-phpcompta-dev@gnu.org; Wed, 26 Dec 2012 13:53:50 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 26 Dec 2012 19:44:42 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.975582.1356548030.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r449 - in trunk/rapport_avance: . include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 26 Dec 2012 18:53:49 -0000

Author: danydb
Date: 2012-12-26 19:44:42 +0100 (Wed, 26 Dec 2012)
New Revision: 449

Modified:
   trunk/rapport_avance/ajax_declaration_display.php
   trunk/rapport_avance/include/class_rapav_declaration.php
   trunk/rapport_avance/include/declaration.inc.php
   trunk/rapport_avance/raw.php
Log:
Ajout export CSV des d?\195?\169clarations sauv?\195?\169es

Modified: trunk/rapport_avance/ajax_declaration_display.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/rapport_avance/ajax_declaration_display.php	2012-12-14 23:25:17=
 UTC (rev 448)
+++ trunk/rapport_avance/ajax_declaration_display.php	2012-12-26 18:44:42=
 UTC (rev 449)
@@ -32,5 +32,8 @@
 $decl->d_id =3D $_GET['d_id'];
 $decl->load();
 $decl->display();
+$ref=3DHtmlInput::array_to_string(array('gDossier','plugin_code','d_id')=
,$_GET,'extension.raw.php?');
+$ref.=3D"&amp;act=3Dexport_decla_csv";
+echo HtmlInput::button_anchor("Export CSV",$ref,'export_id');
 echo HtmlInput::button_action("Retour","$('declaration_list_div').show()=
; $('declaration_display_div').hide();");
 ?>

Modified: trunk/rapport_avance/include/class_rapav_declaration.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/rapport_avance/include/class_rapav_declaration.php	2012-12-14 2=
3:25:17 UTC (rev 448)
+++ trunk/rapport_avance/include/class_rapav_declaration.php	2012-12-26 1=
8:44:42 UTC (rev 449)
@@ -42,7 +42,38 @@
 		$this->form =3D new RAPAV_Formulaire();
 		parent::__construct();
 	}
+	static function to_csv($p_id)
+	{
+		global $cn;
+		$a_row=3D$cn->get_array('select dr_code,dr_libelle,dr_amount,dr_info f=
rom rapport_advanced.declaration_row
+			where d_id=3D$1 order by dr_order',array($p_id));
=20
+		$a_title=3D$cn->get_array("select d_title
+			,to_char(d_start,'DD.MM.YYYY') as start
+			,to_char(d_end,'DD.MM.YYYY') as end
+			from
+			rapport_advanced.declaration
+			where
+			d_id=3D$1",array($p_id));
+		$title=3D$a_title[0]['d_title']."-".$a_title[0]['start']."-".$a_title[=
0]['end'];
+		$title =3D mb_strtolower($title, 'UTF-8');
+		$title =3D str_replace(array('/', '*', '<', '>', '*', '.', '+', ':', '=
?', '!', " ", ";"), "_", $title);
+		$out =3D fopen("php://output", "w");
+
+		header('Pragma: public');
+		header('Content-type: application/csv');
+		header('Content-Disposition: attachment;filename=3D"' . $title . '.csv=
"', FALSE);
+		fputcsv($out, $a_title[0], ";");
+
+		for ($i =3D 0; $i < count($a_row); $i++)
+		{
+			printf ('"%s";"%s";%s;"%s"'."\r\n",
+					$a_row[$i]['dr_code'],
+					$a_row[$i]['dr_libelle'],
+					nb($a_row[$i]['dr_amount']),
+					$a_row[$i]['dr_info']);
+		}
+	}
 	function compute($p_id, $p_start, $p_end)
 	{
 		global $cn;

Modified: trunk/rapport_avance/include/declaration.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/rapport_avance/include/declaration.inc.php	2012-12-14 23:25:17 =
UTC (rev 448)
+++ trunk/rapport_avance/include/declaration.inc.php	2012-12-26 18:44:42 =
UTC (rev 449)
@@ -36,11 +36,15 @@
 	$decl =3D new Rapav_Declaration();
 	$decl->d_id =3D $_POST['d_id'];
 	$decl->load();
-	$decl->to_keep=3D'Y';
-	$decl->f_id=3D$_POST['p_form'];
+	$decl->to_keep =3D 'Y';
+	$decl->f_id =3D $_POST['p_form'];
 	$decl->save();
 	$decl->display();
 	echo '<h2 class=3D"notice"> Sauv=C3=A9</h2>';
+
+	$ref =3D HtmlInput::array_to_string(array('gDossier', 'plugin_code', 'd=
_id'), $_REQUEST, 'extension.raw.php?');
+	$ref.=3D"&amp;act=3Dexport_decla_csv";
+	echo HtmlInput::button_anchor("Export CSV", $ref, 'export_id');
 	exit();
 }
 /*
@@ -57,7 +61,7 @@
 	{
 		$decl->compute($_GET['p_form'], $_GET['p_start'], $_GET['p_end']);
 		echo '<form class=3D"print" method=3D"POST">';
-		echo HtmlInput::hidden('p_form',$_GET['p_form']);
+		echo HtmlInput::hidden('p_form', $_GET['p_form']);
 		$decl->display();
 		echo HtmlInput::submit('save', 'Sauver');
 		echo '</form>';
@@ -101,7 +105,7 @@
 </form>
 <script charset=3D"UTF8" lang=3D"javascript">
 	function validate() {
-		if ( check_date_id('<?=3D$date_start->id?>') =3D=3D false ) {alert('Da=
te de d=C3=A9but incorrecte');return false;}
-		if ( check_date_id('<?=3D$date_end->id?>') =3D=3D false ) {alert('Date=
 de fin incorrecte');return false;}
+		if ( check_date_id('<?=3D $date_start->id?>') =3D=3D false ) {alert('D=
ate de d=C3=A9but incorrecte');return false;}
+		if ( check_date_id('<?=3D $date_end->id?>') =3D=3D false ) {alert('Dat=
e de fin incorrecte');return false;}
 	}
 </script>
\ No newline at end of file

Modified: trunk/rapport_avance/raw.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/rapport_avance/raw.php	2012-12-14 23:25:17 UTC (rev 448)
+++ trunk/rapport_avance/raw.php	2012-12-26 18:44:42 UTC (rev 449)
@@ -24,8 +24,14 @@
  * \brief raw file for PDF ewa
  */
 require_once 'include/class_formulaire_param.php';
+require_once 'include/class_rapav_declaration.php';
 extract ($_REQUEST);
 if ( $act=3D=3D'rapav_form_export') {
 	Formulaire_Param::to_csv($d_id);
+	exit();
 }
+if ($act=3D=3D'export_decla_csv') {
+	 Rapav_Declaration::to_csv($d_id);
+	exit();
+}
 ?>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Dec 26 14:04:29 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TnwHF-0000Ze-6k
	for mharc-phpcompta-dev@gnu.org; Wed, 26 Dec 2012 14:04:29 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 26 Dec 2012 19:55:17 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.975642.1356548668.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r450 - trunk/rapport_avance/include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 26 Dec 2012 19:04:28 -0000

Author: danydb
Date: 2012-12-26 19:55:17 +0100 (Wed, 26 Dec 2012)
New Revision: 450

Modified:
   trunk/rapport_avance/include/template/declaration_display.php
Log:
Mise en ?\195?\169vidence de la date de d?\195?\169claration=20

Modified: trunk/rapport_avance/include/template/declaration_display.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/rapport_avance/include/template/declaration_display.php	2012-12=
-26 18:44:42 UTC (rev 449)
+++ trunk/rapport_avance/include/template/declaration_display.php	2012-12=
-26 18:55:17 UTC (rev 450)
@@ -28,7 +28,7 @@
  */
 ?>
 <h1><?=3D$this->d_title?></h1>
-Du <?=3D$this->d_start?> au <?=3D$this->d_end?>
+<h2> Du <?=3D$this->d_start?> au <?=3D$this->d_end?></h2>
 <?
 	if ( empty($array) ) { echo 'Aucune donn=C3=A9e'; exit();}
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Dec 26 15:08:12 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TnxGu-0001B8-PA
	for mharc-phpcompta-dev@gnu.org; Wed, 26 Dec 2012 15:08:12 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 26 Dec 2012 20:59:08 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.975833.1356552492.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r451 - tag
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 26 Dec 2012 20:08:11 -0000

Author: danydb
Date: 2012-12-26 20:59:08 +0100 (Wed, 26 Dec 2012)
New Revision: 451

Added:
   tag/rel652/
Log:
New version of PLUGIN : rapport plugin advanced



Copied: tag/rel652 (from rev 450, trunk)



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Dec 26 15:10:33 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TnxJB-0001Ne-5u
	for mharc-phpcompta-dev@gnu.org; Wed, 26 Dec 2012 15:10:33 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 26 Dec 2012 21:01:29 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.975834.1356552632.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r452 - trunk
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 26 Dec 2012 20:10:31 -0000

Author: danydb
Date: 2012-12-26 21:01:28 +0100 (Wed, 26 Dec 2012)
New Revision: 452

Modified:
   trunk/
Log:
Removed merge tracking for "svnmerge" for=20
file:///home/developper/svn_extension/tag/rel651



Property changes on: trunk
___________________________________________________________________
Name: svnmerge-integrated
   - /tag/rel651:1-443



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Dec 26 15:11:21 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TnxJx-0001Pb-Bx
	for mharc-phpcompta-dev@gnu.org; Wed, 26 Dec 2012 15:11:21 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 26 Dec 2012 21:02:17 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.975835.1356552680.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r453 - trunk
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 26 Dec 2012 20:11:19 -0000

Author: danydb
Date: 2012-12-26 21:02:17 +0100 (Wed, 26 Dec 2012)
New Revision: 453

Modified:
   trunk/
Log:
Initialized merge tracking via "svnmerge" with revisions "1-452" from=20
file:///home/developper/svn_extension/tag/rel652



Property changes on: trunk
___________________________________________________________________
Name: svnmerge-integrated
   + /tag/rel652:1-452



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Dec 26 19:19:19 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1To1Bv-000336-TT
	for mharc-phpcompta-dev@gnu.org; Wed, 26 Dec 2012 19:19:19 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 27 Dec 2012 01:10:14 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.976128.1356567558.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r454 - in tag/rel652/rapport_avance: . include sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 27 Dec 2012 00:19:18 -0000

Author: danydb
Date: 2012-12-27 01:10:12 +0100 (Thu, 27 Dec 2012)
New Revision: 454

Added:
   tag/rel652/rapport_avance/sql/upgrade2.sql
Modified:
   tag/rel652/rapport_avance/include/class_rapav_install.php
   tag/rel652/rapport_avance/index.php
   tag/rel652/rapport_avance/rapav_constant.php
Log:
add upgrade script

Modified: tag/rel652/rapport_avance/include/class_rapav_install.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/include/class_rapav_install.php	2012-12-26 =
20:02:17 UTC (rev 453)
+++ tag/rel652/rapport_avance/include/class_rapav_install.php	2012-12-27 =
00:10:12 UTC (rev 454)
@@ -37,6 +37,16 @@
 		$file=3Ddirname(__FILE__);
 		$this->db->execute_script($file.'/../sql/install.sql');
 	}
+		function upgrade($p_version)
+	{
+		global $cn;
+		$cur_version=3D$cn->get_value('select max(version_id) from rapport_adv=
anced.version');
+		$cur_version++;
+		$file=3Ddirname(__FILE__);
+		for ($e=3D$cur_version;$e<=3D$p_version;$e++) {
+			$this->db->execute_script($file.'/../sql/upgrade'.$e.'.sql');
+		}
+	}
 }
=20
 ?>

Modified: tag/rel652/rapport_avance/index.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/index.php	2012-12-26 20:02:17 UTC (rev 453)
+++ tag/rel652/rapport_avance/index.php	2012-12-27 00:10:12 UTC (rev 454)
@@ -38,6 +38,12 @@
 	$iplugn->install();
 	echo_warning(_("L'extension est install=C3=A9e, pourriez-vous en v=C3=A9=
rifier le param=C3=A8trage ?"));
 }
+if ( $cn->get_value('select max(version_id) from rapport_advanced.versio=
n') < $rapav_version )
+{
+	require_once('include/class_rapav_install.php');
+	$iplugn =3D new Rapav_Install($cn);
+	$iplugn->upgrade($rapav_version);
+}
 /*
  * load javascript
  */

Modified: tag/rel652/rapport_avance/rapav_constant.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/rapav_constant.php	2012-12-26 20:02:17 UTC =
(rev 453)
+++ tag/rel652/rapport_avance/rapav_constant.php	2012-12-27 00:10:12 UTC =
(rev 454)
@@ -9,6 +9,7 @@
=20
 require_once ('class_database.php');
=20
-global $cn;
+global $cn,$rapav_version;
 $cn=3Dnew Database (dossier::id());
+$rapav_version=3D2;
 ?>
\ No newline at end of file

Added: tag/rel652/rapport_avance/sql/upgrade2.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/sql/upgrade2.sql	                        (r=
ev 0)
+++ tag/rel652/rapport_avance/sql/upgrade2.sql	2012-12-27 00:10:12 UTC (r=
ev 454)
@@ -0,0 +1,62 @@
+begin;
+insert into rapport_advanced.type_row_detail values (4,'Poste comptable'=
);
+insert into rapport_advanced.type_row_detail  (tr_id,tr_description) val=
ues (5,'Op=C3=A9ration r=C3=A9concil=C3=A9e');
+insert into rapport_advanced.periode_type (t_id,t_description) values (6=
,'Depuis d=C3=A9but exercice courant N');
+
+ALTER TABLE rapport_advanced.formulaire_param_detail ADD COLUMN with_tmp=
_val account_type;
+ALTER TABLE rapport_advanced.formulaire_param_detail ADD COLUMN type_sum=
_account bigint;
+ALTER TABLE rapport_advanced.formulaire_param_detail ADD COLUMN operatio=
n_pcm_val account_type;
+
+
+CREATE TABLE rapport_advanced.total_type_account
+(
+  tt_id serial NOT NULL,
+  tt_label text,
+  CONSTRAINT total_type_account_pkey PRIMARY KEY (tt_id )
+);
+INSERT INTO rapport_advanced.total_type_account (tt_id, tt_label) VALUES=
 (1, 'Solde (d=C3=A9bit-cr=C3=A9dit)');
+INSERT INTO rapport_advanced.total_type_account (tt_id, tt_label) VALUES=
 (2, 'Solde (cr=C3=A9dit-d=C3=A9bit)');
+INSERT INTO rapport_advanced.total_type_account (tt_id, tt_label) VALUES=
 (3, 'D=C3=A9bit');
+INSERT INTO rapport_advanced.total_type_account (tt_id, tt_label) VALUES=
 (4, 'Cr=C3=A9dit');
+
+
+
+CREATE TABLE rapport_advanced.restore_formulaire_param
+(
+  p_id integer NOT NULL,
+  p_code text,
+  p_libelle text,
+  p_type integer,
+  p_order integer NOT NULL,
+  f_id integer,
+  p_info text, -- si non vide affiche infobulle
+  t_id integer,
+  CONSTRAINT restore_formulaire_param_pkey PRIMARY KEY (p_id )
+
+);
+CREATE TABLE rapport_advanced.restore_formulaire_param_detail
+(
+  fp_id integer NOT NULL,
+  p_id integer,
+  tmp_val account_type,
+  tva_id integer,
+  fp_formula text,
+  fp_signed integer,
+  jrn_def_type character(3),
+  tt_id integer,
+  type_detail integer,
+  with_tmp_val account_type,
+  type_sum_account bigint,
+  operation_pcm_val account_type,
+  CONSTRAINT restore_formulaire_param_detail_pkey PRIMARY KEY (fp_id ),
+  CONSTRAINT formulaire_param_detail_p_id_fkey FOREIGN KEY (p_id)
+      REFERENCES rapport_advanced.formulaire_param (p_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE
+);
+insert into rapport_advanced.version(version_id,version_note) values (2,=
'Ajout formules, export CSV des d=C3=A9clarations et des formulaires');
+
+ALTER TABLE rapport_advanced.formulaire_param_detail
+  ADD CONSTRAINT formulaire_param_detail_type_sum_account_fkey FOREIGN K=
EY (type_sum_account)
+      REFERENCES rapport_advanced.total_type_account (tt_id) MATCH SIMPL=
E
+      ON UPDATE SET NULL ON DELETE SET NULL;
+commit;
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Dec 26 19:36:43 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1To1Sl-0004Fk-I8
	for mharc-phpcompta-dev@gnu.org; Wed, 26 Dec 2012 19:36:43 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 27 Dec 2012 01:27:39 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.976151.1356568602.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r455 - tag/rel652/rapport_avance/doc
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 27 Dec 2012 00:36:41 -0000

Author: danydb
Date: 2012-12-27 01:27:39 +0100 (Thu, 27 Dec 2012)
New Revision: 455

Added:
   tag/rel652/rapport_avance/doc/rapav.odt
Log:
add documentation

Added: tag/rel652/rapport_avance/doc/rapav.odt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(Binary files differ)


Property changes on: tag/rel652/rapport_avance/doc/rapav.odt
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Dec 26 20:35:53 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1To2O1-0002SJ-CU
	for mharc-phpcompta-dev@gnu.org; Wed, 26 Dec 2012 20:35:53 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 27 Dec 2012 02:26:32 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.976188.1356572152.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r456 - tag/rel652/rapport_avance
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 27 Dec 2012 01:35:51 -0000

Author: danydb
Date: 2012-12-27 02:26:31 +0100 (Thu, 27 Dec 2012)
New Revision: 456

Removed:
   tag/rel652/rapport_avance/class_ext_list_assujetti.php
   tag/rel652/rapport_avance/class_ext_list_intra.php
   tag/rel652/rapport_avance/class_ext_tva.php
   tag/rel652/rapport_avance/class_ext_tvagen.php
   tag/rel652/rapport_avance/class_listing.php
   tag/rel652/rapport_avance/class_tva_amount.php
   tag/rel652/rapport_avance/class_tva_parameter.php
   tag/rel652/rapport_avance/decl_tva.inc.php
   tag/rel652/rapport_avance/form_decl.php
   tag/rel652/rapport_avance/form_decl_info.php
   tag/rel652/rapport_avance/form_parameter.php
   tag/rel652/rapport_avance/form_periode.php
   tag/rel652/rapport_avance/js_scripts.js
   tag/rel652/rapport_avance/list_assujetti.inc.php
   tag/rel652/rapport_avance/list_intra.inc.php
   tag/rel652/rapport_avance/list_tva.inc.php
   tag/rel652/rapport_avance/tva_constant.php
   tag/rel652/rapport_avance/tva_param.inc.php
Log:
remove obsolete files

Deleted: tag/rel652/rapport_avance/class_ext_list_assujetti.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/class_ext_list_assujetti.php	2012-12-27 00:=
27:39 UTC (rev 455)
+++ tag/rel652/rapport_avance/class_ext_list_assujetti.php	2012-12-27 01:=
26:31 UTC (rev 456)
@@ -1,327 +0,0 @@
-<?php
-  /*
-   *   This file is part of PhpCompta.
-   *
-   *   PhpCompta is free software; you can redistribute it and/or modify
-   *   it under the terms of the GNU General Public License as published=
 by
-   *   the Free Software Foundation; either version 2 of the License, or
-   *   (at your option) any later version.
-   *
-   *   PhpCompta is distributed in the hope that it will be useful,
-   *   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   *   GNU General Public License for more details.
-   *
-   *   You should have received a copy of the GNU General Public License
-   *   along with PhpCompta; if not, write to the Free Software
-   *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1=
307  USA
-   */
-  /* $Revision$ */
-
-  // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-
-  /*!\file
-   * \brief
-   */
-
-require_once('class_listing.php');
-require_once('class_fiche.php');
-require_once('class_tva_parameter.php');
-class Ext_List_Assujetti extends Listing {
-  protected $variable =3D array(
-			      "id"=3D>"a_id",
-			      "date_decl"=3D>"date_decl",
-			      "start_periode"=3D>"start_periode",
-			      "end_periode"=3D>"end_periode",
-			      "xml_file"=3D>"xml_file",
-			      "num_tva"=3D>"num_tva",
-			      "name"=3D>"tva_name",
-			      "adress"=3D>"adress",
-			      "country"=3D>"country",
-			      "flag_periode"=3D>"flag_periode",
-			      "exercice"=3D>"exercice",
-			      "periode_dec"=3D>"periode_dec"
-			      );
-  private $aChild=3Darray();
-  static function choose_periode($by_year=3Dfalse) {
-
-    // year
-    $year =3D new IText('year');
-    $year->size=3D4;
-    $str_year=3D$year->input();
-
-
-    $str_submit=3DHtmlInput::submit('decl',_('Afficher'));
-    $str_hidden=3DHtmlInput::extension().dossier::hidden();
-    if (isset($_REQUEST['sa']))
-      $str_hidden.=3DHtmlInput::hidden('sa',$_REQUEST['sa']);
-    $r=3D'<form class=3D"print" method=3D"get">';
-    $r.=3D"Ann=C3=A9e :".$str_year;
-    $r.=3D$str_submit;
-    $r.=3D$str_hidden;
-	$r.=3DHtmlInput::request_to_hidden(array('ac'));
-    $r.=3D'</form>';
-    return $r;
-  }
-
-  function from_array($p_array){
-    if ( isset($p_array['name_child'])) {
-      $name=3D$p_array['name_child'];
-      $qcode=3D$p_array['qcode'];
-      $code=3D$p_array['plugin_code'];
-      $tva_num=3D$p_array['tva_num_child'];
-      $amount=3D$p_array['amount'];
-      $amount_vat=3D$p_array['amount_vat'];
-
-      // retrieve missing and compute an array
-      for ($i=3D0;$i<count($name);$i++){
-	$child=3Dnew Ext_List_Assujetti_Child($this->db);
-	$child->set_parameter('amount',$amount[$i]);
-	$child->set_parameter('amount_vat',$amount_vat[$i]);
-	$child->set_parameter('qcode',$qcode[$i]);
-	$child->set_parameter('name_child',$name[$i]);
-	$child->set_parameter('tva_num',$tva_num[$i]);
-
-	$array[]=3D$child;
-      }//end for
-      $this->aChild=3D$array;
-    } else
-      $this->aChild=3Darray();
-
-    $this->start_periode=3D$p_array['start_periode'];
-    $this->end_periode=3D$p_array['end_periode'];
-    $this->flag_periode=3D$p_array['flag_periode'];
-    $this->tva_name=3D$p_array['name'];
-    $this->num_tva=3D$p_array['num_tva'];
-    $this->adress=3D$p_array['adress'];
-    $this->country=3D$p_array['country'];
-    $this->periode_dec=3D$p_array['periode_dec'];
-    $this->exercice=3D$p_array['exercice'];
-  }
-  function display() {
-    $r=3D '<form class=3D"print" id=3D"readonly">';
-	$r.=3DHtmlInput::request_to_hidden(array('ac'));
-    $r.=3D$this->display_info();
-    $r.=3D$this->display_declaration_amount(true);
-    $r.=3D'</form>';
-    $js_remove=3Dsprintf("onclick=3D\"if ( confirm('%s')){remove_form('%=
s',%d,%d,'lc');}\"",
-		       "Vous confirmez vouloir effacer ?",
-			$_REQUEST['plugin_code'],
-			dossier::id(),
-			$this->a_id);
-    $r.=3DHtmlInput::button('Effacer','Effacer',$js_remove);
-
-    $r.=3D create_script("$('readonly').disable();");
-    return $r;
-  }
-  function load() {
-    $sql=3D"select * from tva_belge.assujetti where a_id=3D$1";
-
-    $res=3D$this->db->get_array(
-			      $sql,
-			      array($this->a_id)
-			      );
-    if ( $this->db->count() =3D=3D 0 ) return 0;
-    foreach ($res[0] as $idx=3D>$value) { $this->$idx=3D$value; }
-    // load child
-    $sql=3D"select * from tva_belge.assujetti_chld where a_id=3D$1";
-    $res=3D$this->db->get_array(
-			      $sql,
-			      array($this->a_id)
-			      );
-    $nb=3D$this->db->count();
-    $array=3Darray();
-    // retrieve missing and compute an array
-    for ($i=3D0;$i<$nb;$i++){
-      $child=3Dnew Ext_List_Assujetti_Child($this->db);
-      foreach ($res[$i] as $idx=3D>$value){
-	$child->$idx=3D$value;
-      }
-      $array[]=3D$child;
-    }//end for
-    $this->aChild=3D$array;
-
-    return 1;
-  }
-  function verify() {
-    return 0;
-  }
-  function insert() {
-    $this->db->start();
-
-    /* insert into the first table */
-    $sql=3D<<<EOF
-      INSERT INTO tva_belge.assujetti(
-				      start_date, end_date,  periodicity, tva_name,
-				      num_tva, adress, country,  periode_dec,exercice)
-      VALUES (to_date($1,'DD.MM.YYYY'),to_date($2,'DD.MM.YYYY'),$3,$4,$5=
,$6,$7,$8,$9) returning a_id;
-EOF;
-    $this->a_id=3D$this->db->get_value($sql,
-				     array(
-					   $this->start_periode, /* 1 */
-					   $this->end_periode,
-					   $this->flag_periode, /* 3 */
-					   $this->tva_name,
-					   $this->num_tva, /* 5 */
-					   $this->adress,
-					   $this->country, /* 7 */
-					   $this->periode_dec,
-					   $this->exercice /* 9 */
-					   )
-				     );
-    /* insert into the child table */
-    for ($e=3D0;$e<count($this->aChild);$e++){
-      $this->aChild[$e]->set_parameter('depend',$this->a_id);
-      $this->aChild[$e]->insert();
-    }
-    $this->db->commit();
-
-  }
-  function update() {
-  }
-
-  function compute(){
-    /* retrieve accounting customer */
-    $code_customer=3Dnew Acc_Parm_Code($this->db);
-    $code_customer->p_code=3D'CUSTOMER';
-    $code_customer->load();
-    $a=3D$this->find_tva_code('ASSUJETTI');
-    if (trim($a)=3D=3D'') $a=3D-1;
-    $sql=3D<<<EOF
-      select sum(j_montant) as amount,j_qcode
-      from jrnx
-      where j_grpt in (select distinct j_grpt from quant_sold join jrnx =
using (j_id) where qs_vat_code in ($a) )
-      and j_poste::text like $1||'%'
-      and (j_date >=3D to_date($2,'DD.MM.YYYY') and j_date <=3D to_date(=
$3,'DD.MM.YYYY'))
-      group by j_qcode
-EOF;
-    // get all of them
-    $all=3D$this->db->get_array($sql,array($code_customer->p_value,
-					 $this->start_periode,
-					 $this->end_periode
-					 )
-			      );
-    $array=3Darray();
-
-    // retrieve missing and compute an array
-    for ($i=3D0;$i<count($all);$i++){
-      $child=3Dnew Ext_List_Assujetti_Child($this->db);
-
-
-      $child->set_parameter('qcode',$all[$i]['j_qcode']);
-      $fiche=3Dnew Fiche($this->db);
-      $fiche->get_by_qcode($all[$i]['j_qcode'],false);
-      $num_tva=3D$fiche->strAttribut(ATTR_DEF_NUMTVA);
-      $child->set_parameter('tva_num',$num_tva);
-      $sq=3D"select sum(qs_vat) from quant_sold
-where qs_client =3D $1 and j_id in (select distinct j_id from jrnx where=
  j_date >=3D to_date($2,'DD.MM.YYYY')
-                                  and j_date <=3D to_date($3,'DD.MM.YYYY=
')
-                                  )
-     and qs_vat_code in ($a)
-";
-      // if in the same operation, we use 2 different tva code, the amou=
nt is incorrect if one of them is
-      // excluded
-      $exclude=3D"select coalesce(sum(qs_price),0) from quant_sold
-where qs_client =3D $1 and j_id in (select distinct j_id from jrnx where=
  j_date >=3D to_date($2,'DD.MM.YYYY')
-                                  and j_date <=3D to_date($3,'DD.MM.YYYY=
')
-                                  )
-     and qs_vat_code not in ($a)
-";
-      $excl=3D$this->db->get_value($exclude,array($fiche->id,
-						$this->start_periode,
-						$this->end_periode));
-      $amount_vat=3D$this->db->get_value($sq,array($fiche->id,
-						 $this->start_periode,
-						 $this->end_periode));
-      $amount=3D$all[$i]['amount']-$amount_vat-$excl;
-      $child->set_parameter('amount',$amount);
-      $child->set_parameter('amount_vat',$amount_vat);
-
-      $child->set_parameter('name_child',$fiche->strAttribut(ATTR_DEF_NA=
ME));
-
-      $array[]=3D$child;
-    }//end for
-    $this->aChild=3D$array;
-  }
-  /**
-   *@todo finish it
-   */
-  function display_declaration_amount($readonly=3Dfalse) {
-    $res=3D'<fieldset><legend>Listing</legend>';
-    $res.=3D '<table id=3D"tb_dsp" class=3D"result" style=3D"width:80%;"=
>';
-    $clean=3Dnew IButton('rm_b');
-    $clean->label=3D'Efface ligne';
-    $clean->javascript=3D"deleteRow('tb_dsp',this);";
-
-    $r=3D'';
-    $r.=3Dth('QuickCode');
-    $r.=3Dth('Name');
-    $r.=3Dth('Code Pays et num=C3=A9ro de TVA');
-    $r.=3Dth('montant CA');
-    $r.=3Dth('montant TVA');
-    $r.=3Dth('');
-    $amount=3D0;$amount_vat=3D0;
-    $res.=3Dtr($r);
-    for ($i=3D0;$i<count($this->aChild);$i++) {
-      $a=3Dnew IText('qcode[]',$this->aChild[$i]->get_parameter('qcode')=
);
-      $b=3Dnew IText('name_child[]',$this->aChild[$i]->get_parameter('na=
me_child'));
-      $c=3Dnew IText('tva_num_child[]',$this->aChild[$i]->get_parameter(=
'tva_num'));
-      $e=3Dnew INum('amount[]',$this->aChild[$i]->get_parameter('amount'=
));
-      $d=3Dnew INum('amount_vat[]',$this->aChild[$i]->get_parameter('amo=
unt_vat'));
-
-      $amount+=3Dround($this->aChild[$i]->get_parameter('amount'),2);
-      $amount_vat+=3Dround($this->aChild[$i]->get_parameter('amount_vat'=
),2);
-      $r=3Dtd($a->input());
-      $r.=3Dtd($b->input());
-      $r.=3Dtd($c->input());
-      $r.=3Dtd($e->input());
-      $r.=3Dtd($d->input());
-     if (! $readonly) $r.=3Dtd($clean->input());
-      $res.=3Dtr($r);
-
-    }
-	if ( $readonly )
-	{
-		$r=3Dtd('');
-		$r.=3Dtd('');
-		$r.=3Dtd(hb('Total'));
-		$r.=3Dtd(hb(sprintf('%.02f',$amount)));
-		$r.=3Dtd(hb(sprintf('%.02f',$amount_vat)));
-		$res.=3Dtr($r);
-	}
-
-    $res.=3D'</table>';
-    $res.=3D'</fieldset>';
-    return $res;
-  }
-}
-
-class Ext_List_Assujetti_Child extends Ext_List_Assujetti {
-  protected $variable=3Darray(
-			    "id"=3D>"ac_id",
-			    "tva_num"=3D>"ac_tvanum",
-			    "amount"=3D>"ac_amount",
-			    "amount_vat"=3D>"ac_vat",
-			    "depend"=3D>"a_id",
-			    "qcode"=3D>"ac_qcode",
-			    "name_child"=3D>'ac_name'
-			    );
-  function insert() {
-
-    $sql=3D<<<EOF
-      INSERT INTO tva_belge.assujetti_chld(
-					   a_id, ac_tvanum, ac_amount, ac_vat,  ac_qcode,
-					   ac_name)
-      VALUES ($1, $2, $3, $4, $5, $6) returning ac_id;
-EOF;
-    $this->ic_id=3D$this->db->get_value($sql,array(
-						 $this->a_id,
-						 $this->ac_tvanum,
-						 $this->ac_amount,
-						 $this->ac_vat,
-						 $this->ac_qcode,
-						 $this->ac_name
-						 ));
-  }
-
-}

Deleted: tag/rel652/rapport_avance/class_ext_list_intra.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/class_ext_list_intra.php	2012-12-27 00:27:3=
9 UTC (rev 455)
+++ tag/rel652/rapport_avance/class_ext_list_intra.php	2012-12-27 01:26:3=
1 UTC (rev 456)
@@ -1,309 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published b=
y
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-130=
7  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-
-/*!\file
- * \brief
- */
-
-require_once('class_listing.php');
-require_once('class_fiche.php');
-require_once('class_tva_parameter.php');
-class Ext_List_Intra extends Listing {
-  protected $variable =3D array(
-			      "id"=3D>"i_id",
-			      "date"=3D>"i_date",
-			      "date_decl"=3D>"date_decl",
-			      "start_periode"=3D>"start_periode",
-			      "end_periode"=3D>"end_periode",
-			      "xml_file"=3D>"xml_file",
-			      "num_tva"=3D>"num_tva",
-			      "name"=3D>"tva_name",
-			      "adress"=3D>"adress",
-			      "country"=3D>"country",
-			      "flag_periode"=3D>"flag_periode",
-			      "exercice"=3D>"exercice",
-			      "periode_dec"=3D>"periode_dec"
-			      );
-  private $aChild=3Darray();
-
-  function from_array($p_array){
-    if( isset($p_array['name_child'])) {
-      $name=3D$p_array['name_child'];
-     $qcode=3D$p_array['qcode'];
-     $code=3D$p_array['tvacode'];
-     $tva_num=3D$p_array['tva_num_child'];
-     $amount=3D$p_array['amount'];
-     $periode=3D$p_array['periode'];
-     $array=3Darray();
-    // retrieve missing and compute an array
-    for ($i=3D0;$i<count($name);$i++){
-      $child=3Dnew Ext_List_Intra_Child($this->db);
-      $child->set_parameter('amount',$amount[$i]);
-      $child->set_parameter('periode',$periode[$i]);
-      $child->set_parameter('qcode',$qcode[$i]);
-      $child->set_parameter('code',$code[$i]);
-      $child->set_parameter('name_child',$name[$i]);
-      $child->set_parameter('tva_num',$tva_num[$i]);
-
-      $array[]=3D$child;
-    }//end for
-    $this->aChild=3D$array;
-    } else
-      $this->aChild=3Darray();
-
-    $this->start_periode=3D$p_array['start_periode'];
-    $this->end_periode=3D$p_array['end_periode'];
-    $this->flag_periode=3D$p_array['flag_periode'];
-    $this->tva_name=3D$p_array['name'];
-    $this->num_tva=3D$p_array['num_tva'];
-    $this->adress=3D$p_array['adress'];
-    $this->country=3D$p_array['country'];
-    $this->periode_dec=3D$p_array['periode_dec'];
-    $this->exercice=3D$p_array['exercice'];
-
-  }
-  function display() {
-     $r=3D '<form class=3D"print" id=3D"readonly">';
-     $r.=3D$this->display_info();
-	 $r.=3DHtmlInput::request_to_hidden(array('ac'));
-     $r.=3D$this->display_declaration_amount();
-     $r.=3D'</form>';
-     $js_remove=3Dsprintf("onclick=3D\"if ( confirm('%s')){remove_form('=
%s',%d,%d,'li');}\"",
-		       "Vous confirmez vouloir effacer ?",
-			$_REQUEST['plugin_code'],
-			dossier::id(),
-			$this->i_id);
-
-     $r.=3DHtmlInput::button('Effacer','Effacer',$js_remove);
-     $r.=3D create_script("$('readonly').disable();");
-     return $r;
-  }
-  function load() {
-    $sql=3D"select * from tva_belge.intracomm where i_id=3D$1";
-
-   $res=3D$this->db->get_array(
-			    $sql,
-			    array($this->i_id)
-			    );
-   if ( $this->db->count() =3D=3D 0 ) return 0;
-   foreach ($res[0] as $idx=3D>$value) { $this->$idx=3D$value; }
-   // load child
-   $sql=3D"select * from tva_belge.intracomm_chld where i_id=3D$1";
-   $res=3D$this->db->get_array(
-			    $sql,
-			    array($this->i_id)
-			    );
-   $nb=3D$this->db->count();
-   $array=3Darray();
-   // retrieve missing and compute an array
-   for ($i=3D0;$i<$nb;$i++){
-     $child=3Dnew Ext_List_Intra_Child($this->db);
-     foreach ($res[$i] as $idx=3D>$value){
-       $child->$idx=3D$value;
-     }
-     $array[]=3D$child;
-   }//end for
-   $this->aChild=3D$array;
-
-   return 1;
-  }
-  function verify() {
-    return 0;
-  }
-  function insert() {
-    $this->db->start();
-
-    /* insert into the first table */
-    $sql=3D<<<EOF
-INSERT INTO tva_belge.intracomm(
-            start_date, end_date,  periodicity, tva_name,
-            num_tva, adress, country,  periode_dec,exercice)
-      VALUES (to_date($1,'DD.MM.YYYY'),to_date($2,'DD.MM.YYYY'),$3,$4,$5=
,$6,$7,$8,$9) returning i_id;
-EOF;
-$this->i_id=3D$this->db->get_value($sql,
-		     array(
-			   $this->start_periode,
-			   $this->end_periode,
-			   $this->flag_periode,
-			   $this->tva_name,
-			   $this->num_tva,
-			   $this->adress,
-			   $this->country,
-			   $this->periode_dec,
-			   $this->exercice
-			   )
-		     );
-/* insert into the child table */
-for ($e=3D0;$e<count($this->aChild);$e++){
-  $this->aChild[$e]->set_parameter('depend',$this->i_id);
-  $this->aChild[$e]->insert();
-}
-  $this->db->commit();
-
-  }
-  function update() {
-  }
-
-  function compute(){
-    /* retrieve accounting customer */
-    $code_customer=3Dnew Acc_Parm_Code($this->db);
-    $code_customer->p_code=3D'CUSTOMER';
-    $code_customer->load();
-    $a=3D$this->find_tva_code('CLINTRA');
-
-    if (trim($a)=3D=3D'') $a=3D-1;
-    $sql=3D<<<EOF
-      select sum(j_montant) as amount,j_qcode
-      from jrnx
-      where j_grpt in (select distinct j_grpt from quant_sold join jrnx =
using (j_id) where qs_vat_code in ($a) )
-      and j_poste::text like $1||'%'
-      and (j_date >=3D to_date($2,'DD.MM.YYYY') and j_date <=3D to_date(=
$3,'DD.MM.YYYY'))
-      group by j_qcode
-EOF;
-    // get all of them
-    $all=3D$this->db->get_array($sql,array($code_customer->p_value,
-					$this->start_periode,
-					$this->end_periode
-					)
-			     );
-    $array=3Darray();
-
-    // retrieve missing and compute an array
-    for ($i=3D0;$i<count($all);$i++){
-		$child=3Dnew Ext_List_Intra_Child($this->db);
-		$child->set_parameter('amount',$all[$i]['amount']);
-		switch ($this->flag_periode) {
-		case 1:
-		// by month
-		$child->set_parameter('periode',sprintf('%02d%s',$this->periode_dec,$t=
his->exercice));
-		break;
-		case 2:
-		/* quaterly */
-		$child->set_parameter('periode',sprintf('3%d%s',$this->periode_dec,$th=
is->exercice));
-		break;
-		case 3:
-		/* yearly */
-		$child->set_parameter('periode',sprintf('00%s',$this->periode_dec,$thi=
s->exercice));
-		break;
-      } // end switch
-
-      $child->set_parameter('qcode',$all[$i]['j_qcode']);
-      $fiche=3Dnew Fiche($this->db);
-      $fiche->get_by_qcode($all[$i]['j_qcode'],false);
-      $num_tva=3D$fiche->strAttribut(ATTR_DEF_NUMTVA);
-
-      if ( trim($num_tva) =3D=3D=3D "") {continue;}
-      $child->set_parameter('tva_num',$num_tva);
-
-      $child->set_parameter('name_child',$fiche->strAttribut(ATTR_DEF_NA=
ME));
-      $child->set_parameter('code','L');
-
-      $array[]=3D$child;
-    }//end for
-    $this->aChild=3D$array;
-  }
-  /**
-   *@todo finish it
-   */
-  function display_declaration_amount($p_readonly=3Dfalse) {
-    $res=3D'<fieldset><legend>Listing</legend>';
-
-    $res.=3D '<table id=3D"tb_dsp" class=3D"result" style=3D"width:80%;"=
>';
-    $clean=3Dnew IButton();
-    $clean->label=3D'Efface ligne';
-    $clean->javascript=3D"deleteRow('tb_dsp',this);";
-
-    $r=3D'';
-    $r.=3Dth('QuickCode');
-    $r.=3Dth('Name');
-    $r.=3Dth('Code Pays et num=C3=A9ro de TVA');
-    $r.=3Dth('Code Pays et num=C3=A9ro de TVA');
-    $r.=3Dth('montant');
-    $r.=3Dth('periode');
-    $r.=3Dth('');
-    $amount=3D0;
-    $res.=3Dtr($r);
-    for ($i=3D0;$i<count($this->aChild);$i++) {
-      $a=3Dnew IText('qcode[]',$this->aChild[$i]->get_parameter('qcode')=
);
-      $b=3Dnew IText('name_child[]',$this->aChild[$i]->get_parameter('na=
me_child'));
-      $c=3Dnew IText('tva_num_child[]',$this->aChild[$i]->get_parameter(=
'tva_num'));
-      $d=3Dnew IText('tvacode[]',$this->aChild[$i]->get_parameter('code'=
));
-      $e=3Dnew INum('amount[]',$this->aChild[$i]->get_parameter('amount'=
));
-      $f=3Dnew IText('periode[]',$this->aChild[$i]->get_parameter('perio=
de'));
-
-      $amount+=3Dround($this->aChild[$i]->get_parameter('amount'),2);
-      $r=3Dtd($a->input());
-      $r.=3Dtd($b->input());
-      $r.=3Dtd($c->input());
-      $r.=3Dtd($d->input());
-      $r.=3Dtd($e->input());
-      $r.=3Dtd($f->input());
-      if (! $p_readonly) $r.=3Dtd($clean->input());
-      $res.=3Dtr($r);
-
-    }
-	if ( $p_readonly)
-	{
-		$r=3Dtd('');
-		$r.=3Dtd('');
-		$r.=3Dtd('');
-		$r.=3Dtd(hb('Total'));
-		$r.=3Dtd(hb(sprintf('%.02f',$amount)));
-		$r.=3Dtd('');
-		$r.=3Dtd('');
-		$res.=3Dtr($r);
-	}
-	$res.=3D'</table>';
-    $res.=3D'</fieldset>';
-    return $res;
-  }
-}
-
-class Ext_List_Intra_Child extends Ext_List_Intra {
-  protected $variable=3Darray(
-			    "id"=3D>"ic_id",
-			    "tva_num"=3D>"ic_tvanum",
-			    "amount"=3D>"ic_amount",
-			    "code"=3D>"ic_code",
-			    "periode"=3D>"ic_periode",
-			    "depend"=3D>"i_id",
-			    "qcode"=3D>"ic_qcode",
-			    "name_child"=3D>'ic_name'
-			    );
-  function insert() {
-$sql=3D<<<EOF
-INSERT INTO tva_belge.intracomm_chld(
-            i_id, ic_tvanum, ic_amount, ic_code, ic_periode, ic_qcode,
-            ic_name)
-  VALUES ($1, $2, $3, $4, $5, $6, $7) returning ic_id;
-EOF;
-$this->ic_id=3D$this->db->get_value($sql,array(
-					     $this->i_id,
-					     $this->ic_tvanum,
-					     $this->ic_amount,
-					     $this->ic_code,
-					     $this->ic_periode,
-					     $this->ic_qcode,
-					     $this->ic_name));
-  }
-
-}

Deleted: tag/rel652/rapport_avance/class_ext_tva.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/class_ext_tva.php	2012-12-27 00:27:39 UTC (=
rev 455)
+++ tag/rel652/rapport_avance/class_ext_tva.php	2012-12-27 01:26:31 UTC (=
rev 456)
@@ -1,546 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published b=
y
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-130=
7  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-
-/*!\file
- * \brief
- */
-require_once('class_ext_tvagen.php');
-require_once('class_tva_parameter.php');
-require_once('class_tva_amount.php');
-require_once('class_html_input.php');
-class Ext_Tva extends Ext_Tva_Gen
-{
-    protected   $variable=3Darray(
-			   "d00"=3D>"d00",
-			   "d01"=3D>"d01",
-			   "d02"=3D>"d02",
-			   "d03"=3D>"d03",
-			   "d44"=3D>"d44",
-			   "d45"=3D>"d45",
-			   "d46"=3D>"d46",
-			   "d47"=3D>"d47",
-			   "d48"=3D>"d48",
-			   "d49"=3D>"d49",
-			   "d81"=3D>"d81",
-			   "d82"=3D>"d82",
-			   "d83"=3D>"d83",
-			   "d84"=3D>"d84",
-			   "d85"=3D>"d85",
-			   "d86"=3D>"d86",
-			   "d54"=3D>"d54",
-			   "d55"=3D>"d55",
-			   "d56"=3D>"d56",
-			   "d57"=3D>"d57",
-			   "d63"=3D>"d63",
-			   "dxx"=3D>"dxx",
-			   "d59"=3D>"d59",
-			   "d61"=3D>"d61",
-			   "d62"=3D>"d62",
-			   "d64"=3D>"d64",
-			   "dyy"=3D>"dyy",
-			   "d71"=3D>"d71",
-			   "d72"=3D>"d72",
-			   "d82"=3D>"d82",
-			   "d87"=3D>"d87",
-			   "d88"=3D>"d88",
-			   "d91"=3D>"d91",
-			   "id"=3D>"da_id",
-			   "date_decl"=3D>"date_decl",
-			   "start_periode"=3D>"start_periode",
-			   "end_periode"=3D>"end_periode",
-			   "xml_file"=3D>"xml_file",
-			   "num_tva"=3D>"num_tva",
-			   "name"=3D>"tva_name",
-			   "adress"=3D>"adress",
-			   "country"=3D>"country",
-			   "flag_periode"=3D>"flag_periode",
-			   "exercice"=3D>"exercice",
-			   "periode_dec"=3D>"periode_dec"
-			   );
-
-  /**
-   *@brief retrieve * row thanks a condition
-   */
-   public function seek($cond,$p_array=3Dnull)
-   {
-   }
-   public function from_array($p_array) {
-     $val=3D$p_array['val'];
-     $code=3D$p_array['tvacode'];
-     for ($i=3D0;$i<count($val);$i++) {
-       $this->$code[$i]=3D$val[$i];
-     }
-     $this->start_periode=3D$p_array['start_periode'];
-     $this->end_periode=3D$p_array['end_periode'];
-     $this->flag_periode=3D$p_array['flag_periode'];
-     $this->tva_name=3D$p_array['name'];
-     $this->num_tva=3D$p_array['num_tva'];
-     $this->adress=3D$p_array['adress'];
-     $this->country=3D$p_array['country'];
-     $this->periode_dec=3D$p_array['periode_dec'];
-     $this->exercice=3D$p_array['exercice'];
-
-   }
-  public function insert() {
-
-    if ( $this->verify() !=3D 0 ) return;
-    $sql=3D"INSERT INTO tva_belge.declaration_amount(
-             d00, d01, d02, d03, d44, d45, d46, d47, d48, d49, d81,
-            d82, d83, d84, d85, d86, d87, d88, d54, d55, d56, d57, d61, =
d63,
-            dxx, d59, d62, d64, dyy, d71, d72, d91, start_date, end_date=
,
-             periodicity,tva_name,num_tva,adress,country,periode_dec,exe=
rcice)
-    VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12,
-            $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, =
$25,
-            $26, $27, $28, $29, $30, $31, $32, to_date($33,'DD.MM.YYYY')=
, to_date($34,'DD.MM.YYYY'), $35,$36,
-            $37,$38,$39,$40,$41)
-             returning da_id;";
-      $this->da_id=3D$this->db->get_value($sql,
-				     array($this->d00, /* 1 */
-					   $this->d01, /* 2 */
-					   $this->d02, /* 3 */
-					   $this->d03, /* 4 */
-					   $this->d44, /* 5 */
-					   $this->d45, /* 6 */
-					   $this->d46, /* 7 */
-					   $this->d47, /* 8 */
-					   $this->d48, /* 9 */
-					   $this->d49, /* 10 */
-					   $this->d81, /* 11 */
-					   $this->d82, /* 12 */
-					   $this->d83, /* 13 */
-					   $this->d84, /* 14 */
-					   $this->d85, /* 15 */
-					   $this->d86, /* 16 */
-					   $this->d87, /* 17 */
-					   $this->d88, /* 18 */
-					   $this->d54, /* 19 */
-					   $this->d55, /* 20 */
-					   $this->d56, /* 21 */
-					   $this->d57, /* 22 */
-					   $this->d61, /* 23 */
-					   $this->d63, /* 24 */
-					   $this->dxx, /* 25 */
-					   $this->d59, /* 26 */
-					   $this->d62, /* 27 */
-					   $this->d64, /* 28 */
-					   $this->dyy, /* 29 */
-					   $this->d71, /* 30 */
-					   $this->d72, /* 31 */
-					   $this->d91, /* 32 */
-					   $this->start_periode, /* 33 */
-					   $this->end_periode, /* 34 */
-					   $this->flag_periode, /* 35 */
-					   $this->tva_name,	/* 36 */
-					   $this->num_tva,	/* 37 */
-					   $this->adress,	/* 38 */
-					   $this->country,	/* 39 */
-					   $this->periode_dec,	/* 40 */
-					   $this->exercice,	/* 41 */
-
-					   ));
-  }
-
-  public function update() {
-    if ( $this->verify() !=3D 0 ) return;
-
-  }
-
-  public function load() {
-
-   $sql=3D"select * from tva_belge.declaration_amount where da_id=3D$1";
-
-   $res=3D$this->db->get_array(
-			    $sql,
-			    array($this->da_id)
-			    );
-   if ( $this->db->count() =3D=3D 0 ) return;
-   foreach ($res[0] as $idx=3D>$value) { $this->$idx=3D$value; }
-  }
-  public function delete() {
-/*    $sql=3D"delete from tva_rate where tva_id=3D$1";
-    $res=3D$this->cn->exec_sql($sql,array($this->tva_id));
-*/
-  }
-
-  function verify() {
-    /**
-     *@todo
-     * MY_NAME can not be empty
-     * MY_TVA contains BE and has 10 digits
-     * this->adress and $this->country can not be empty
-     */
-    return 0;
-  }
-
-  /**
-   *@brief compute the amount
-   */
-  function compute() {
-    // check that this exercice exist
-    $exist=3D$this->db->get_value('select count(*) from jrn join parm_pe=
riode on (p_id=3Djr_tech_per) where date_part(\'year\',p_start)=3D$1',arr=
ay($this->exercice));
-    if ( $exist=3D=3D0 ) { alert(_("Cette exercice comptable n'est pas d=
ans ce dossier")); throw  new Exception('INVALYEAR',1 ) ;}
-
-    // set default value 0 for all
-    $keys=3Darray_keys($this->variable);
-    for ($i =3D 0;$i < count($this->variable);$i++) {
-      $idx=3D$keys[$i];
-      $this->$idx=3D0;
-      if ( $idx=3D=3D'd91') break;
-    }
-
-    $ctva=3Dnew Tva_Parameter($this->db);
-    /**
-     *@todo on ne peut pas calculer de cette fa=C3=A7on =C3=A0 cause des=
 op=C3=A9rations qui comprennent plusieurs taux de tva diff.
-     *il faut aller chercher les montants dans les tables quant_*
-     */
-    $array=3Darray('00','01','02','03','44','45','46','47','48','49');
-    for ($e=3D0;$e<count($array);$e++) {
-      // Compute frame 2
-      $oTva=3Dnew Tva_amount($this->db,'out',$this->start_periode,$this-=
>end_periode);
-      $oTva->set_parameter('grid','GRIL'.$array[$e]);
-      $amount=3D$oTva->amount_operation();
-      $this->set_parameter('d'.$array[$e],$amount);
-    }
-
-    $array=3Darray('81','82','83','84','85','86','87','88');
-    for ($e=3D0;$e<count($array);$e++) {
-      // Compute frame 3
-      $oTva=3Dnew Tva_amount($this->db,'in',$this->start_periode,$this->=
end_periode);
-      $oTva->set_parameter('grid','GRIL'.$array[$e]);
-      $amount=3D$oTva->amount_operation();
-      $this->set_parameter('d'.$array[$e],$amount);
-
-    }
-    //Frame IV
-    $array=3Darray('54','55','56','57','61','63');
-    for ($e=3D0;$e<count($array);$e++) {
-      $oTva=3Dnew Tva_amount($this->db,'out',$this->start_periode,$this-=
>end_periode);
-      $oTva->set_parameter('grid','GRIL'.$array[$e]);
-      $amount=3D$oTva->amount_vat();
-      $this->set_parameter('d'.$array[$e],$amount);
-
-    }
-
-
-    $array=3Darray('59','62','64');
-    for ($e=3D0;$e<count($array);$e++) {
-      $oTva=3Dnew Tva_amount($this->db,'in',$this->start_periode,$this->=
end_periode);
-      $oTva->set_parameter('grid','GRIL'.$array[$e]);
-      $amount=3D$oTva->amount_vat();
-      $this->set_parameter('d'.$array[$e],$amount);
-
-    }
-    // for intracom, we compute a false VAT, have to paid it and deduce
-    $this->d55=3Dround($this->d86*0.21+$this->d88*0.21,2);
-    $this->d59+=3D$this->d55;
-    /**
-     *@todo
-     * GRIL56 - GRIL57 - GRIL61 - GRIL63
-     */
-
-    //GRILXX
-    $amount=3D$this->d54+$this->d55+$this->d56+$this->d57+$this->d61+$th=
is->d63;
-    $this->set_parameter('dxx',$amount);
-
-
-    // GRILYY
-    $this->dyy=3Dround($this->d59+$this->d62+$this->d64,2);
-
-
-    //Fram VI
-    if ( $this->dxx > $this->dyy ) $this->d71=3D$this->dxx-$this->dyy;
-    if ( $this->dxx < $this->dyy ) $this->d72=3D$this->dyy-$this->dxx;
-
-   }
-  /**
-   *@brief get into the table quant_purchase or quant_sold the amount
-   * of VAT
-   *@param
-   *@param
-   *@return
-   *@see
-   */
-
-   function display_declaration_amount() {
-     $itext_00=3Dnew INum('val[]',$this->get_parameter('d00')); $str_00=3D=
$itext_00->input().HtmlInput::hidden('tvacode[]','d00');
-     $itext_01=3Dnew INum('val[]',$this->get_parameter('d01')); $str_01=3D=
$itext_01->input().HtmlInput::hidden('tvacode[]','d01');
-     $itext_02=3Dnew INum('val[]',$this->get_parameter('d02')); $str_02=3D=
$itext_02->input().HtmlInput::hidden('tvacode[]','d02');
-     $itext_03=3Dnew INum('val[]',$this->get_parameter('d03')); $str_03=3D=
$itext_03->input().HtmlInput::hidden('tvacode[]','d03');
-     $itext_44=3Dnew INum('val[]',$this->get_parameter('d44')); $str_44=3D=
$itext_44->input().HtmlInput::hidden('tvacode[]','d44');
-     $itext_45=3Dnew INum('val[]',$this->get_parameter('d45')); $str_45=3D=
$itext_45->input().HtmlInput::hidden('tvacode[]','d45');
-     $itext_46=3Dnew INum('val[]',$this->get_parameter('d46')); $str_46=3D=
$itext_46->input().HtmlInput::hidden('tvacode[]','d46');
-     $itext_47=3Dnew INum('val[]',$this->get_parameter('d47')); $str_47=3D=
$itext_47->input().HtmlInput::hidden('tvacode[]','d47');
-     $itext_48=3Dnew INum('val[]',$this->get_parameter('d48')); $str_48=3D=
$itext_48->input().HtmlInput::hidden('tvacode[]','d48');
-     $itext_49=3Dnew INum('val[]',$this->get_parameter('d49')); $str_49=3D=
$itext_49->input().HtmlInput::hidden('tvacode[]','d49');
-     $itext_81=3Dnew INum('val[]',$this->get_parameter('d81')); $str_81=3D=
$itext_81->input().HtmlInput::hidden('tvacode[]','d81');
-     $itext_82=3Dnew INum('val[]',$this->get_parameter('d82')); $str_82=3D=
$itext_82->input().HtmlInput::hidden('tvacode[]','d82');
-     $itext_83=3Dnew INum('val[]',$this->get_parameter('d83')); $str_83=3D=
$itext_83->input().HtmlInput::hidden('tvacode[]','d83');
-     $itext_84=3Dnew INum('val[]',$this->get_parameter('d84')); $str_84=3D=
$itext_84->input().HtmlInput::hidden('tvacode[]','d84');
-     $itext_85=3Dnew INum('val[]',$this->get_parameter('d85')); $str_85=3D=
$itext_85->input().HtmlInput::hidden('tvacode[]','d85');
-     $itext_86=3Dnew INum('val[]',$this->get_parameter('d86')); $str_86=3D=
$itext_86->input().HtmlInput::hidden('tvacode[]','d86');
-     $itext_87=3Dnew INum('val[]',$this->get_parameter('d87')); $str_87=3D=
$itext_87->input().HtmlInput::hidden('tvacode[]','d87');
-     $itext_88=3Dnew INum('val[]',$this->get_parameter('d88')); $str_88=3D=
$itext_88->input().HtmlInput::hidden('tvacode[]','d88');
-
-     $itext_54=3Dnew INum('val[]',$this->get_parameter('d54')); $str_54=3D=
$itext_54->input().HtmlInput::hidden('tvacode[]','d54');
-     $itext_55=3Dnew INum('val[]',$this->get_parameter('d55')); $str_55=3D=
$itext_55->input().HtmlInput::hidden('tvacode[]','d55');
-     $itext_56=3Dnew INum('val[]',$this->get_parameter('d56')); $str_56=3D=
$itext_56->input().HtmlInput::hidden('tvacode[]','d56');
-     $itext_57=3Dnew INum('val[]',$this->get_parameter('d57')); $str_57=3D=
$itext_57->input().HtmlInput::hidden('tvacode[]','d57');
-     $itext_63=3Dnew INum('val[]',$this->get_parameter('d63')); $str_63=3D=
$itext_63->input().HtmlInput::hidden('tvacode[]','d63');
-     $itext_61=3Dnew INum('val[]',$this->get_parameter('d61')); $str_61=3D=
$itext_61->input().HtmlInput::hidden('tvacode[]','d61');
-     $itext_xx=3Dnew INum('val[]',$this->get_parameter('dxx')); $str_xx=3D=
$itext_xx->input().HtmlInput::hidden('tvacode[]','dxx');
-     $itext_59=3Dnew INum('val[]',$this->get_parameter('d59')); $str_59=3D=
$itext_59->input().HtmlInput::hidden('tvacode[]','d59');
-     $itext_62=3Dnew INum('val[]',$this->get_parameter('d62')); $str_62=3D=
$itext_62->input().HtmlInput::hidden('tvacode[]','d62');
-     $itext_64=3Dnew INum('val[]',$this->get_parameter('d64')); $str_64=3D=
$itext_64->input().HtmlInput::hidden('tvacode[]','d64');
-     $itext_yy=3Dnew INum('val[]',$this->get_parameter('dyy')); $str_yy=3D=
$itext_yy->input().HtmlInput::hidden('tvacode[]','dyy');
-     $itext_71=3Dnew INum('val[]',$this->get_parameter('d71')); $str_71=3D=
$itext_71->input().HtmlInput::hidden('tvacode[]','d71');
-     $itext_72=3Dnew INum('val[]',$this->get_parameter('d72')); $str_72=3D=
$itext_72->input().HtmlInput::hidden('tvacode[]','d72');
-     $itext_91=3Dnew INum('val[]',$this->get_parameter('d91')); $str_91=3D=
$itext_91->input().HtmlInput::hidden('tvacode[]','d91');
-
-
-     ob_start();
-     require_once('form_decl.php');
-     $r=3Dob_get_contents();
-     ob_end_clean();
-     $r.=3DHtmlInput::hidden('periode_dec',$this->periode_dec);
-     return $r;
-
-   }
-   function menu() {
-     $r=3D'';
-     $js_record=3Dsprintf("onclick=3D\"record_writing('%s',%d,%d)\"",
-			$_REQUEST['plugin_code'],
-			dossier::id(),
-			$this->da_id);
-    $js_remove=3Dsprintf("onclick=3D\"if ( confirm('%s')){remove_form('%=
s',%d,%d,'da');}\"",
-		       "Vous confirmez vouloir effacer ?",
-			$_REQUEST['plugin_code'],
-			dossier::id(),
-			$this->da_id);
-
-     $array=3Darray (
-		   array("javascript:void(0)",_("Ecriture comptable"),_("Cr=C3=A9ation=
 de l'=C3=A9criture comptable"),1,$js_record),
-		   array("javascript:void(0)",_("G=C3=A9n=C3=A9rer fichier"),_("Cr=C3=A9=
ation du fichier xml"),2),
-		   array("javascript:void(0)",_("Effacement d=C3=A9claration"),_("Effa=
cement d=C3=A9claration"),3,$js_remove)
-		   );
-     $r.=3DShowItem($array,'V',"mtitle","mtitle");
-     return $r;
-
-   }
-   function propose_form() {
-     $r=3D'';
-     /* take all the vat code */
-     $array=3D$this->db->get_array("select tva_poste from tva_rate");
-
-     if ( empty($array)) return 'aucun compte pour la tva';
-
-	 $str_tva=3D"";$sep=3D"";
-	 for ($i=3D0;$i<count($array);$i++) {
-		 $str_tva.=3D$sep.$array[$i]['tva_poste'];
-		 $sep=3D',';
-	 }
-
-	 $array=3Dexplode(',',$str_tva);
-	 $array=3Darray_unique($array);
-
-     $max=3Dcount($array);
-     $periode=3Dnew Periode($this->db);
-     $per=3D$periode->limit_year($this->exercice);
-     $periode->p_id=3D$per['start'];
-
-     $first_day=3D$periode->first_day();
-     $idx=3D0;
-     $amount_vat=3D0;
-     $r.=3D'<table class=3D"result">';
-     for ( $i=3D0;$i<$max;$i++){
-       /* for each rate explode the accounting */
-      // list($deb,$cred)=3Dexplode(',',$array[$i]['tva_poste']);
-		 $deb=3D$array[$i];
-       /* get saldo for DEBIT*/
-       $saldo=3Dnew Acc_Account_Ledger($this->db,$deb);
-
-       /* get label */
-       $lib=3D$this->db->get_value('select pcm_lib from tmp_pcmn where p=
cm_val=3D$1',array($deb));
-
-       $cond=3Dsprintf(" j_date >=3Dto_date('%s','DD.MM.YYYY') and j_dat=
e <=3D '%s'",
-		     $first_day,
-		     $this->end_date);
-
-       $result=3D$saldo->get_solde_detail($cond);
-       if ( $result['solde']=3D=3D0) continue;
-
-       $account=3Dnew IText('account['.$idx.']');
-       $account->value=3D$deb;
-       $amount=3Dnew INum('amount['.$idx.']');
-       $amount->value=3Dabs($result['solde']);
-
-       $ICheckBox=3Dnew ICheckBox('deb['.$idx.']');
-       if ( $result['debit'] < $result['credit'] ) {
-			 $amount_vat-=3D$result['solde'];	 $ICheckBox->selected=3Dtrue;}
-       else {
-			$amount_vat+=3D$result['solde'];	 $ICheckBox->selected=3Dfalse;
-       }
-       $idx++;
-       /* display row */
-       $r.=3Dtr(td($account->input()).td($lib).td($amount->input()).td($=
ICheckBox->input()));
-
-     }
-     /* ATVA */
-     $atva=3D$this->db->get_value("select pcm_val  from tva_belge.parame=
ter_chld where pcode=3D'ATVA'");
-     if ( $atva !=3D ''  ) {
-       /* get saldo */
-       $saldo=3Dnew Acc_Account_Ledger($this->db,$atva);
-       /* get label */
-       $lib=3D$this->db->get_value('select pcm_lib from tmp_pcmn where p=
cm_val=3D$1',array($atva));
-
-       $cond=3Dsprintf(" j_date >=3Dto_date('%s','DD.MM.YYYY') and j_dat=
e <=3D '%s'",
-		     $first_day,
-		     $this->end_date);
-       $result=3D$saldo->get_solde_detail($cond);
-       $ICheckBox=3Dnew ICheckBox('atva_ic');
-       $account=3Dnew IText('atva');
-       $account->value=3D$atva;
-       $amount=3Dnew INum('atva_amount');
-       $amount->value=3Dabs($result['solde']);
-
-       if ( $result['debit'] < $result['credit'] ) {
-	 $amount_vat-=3D$result['solde'];	 $ICheckBox->selected=3Dtrue;}
-       else {
-	 $ICheckBox->selected=3Dfalse;
-	 $amount_vat+=3D$result['solde'];
-       }
-       /* display row */
-       if ( $result['solde'] !=3D 0)       $r.=3Dtr(td($account->input()=
).td('Avance TVA').td($amount->input()).td($ICheckBox->input()));
-
-     }
-     /* creance sur tva*/
-     /* CRTVA */
-     $crtva=3D$this->db->get_value("select pcm_val  from tva_belge.param=
eter_chld where pcode=3D'CRTVA'");
-     if ( $crtva !=3D ''  ) {
-       /* get saldo */
-       $saldo=3Dnew Acc_Account_Ledger($this->db,$crtva);
-       /* get label */
-       $lib=3D$this->db->get_value('select pcm_lib from tmp_pcmn where p=
cm_val=3D$1',array($crtva));
-
-       $cond=3Dsprintf(" j_date >=3Dto_date('%s','DD.MM.YYYY') and j_dat=
e <=3D '%s'",
-		     $first_day,
-		     $this->end_date);
-       $result=3D$saldo->get_solde_detail($cond);
-       $ICheckBox=3Dnew ICheckBox('crtva_ic');
-       $account=3Dnew IText('crtva');
-       $account->value=3D$crtva;
-       $amount=3Dnew INum('crtva_amount');
-       $amount->value=3Dabs($result['solde']);
-
-       if ( $result['debit'] > $result['credit']) {
-	 $amount_vat+=3D$result['solde'];
-	 $ICheckBox->selected=3Dfalse;
-       } else {
-	 $amount_vat-=3D$result['solde'];
-	 $ICheckBox->selected=3Dtrue;
-
-       }
-       /* display row */
-       if ( $result['solde'] !=3D 0)  $r.=3Dtr(td($account->input()).td(=
'Cr=C3=A9ance compte TVA').td($amount->input()).td($ICheckBox->input()));
-
-     }
-     /* dette tva */
-     $dttva=3D$this->db->get_value("select pcm_val  from tva_belge.param=
eter_chld where pcode=3D'DTTVA'");
-     if ( $dttva !=3D ''  ) {
-       /* get saldo */
-       $saldo=3Dnew Acc_Account_Ledger($this->db,$dttva);
-       /* get label */
-       $lib=3D$this->db->get_value('select pcm_lib from tmp_pcmn where p=
cm_val=3D$1',array($dttva));
-
-       $cond=3Dsprintf(" j_date >=3Dto_date('%s','DD.MM.YYYY') and j_dat=
e <=3D '%s'",
-		     $first_day,
-		     $this->end_date);
-       $result=3D$saldo->get_solde_detail($cond);
-       $ICheckBox=3Dnew ICheckBox('dttva_ic');
-       $account=3Dnew IText('dttva');
-       $account->value=3D$dttva;
-       $amount=3Dnew INum('dttva_amount');
-       $amount->value=3Dabs($result['solde']);
-
-       if ( $result['credit'] > $result['debit'] ) {
-	 $amount_vat-=3D$result['solde'];
-	 $ICheckBox->selected=3Dtrue;
-       } else {
-	 $ICheckBox->selected=3Dfalse;
-	 $amount_vat+=3D$result['solde'];
-       }
-       /* display row */
-       if ( $result['solde'] !=3D 0)       $r.=3Dtr(td($account->input()=
).td('Dette Compte TVA').td($amount->input()).td($ICheckBox->input()));
-
-     }
-     /* if amount_vat > 0 then we have to pay */
-     if ( $amount_vat < 0 ) {
-       /* dette tva */
-       if ( $dttva !=3D ''  ) {
-	 /* get label */
-	 $lib=3D$this->db->get_value('select pcm_lib from tmp_pcmn where pcm_va=
l=3D$1',array($dttva));
-
-	 $ICheckBox=3Dnew ICheckBox('solde_ic');
-	 $ICheckBox->selected=3Dfalse;
-	 $account=3Dnew IText('solde');
-	 $account->value=3D$dttva;
-	 $amount=3Dnew INum('solde_amount');
-	 $amount->value=3Dabs($amount_vat);
-
-	 /* display row */
-	 $r.=3Dtr(td($account->input()).td('Dette Compte TVA').td($amount->inpu=
t()).td($ICheckBox->input()));
-       }
-     }else {
-       /* creance tva */
-       if ( $crtva !=3D ''  ) {
-	 /* get label */
-	 $lib=3D$this->db->get_value('select pcm_lib from tmp_pcmn where pcm_va=
l=3D$1',array($crtva));
-
-	 $ICheckBox=3Dnew ICheckBox('solde_ic');
-	 $ICheckBox->selected=3Dtrue;
-	 $account=3Dnew IText('solde');
-	 $account->value=3D$crtva;
-	 $amount=3Dnew INum('solde_amount');
-	 $amount->value=3Dabs($amount_vat);
-
-	 /* display row */
-	 $r.=3Dtr(td($account->input()).td('Cr=C3=A9ance Compte TVA').td($amoun=
t->input()).td($ICheckBox->input()));
-       }
-
-     }
-     $r.=3D'</table>';
-
-     return $r;
-   }
-   function display() {
-     $r=3D '<form class=3D"print" id=3D"readonly">';
-	 $r.=3DHtmlInput::request_to_hidden(array('ac'));
-     $r.=3D'<div style=3D"position:absolute;top:150;right:0;width:200;ri=
ght-margin:3%">';
-     $r.=3D$this->menu();
-     $r.=3D'</div>';
-     $r.=3D$this->display_info();
-     $r.=3D$this->display_declaration_amount();
-     $r.=3D'</form>';
-     $r.=3D create_script("$('readonly').disable();");
-     return $r;
-   }
-
-}

Deleted: tag/rel652/rapport_avance/class_ext_tvagen.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/class_ext_tvagen.php	2012-12-27 00:27:39 UT=
C (rev 455)
+++ tag/rel652/rapport_avance/class_ext_tvagen.php	2012-12-27 01:26:31 UT=
C (rev 456)
@@ -1,207 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published b=
y
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-130=
7  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-
-/*!\file
- * \brief
- */
-
-require_once('tva_constant.php');
-require_once('class_own.php');
-/**
- *@brief transform a string into an arrau without empty element and  dup=
licate
- * the array is sorted
- *@param $p_string string containing a comma a separator
- *@return array
- *
- */
-function get_array_nodup($p_string) {
-  $array=3Dexplode(',',$p_string);
-  sort($array);
-  $array=3Darray_unique($array);
-  $result=3Darray();
-  foreach ($array as $val) {
-    if ( $val =3D=3D '') continue;
-    $result[]=3D$val;
-  }
-  $r=3Djoin(',',$result);
-  return $result;
-}
-
-class Ext_Tva_Gen
-{
-  function __construct($p_cn) {
-    $this->db=3D$p_cn;
-  }
-  public function get_parameter($p_string) {
-    if ( array_key_exists($p_string,$this->variable) ) {
-      $idx=3D$this->variable[$p_string];
-      return $this->$idx;
-    }
-    else
-      throw new Exception (__FILE__.":".__LINE__.'Erreur attribut inexis=
tant');
-  }
-  public function set_parameter($p_string,$p_value) {
-    if ( array_key_exists($p_string,$this->variable) ) {
-      $idx=3D$this->variable[$p_string];
-      $this->$idx=3D$p_value;
-    }
-    else
-      throw new Exception (__FILE__.":".__LINE__.'Erreur attribut inexis=
tant');
-
-
-  }
-  public function get_info() {    return var_export(self::$variable,true=
);  }
-
-  public function save() {
-  /* please adapt */
-    if (  $this->get_parameter("id") =3D=3D 0 )
-      $this->insert();
-    else
-      $this->update();
-  }
-
-  static function choose_periode($by_year=3Dfalse) {
-    require_once('class_iradio.php');
-    $monthly=3Dnew IRadio('periodic');
-    $monthly->value=3D1;
-
-    // month
-    $month=3Dnew ISelect('bymonth');
-    $array=3Darray ();
-    for ($i=3D0;$i<12;$i++) {
-      $array[$i]['value']=3D$i+1; $array[$i]['label']=3Dsprintf('%02d',(=
$i+1));
-    }
-    $month->value=3D$array;
-    $monthly->selected=3Dtrue;
-    $str_monthly=3D$monthly->input();
-    $str_month=3D$month->input();
-    // year
-    $year =3D new IText('year');
-    $year->size=3D4;
-    $str_year=3D$year->input();
-
-    // Tri
-    $quater=3Dnew ISelect('byquaterly');
-    $array=3Darray();
-    for ($i=3D0;$i<4;$i++) {
-      $array[$i]['value']=3D$i+1; $array[$i]['label']=3Dsprintf('%02d',(=
$i+1));
-    }
-    $quater->value=3D$array;
-    $quaterly=3Dnew IRadio('periodic');
-    $quaterly->value=3D2;
-    $str_quaterly=3D$quaterly->input();
-    $str_quater=3D$quater->input();
-
-    $str_submit=3DHtmlInput::submit('decl',_('Afficher'));
-    $str_hidden=3DHtmlInput::extension().dossier::hidden();
-    if (isset($_REQUEST['sa']))
-      $str_hidden.=3DHtmlInput::hidden('sa',$_REQUEST['sa']);
-	$str_hidden.=3DHtmlInput::request_to_hidden(array('ac'));
-    $str_byyear=3D'';
-    if ( $by_year =3D=3D true ) {
-      $yearly=3Dnew IRadio('periodic');
-      $yearly->value=3D3;
-      $str_byyear=3D$yearly->input();
-    }
-    ob_start();
-    require_once('form_periode.php');
-    $r=3Dob_get_contents();
-    ob_end_clean();
-    return $r;
-  }
-
-  function blank($p_year,$p_periode,$p_flag_quaterly) {
-    // load parameter from myown
-    $own=3Dnew Own($this->db);
-    $this->set_parameter("name",$own->MY_NAME);
-    $this->set_parameter("num_tva",$own->MY_TVA);
-    $this->set_parameter('adress',$own->MY_STREET.",".$own->MY_NUMBER);
-    $this->set_parameter('country',$own->MY_COUNTRY." ".$own->MY_CP." ".=
$own->MY_COMMUNE);
-    $this->set_parameter('flag_periode',$p_flag_quaterly);
-    $this->set_parameter('periode_dec',$p_periode);
-    $this->set_parameter('exercice',$p_year);
-
-    try {
-      $this->verify() ;
-    } catch ( Exception $e) {
-      echo $e->getMessage();
-      throw $e;
-    }
-    // by month
-    if ( $p_flag_quaterly =3D=3D 1) {
-      // start periode =3D 01 to 31, $p_periode contains the month
-      $per_start=3D"01.".$p_periode.".".$p_year;
-      $day=3D31;
-      $per_end=3D"31".".".$p_periode.".".$p_year;
-      while ( checkdate($p_periode,$day,$p_year) =3D=3D false && $day > =
25) {
-	$day--;
-	$per_end=3D$day.".".$p_periode.".".$p_year;
-      }
-      if ($day < 28 ) { echo __FILE__.__LINE__." Erreur de date $day"; e=
xit;}
-    }
-
-    if ( $p_flag_quaterly =3D=3D 2 ) {
-      // compute start periode
-      $per_start=3D$GLOBALS['quaterly_limit'][$p_periode][0].".".$p_year=
;
-      $per_end=3D$GLOBALS['quaterly_limit'][$p_periode][1].".".$p_year;
-
-    }
-    if ( $p_flag_quaterly =3D=3D 3 ) {
-      // compute start periode
-      $per_start=3D'01.01.'.$p_year;
-      $per_end=3D'31.12.'.$p_year;
-    }
-
-    $this->set_parameter('start_periode',$per_start);
-    $this->set_parameter('end_periode',$per_end);
-
-  }
-
-  /**
-   *@brief display the information about the company
-   */
-  function display_info(){
-    $itva=3Dnew IText('num_tva',$this->num_tva);$str_tva=3D$itva->input(=
);
-    $iname=3Dnew IText('name',$this->tva_name); $str_name=3D$iname->inpu=
t();
-    $iadress=3Dnew IText('adress',$this->adress);$str_adress=3D$iadress-=
>input();
-    $icountry=3Dnew IText('country',$this->country);$str_country=3D$icou=
ntry->input();
-
-    /* date */
-
-    if (isset($this->date_decl)) { $idate=3Dnew IText('date',format_date=
($this->date_decl));$str_date=3D$idate->input();}
-
-    /* periode */
-
-    if ( isset($this->start_date) ){
-      $str_start=3Dformat_date($this->start_date);
-      $str_end=3Dformat_date($this->end_date);
-
-    }
-    $ianne=3D$this->exercice;
-    ob_start();
-    require_once('form_decl_info.php');
-    $r=3Dob_get_contents();
-    ob_end_clean();
-    return $r;
-  }
-
-}

Deleted: tag/rel652/rapport_avance/class_listing.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/class_listing.php	2012-12-27 00:27:39 UTC (=
rev 455)
+++ tag/rel652/rapport_avance/class_listing.php	2012-12-27 01:26:31 UTC (=
rev 456)
@@ -1,40 +0,0 @@
-<?php
-  /*
-   *   This file is part of PhpCompta.
-   *
-   *   PhpCompta is free software; you can redistribute it and/or modify
-   *   it under the terms of the GNU General Public License as published=
 by
-   *   the Free Software Foundation; either version 2 of the License, or
-   *   (at your option) any later version.
-   *
-   *   PhpCompta is distributed in the hope that it will be useful,
-   *   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   *   GNU General Public License for more details.
-   *
-   *   You should have received a copy of the GNU General Public License
-   *   along with PhpCompta; if not, write to the Free Software
-   *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1=
307  USA
-   */
-  /* $Revision$ */
-
-  // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-
-  /*!\file
-   * \brief
-   */
-require_once('class_ext_tvagen.php');
-require_once('class_acc_parm_code.php');
-class Listing extends Ext_Tva_Gen {
-  function find_tva_code($p_array)
-	{
-		$array=3D$this->db->make_list("
-			select distinct tva_id  from tva_belge.parameter_chld
-			where
-			pcode=3D$1",
-				array($p_array));
-
-		return $array;
-	}
-
-}
\ No newline at end of file

Deleted: tag/rel652/rapport_avance/class_tva_amount.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/class_tva_amount.php	2012-12-27 00:27:39 UT=
C (rev 455)
+++ tag/rel652/rapport_avance/class_tva_amount.php	2012-12-27 01:26:31 UT=
C (rev 456)
@@ -1,204 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published b=
y
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-130=
7  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-
-/*!\file
- * \brief
- */
-
-
-/*!\brief
- *
- *
- */
-class Tva_Amount
-{
-
-  private static $variable=3Darray('amount'=3D>'amount',
-				 'amount_tva'=3D>'amount_tva',
-				 'param'=3D>'param',
-				 'dir'=3D>'dir',
-				 'start_periode'=3D>'start_periode',
-				 'end_periode'=3D>'end_periode',
-				 'grid'=3D>'grid'
-				 );
-  function __construct ($p_init,$p_dir,$p_start_periode,$p_end_periode) =
{
-    $this->db=3D$p_init;
-    $this->start_periode=3D$p_start_periode;
-    $this->end_periode=3D$p_end_periode;
-    $this->dir=3D$p_dir;
-  }
-  public function get_parameter($p_string) {
-    if ( array_key_exists($p_string,self::$variable) ) {
-      $idx=3Dself::$variable[$p_string];
-      return $this->$idx;
-    }
-    else
-      exit (__FILE__.":".__LINE__.'Erreur attribut inexistant');
-  }
-  public function set_parameter($p_string,$p_value) {
-    if ( array_key_exists($p_string,self::$variable) ) {
-      $idx=3Dself::$variable[$p_string];
-      $this->$idx=3D$p_value;
-    }
-    else
-      exit (__FILE__.":".__LINE__.'Erreur attribut inexistant');
-
-
-  }
-  public function get_info() {    return var_export(self::$variable,true=
);  }
-  public function verify() {
-    // Verify that the elt we want to add is correct
-  }
-  /**
-   *@brief load parameters and set param to a array of value from parame=
ter_chld
-   */
-  public function load_parameter() {
-    //  get the vat code
-     $ctva=3D$this->db->get_array("select tva_id,pcm_val from tva_belge.=
parameter_chld where pcode=3D$1",array($this->grid));
-     if ( count($ctva)=3D=3D 0 ) {
-       $this->param=3Dnull;
-     }
-     $this->param=3D$ctva;
-  }
-  /**
-   *@brief get the amount of vat thanks its code
-   *@param $p_gril is the gril code
-   *@param $p_dir is out or in in for the table quant_purchase and
-   * out for the table quant_sold
-   *@return a number
-   */
-  function amount_operation() {
-    // get the VAT code
-    $this->load_parameter();
-    $result=3D0;
-	bcscale(4);
-	for ($i=3D0;$i<count($this->param);$i++)
-	{
-		$tmp_calc=3D$this->get_amount_filter($this->param[$i]['tva_id'],$this-=
>param[$i]['pcm_val']);
-		$result=3Dbcadd($result,$tmp_calc);
-
-	}
-    return round($result,2);
-
-
-  }
-  function amount_vat() {
-    // get the VAT code
-   $this->load_parameter();
-    $result=3D0;
-	bcscale(4);
-	for ($i=3D0;$i<count($this->param);$i++)
-	{
-		$tmp_calc=3D$this->get_vat_filter($this->param[$i]['tva_id'],$this->pa=
ram[$i]['pcm_val']);
-		$result=3Dbcadd($result,$tmp_calc);
-
-	}
-    return round($result,2);
-
-
-  }
-
-  /**
-   *@brief get the amount of operation from the table quant_sold or quan=
t_purchase
-   *@return amount
-   */
-  private function get_amount_filter($p_code,$p_account) {
-    if ( $this->dir =3D=3D 'out' && trim($p_account) !=3D'' && trim($p_c=
ode) !=3D'' ) {
-      $sql=3D"select coalesce(sum(qs_price),0) as amount from quant_sold
-		  join jrnx using (j_id)
-           where qs_vat_code=3D$1 and  (j_date >=3D to_date($2,'DD.MM.YY=
YY') and j_date <=3D to_date($3,'DD.MM.YYYY'))
-           and j_poste::text like ($4)";
-      $res=3D$this->db->get_array($sql,array($p_code,
-					   $this->start_periode,
-					   $this->end_periode,
-					   $p_account));
-      return $res[0]['amount'];
-    }
-
-    if ( $this->dir =3D=3D 'in' && trim($p_account) !=3D'' && trim($p_co=
de) !=3D'' ) {
-      $sql=3D"select coalesce(sum(qp_price),0) as amount from quant_purc=
hase join jrnx using (j_id)
-           where qp_vat_code=3D$1 and  (j_date >=3D to_date($2,'DD.MM.YY=
YY') and j_date <=3D to_date($3,'DD.MM.YYYY'))
-           and j_poste::text like ($4)";
-      $res=3D$this->db->get_array($sql,array($p_code,
-					   $this->start_periode,
-					   $this->end_periode,
-					   $p_account));
-      return $res[0]['amount'];
-    }
-
-
-    return 0;
-  }
-
-  /**
-   *@brief get the amount of VAT from the table quant_sold or quant_purc=
hase
-   *@return amount
-   */
-  private function get_vat_filter($p_code,$p_account) {
-    if ( $this->dir =3D=3D 'out' && trim($p_account) !=3D'' && trim($p_c=
ode) !=3D'' ) {
-      $sql=3D"select coalesce(sum(qs_vat),0) as amount from quant_sold j=
oin jrnx using (j_id)
-           where qs_vat_code=3D$1 and  (j_date >=3D to_date($2,'DD.MM.YY=
YY') and j_date <=3D to_date($3,'DD.MM.YYYY'))
-           and j_poste::text like ($4)";
-      $res=3D$this->db->get_array($sql,array($p_code,
-					   $this->start_periode,
-					   $this->end_periode,
-					   $p_account));
-      return $res[0]['amount'];
-    }
-
-    if ( $this->dir =3D=3D 'in' && trim($p_account) !=3D'' && trim($p_co=
de) !=3D'' ) {
-      $sql=3D"select coalesce(sum(qp_vat),0) as amount from quant_purcha=
se join jrnx using (j_id)
-           where qp_vat_code=3D$1 and  (j_date >=3D to_date($2,'DD.MM.YY=
YY') and j_date <=3D to_date($3,'DD.MM.YYYY'))
-           and j_poste::text like ($4)";
-      $res=3D$this->db->get_array($sql,array($p_code,
-					   $this->start_periode,
-					   $this->end_periode,
-					   $p_account));
-      return $res[0]['amount'];
-    }
-
-
-    return 0;
-  }
-
-/**
- *@brief
- * record into the ledger the operation for purging the
- * the vat accouting
- */
-function record_ledger() {
-
-}
-
-  /*!\brief
-   *\param
-   *\return
-   *\note
-   *\see
-   *\todo
-   */
-  static function test_me() {
-  }
-
-}
-
-/* test::test_me(); */

Deleted: tag/rel652/rapport_avance/class_tva_parameter.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/class_tva_parameter.php	2012-12-27 00:27:39=
 UTC (rev 455)
+++ tag/rel652/rapport_avance/class_tva_parameter.php	2012-12-27 01:26:31=
 UTC (rev 456)
@@ -1,146 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published b=
y
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-130=
7  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-
-/*!\file
- * \brief
- */
-
-
-/*!\brief
- *
- *
- */
-class  Tva_Parameter
-{
-  private static $variable=3Darray("code"=3D>"pcode","value"=3D>"pvalue"=
,"account"=3D>'paccount');
-  function __construct ($p_init) {
-    $this->cn=3D$p_init;
-  }
-  public function get_parameter($p_string) {
-    if ( array_key_exists($p_string,self::$variable) ) {
-      $idx=3Dself::$variable[$p_string];
-      return $this->$idx;
-    }
-    else
-      exit (__FILE__.":".__LINE__.$p_string.' Erreur attribut inexistant=
');
-  }
-  public function set_parameter($p_string,$p_value) {
-    if ( array_key_exists($p_string,self::$variable) ) {
-      $idx=3Dself::$variable[$p_string];
-      $this->$idx=3D$p_value;
-    }
-    else
-      exit (__FILE__.":".__LINE__.$p_string.' Erreur attribut inexistant=
');
-
-
-  }
-  public function get_info() {    return var_export(self::$variable,true=
);  }
-  public function verify() {
-    // Verify that the elt we want to add is correct
-  }
-  /**
-   *@brief retrieve * row thanks a condition
-   */
-   public function seek($cond,$p_array=3Dnull)
-   {
-   /*
-     $sql=3D"select * from * where $cond";
-     return $this->cn->get_array($cond,$p_array)
-  */
-   }
-  public function insert() {
-    if ( $this->verify() !=3D 0 ) return;
-
-    $sql=3D"insert into tva_belge.parameter (pcode,pvalue,paccount) ".
-      " values ($1,$2) ";
-    $this->tva_id=3D$this->cn->exec_sql(
-				       $sql,
-				       array($this->pcode,
-					     $this->pvalue,
-					     $this->paccount)
-				       );
-
-  }
-
-  public function update() {
-    if ( $this->verify() !=3D 0 ) return;
-
-    $sql=3D"update tva_belge.parameter  set pvalue=3D$1,paccount=3D$2 ".
-      " where pcode =3D $3";
-    $res=3D$this->cn->exec_sql(
-		 $sql,
-		 array($this->pvalue,
-		       $this->paccount,
-		       $this->pcode)
-		 );
-
-  }
-
-  public function load() {
-
-   $sql=3D"select pcode from tva_belge.parameter where pcode=3D$1";
-
-    $res=3D$this->cn->get_array(
-		 $sql,
-		 array($this->pcode)
-		 );
-
-    if ( count($res) =3D=3D 0 ) return -1;
-    for ($i=3D0;$i<count($res);$i++) { $this->pcode=3D$res[$i]['pcode'];=
$this->pvalue=3D$res[$i]['pvalue'];$this->paccount=3D$res[$i]['paccount']=
; }
-    return 0;
-  }
-  /**
-   *@brief check that this accounting does exist in the accounting plan
-   *@param $p_code code to check
-   *@return the number of row found (0 if none)
-   */
-  public function exist_pcmn($p_code) {
-    $count=3D$this->cn->get_value('select count(*) from tmp_pcmn where p=
cm_val::text like $1',array($p_code));
-    return $count;
-  }
-  /**
-   *@brief show the content of the table tva_belge.parameter
-   */
-  public function display() {
-	 global $cn;$cn=3D$this->cn;
-
-	$res=3D$this->cn->get_array("select pcode from tva_belge.parameter");
-
-    ob_start();
-    require_once('form_parameter.php');
-    $r=3Dob_get_contents();
-    ob_end_clean();
-    return $r;
-  }
-  /*!\brief
-   *\param
-   *\return
-   *\note
-   *\see
-   *\todo
-   */
-  static function test_me() {
-  }
-
-}
-
-/* test::test_me(); */

Deleted: tag/rel652/rapport_avance/decl_tva.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/decl_tva.inc.php	2012-12-27 00:27:39 UTC (r=
ev 455)
+++ tag/rel652/rapport_avance/decl_tva.inc.php	2012-12-27 01:26:31 UTC (r=
ev 456)
@@ -1,111 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published b=
y
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-130=
7  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-
-/*!\file
- * \brief this file is included to create a  new VAT declaration
- *=20
- */
-require_once('class_ext_tva.php');
-echo '<div class=3D"content" style=3D"width:80%;margin-left:10%">';
-
-// verify the year
-if ( isset($_REQUEST['year']) && (trim(strlen($_REQUEST['year'])) < 4 ||=
 isNumber($_REQUEST['year'] ) =3D=3D 0 ||$_REQUEST['year'] < 2000||$_REQU=
EST['year']>2100)) {
-  alert(j(_('Ann=C3=A9e invalide'.' ['.$_REQUEST['year'].']')));
-  echo Ext_Tva::choose_periode();
-  echo '</div>';
-  exit;
-}
-
-  // if the periode is not set we have to ask it
-if ( ! isset($_REQUEST['decl']) ){
-  echo Ext_Tva::choose_periode();
-  echo '</div>';
-  exit;
-}
-$cn=3Dnew Database(Dossier::id());
-if (isset($_POST['save'] )) {
-  $save=3Dnew Ext_Tva($cn);
-  $save->from_array($_POST);
-  $save->insert();
-  echo h2info(_('D=C3=A9claration sauv=C3=A9e'));
-  echo $save->display();
-  /**
-   *@todo add a div for the button generate, get_xml, create ODS, print.=
..
-   */
-//   echo '<div style=3D"position:absolute;z-index:14;top:25%;right:30" =
class=3D"noprint">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</d=
iv>';
-  echo '</div>';
-  exit;
-}
-
-$tva=3Dnew Ext_Tva($cn);
-
-/* by month */
-if ( $_REQUEST['periodic']=3D=3D1) {
-  $str_monthly=3D'';
-  $str_month=3D$_GET['bymonth'];$str_year=3D$_GET['year'];$str_quaterly=3D=
"";$str_hidden=3D'';$str_submit=3D'';$str_quater=3D'-';
-  $tva->blank($_REQUEST['year'],$_GET['bymonth'],1);
-
-}
-
-/* by quater */
-if ($_REQUEST['periodic'] =3D=3D 2) {
-  $str_quaterly=3D'';
-  $str_month=3D"-";
-  $str_year=3D$_GET['year'];
-  $str_quater=3D$_REQUEST['byquaterly'];
-  $str_hidden=3D'';$str_submit=3D'';$str_monthly=3D'';
-  $tva->blank($_REQUEST['year'],$_GET['byquaterly'],2);
-}
-try {
-  $r=3D$tva->compute();
-} catch (Exception $e) {
-
-  echo '<div class=3D"content" style=3D"width:80%;margin-left:10%">';
-  echo Ext_Tva::choose_periode();
-  echo '</div>';
-  exit();
-  }
-require_once('form_periode.php');
-echo '<form class=3D"print" method=3D"post">';
-echo dossier::hidden();
-echo HtmlInput::extension();
-echo HtmlInput::hidden('start_periode',$tva->start_periode);
-echo HtmlInput::hidden('end_periode',$tva->end_periode);
-echo HtmlInput::hidden('flag_periode',$tva->flag_periode);
-echo HtmlInput::hidden('name',$tva->tva_name);
-echo HtmlInput::hidden('num_tva',$tva->num_tva);
-echo HtmlInput::hidden('adress',$tva->adress);
-echo HtmlInput::hidden('country',$tva->country);
-echo HtmlInput::hidden('exercice',$tva->exercice);
-
-
-
-echo $tva->display_info();
-echo $r;
-echo $tva->display_declaration_amount();
-echo HtmlInput::submit('save',_('Sauvegarde'));
-echo '</form>';
-echo '</div>';
-  // create the XML files and the OD operation, validate it to save it i=
nto the vat history
-
-
-?>

Deleted: tag/rel652/rapport_avance/form_decl.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/form_decl.php	2012-12-27 00:27:39 UTC (rev =
455)
+++ tag/rel652/rapport_avance/form_decl.php	2012-12-27 01:26:31 UTC (rev =
456)
@@ -1,237 +0,0 @@
-<style type=3D"text/css">
-   h1 {
- color : blue;
- font-size:120%;
- }
-   table tr {
-     font-size:12px;
-   }
-</style>
-<h1>Cadre II : Op=C3=A9rations =C3=A0 la sortie </h1>
-<table>
-<tr>
-<td>
-A. Op=C3=A9rations soumises =C3=A0 un r=C3=A9gime particulier [00]
-</td>
-<td>
-<?=3D$str_00;?>
-</td>
-</tr><tr>
-<td>
- B. Op=C3=A9rations pour lesquelles la T.V.A. est due par le d=C3=A9clar=
ant :</td></td>
- </tr><tr>
- <td>&nbsp;&nbsp;&nbsp;&nbsp;- au taux de 6% [01]</td>
-<td>
-<?=3D$str_01;?>
-</td>
- </tr><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;- au taux de 12% [02]</td>
-<td>
-<?=3D$str_02;?>
-</td>
- </tr><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;- au taux de 21% [03] </td>
-<td>
-<?=3D$str_03;?>
-</td>
-</tr><tr>
-<td>
-C. Services pour lesquels la T.V.A. =C3=A9trang=C3=A8re est due par le c=
ocontractant [44]
-</td>
-<td>
-<?=3D$str_44;?>
-</td>
-</tr><tr>
-<td>
-D. Op=C3=A9rations pour lesquelles la T.V.A. est due par le cocontractan=
t [45]
-</td>
-<td>
-<?=3D$str_45;?>
-</td>
-</tr><tr>
-<td>
-E. Livraisons intracommunautaires exempt=C3=A9es effectu=C3=A9es en Belg=
ique et ventes ABC [46]
-</td>
-<td>
-<?=3D$str_46;?>
-</td>
-</tr><tr>
-<td>
- F. Autres op=C3=A9rations exempt=C3=A9es et autres op=C3=A9rations effe=
ctu=C3=A9es =C3=A0 l'=C3=A9tranger [47]
-</td>
-<td>
-<?=3D$str_47;?>
-</td>
-</tr><tr>
-<td>
-G. Montant des notes de cr=C3=A9dit d=C3=A9livr=C3=A9es et des correctio=
ns n=C3=A9gatives : </td>
- </tr><tr>
- <td>&nbsp;&nbsp;&nbsp;&nbsp;- relatif aux op=C3=A9rations inscrites en =
grilles 44 et 46 [48] </td>
-<td>
-<?=3D$str_48;?>
-</td>
-
- </tr><tr>
- <td>&nbsp;&nbsp;&nbsp;&nbsp;- relatif aux autres op=C3=A9rations du cad=
re II [49]</td>
-<td>
-<?=3D$str_49;?>
-</td>
-
- </tr><tr>
- </table>
-
-<h1>Cadre III : Op=C3=A9rations =C3=A0 l'entr=C3=A9e</h1>
-<table>
-<tr>
-<td>A. Montant des op=C3=A9rations =C3=A0 l'entr=C3=A9e compte tenu des =
notes de cr=C3=A9dit re=C3=A7ues et autres corrections : </td>
-</tr>
-<tr>
-<td>&nbsp;&nbsp;&nbsp;&nbsp;- marchandises, mati=C3=A8res premi=C3=A8res=
 et mati=C3=A8res auxiliaires [81] </td>
-<td>
-<?=3D$str_81;?>
-</td>
-</tr>
-<tr>
-<td>&nbsp;&nbsp;&nbsp;&nbsp;- services et biens divers [82]  </td>
-<td>
-<?=3D$str_82;?>
-</td>
-</tr>
-<tr>
-<td>&nbsp;&nbsp;&nbsp;&nbsp;- biens d'investissement [83]  </td>
-<td>
-<?=3D$str_83;?>
-</td>
-</tr>
-<tr>
-<td>B. Montant des notes de cr=C3=A9dit re=C3=A7ues et des corrections n=
=C3=A9gatives : </td>
-</tr>
-<tr>
-<td>&nbsp;&nbsp;&nbsp;&nbsp;- relatif aux op=C3=A9rations inscrites en g=
rilles 86 et 88 [84]  </td>
-<td>
-<?=3D$str_84;?>
-</td>
-</tr>
-<tr>
-<td>&nbsp;&nbsp;&nbsp;&nbsp;- relatif aux autres op=C3=A9rations du cadr=
e III [85]  </td>
-<td>
-<?=3D$str_85;?>
-</td>
-</tr>
-<tr>
-<td>C. Acquisitions intracommunautaires effectu=C3=A9es en Belgique et v=
entes ABC [86] </td>
-<td>
-<?=3D$str_86;?>
-</td>
-</tr>
-<tr>
-<td>
-D. Autres op=C3=A9rations =C3=A0 l'entr=C3=A9e pour lesquelles la T.V.A.=
 est due par le d=C3=A9clarant [87] </td>
-<td><?=3D$str_87?></td>
-</tr><tr>
-<td> E. Services intracommunautaires avec report de perception [88]</td>
-<td>
-<?=3D$str_88?>
-</td>
-</table>
-
-<h1>Cadre IV : Taxe due</h1>
-<table>
-<tr><TD> A. T.V.A. relative aux op=C3=A9rations d=C3=A9clar=C3=A9es en=C2=
=A0: </td>
-</tr>
-<tr>
-<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;-grilles 01, 02 et 03 [54]</td>
-<td>
-<?=3D$str_54;?>
-</td>
-</tr>
-<td>&nbsp;&nbsp;&nbsp;&nbsp;- grilles 86 et 88 [55] </td>
-<td>
-<?=3D$str_55;?>
-</td>
-</tr>
-<tr>
-<tr>
-<td>&nbsp;&nbsp;&nbsp;&nbsp;- grille 87, =C3=A0 l'exception des importat=
ions avec report de perception [56] </td>
-<td><?=3D$str_56;?></td>
-</tr>
-<tr>
-<td>
-B. T.V.A. relative aux importations avec report de perception [57] </td>
-<td><?=3D$str_57;?></td>
-</tr>
-<tr>
-<td>
-
-C. Diverses r=C3=A9gularisations T.V.A. en faveur de l'Etat [61]</td>
-<td><?=3D$str_61?></td>
-</tr>
-<tr>
-<td>
-D. T.V.A. =C3=A0 reverser mentionn=C3=A9e sur les notes de cr=C3=A9dit r=
e=C3=A7ues [63]
-</td>
-<td><?=3D$str_63;?></td>
-</tr>
-<tr>
-<td>
-Total des grilles 54, 55, 56, 57, 61 et 63 [XX]
-</td>
-<td>
-<?=3D$str_xx;?>
-</td>
-</tr>
-</table>
-<h1>Cadre V : Taxes d=C3=A9ductibles, solde et acompte</h1>
-<table>
-<tr>
-<td>
-A.T.V.A. d=C3=A9ductible  [59]
-</td>
-<td>
-<?=3D$str_59;?>
-</td>
-</tr>
-<tr>
-<td>B.Diverses r=C3=A9gularisations T.V.A. en faveur du d=C3=A9clarant  =
[62]
-</td>
-<td>
-<?=3D$str_62;?>
-</td>
-</tr>
-<tr>
-<td>C.T.V.A. =C3=A0 r=C3=A9cup=C3=A9rer mentionn=C3=A9e sur les notes de=
 cr=C3=A9dit d=C3=A9livr=C3=A9es [64]
-</td>
-<td>
-<?=3D$str_64;?>
-</td>
-</tr>
-<tr>
-<td>
-Total des grilles 59, 62 et 64[yy]
-</td>
-<td><?=3D$str_yy;?></td>
-</tr>
-</table>
-
-<h1>Cadre VI : Solde*</h1>
-<table>
-<tr>
-<td>Taxe due =C3=A0 l'Etat : grille xx - grille yy [71]</td>
-<td><?=3D$str_71;?></td>
-</tr>
-<tr>
-<td>Sommes dues par l'Etat : grille yy - grille xx [72]</td>
-<td><?=3D$str_72;?></td>
-</tr>
-</table>
-<span class=3D"notice">*Une seule des grilles 71 ou 72 peut =C3=AAtre re=
mplie </span>
-
-<h1>Cadre VII : Acompte*</h1>
-<table>
-<tr>
-<td>
-T.V.A. r=C3=A9ellement due pour la p=C3=A9riode du 1er au 20 d=C3=A9cemb=
re[91]
-</td>
-<td><?=3D$str_91;?></td>
-</tr>
-</table>
-<span class=3D"notice">*Concerne uniquement la d=C3=A9claration mensuell=
e de d=C3=A9cembre</span>
-

Deleted: tag/rel652/rapport_avance/form_decl_info.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/form_decl_info.php	2012-12-27 00:27:39 UTC =
(rev 455)
+++ tag/rel652/rapport_avance/form_decl_info.php	2012-12-27 01:26:31 UTC =
(rev 456)
@@ -1,31 +0,0 @@
-<h1>Cadre I : renseignements g=C3=A9n=C3=A9raux</h1>
-
-<table>
-<tr>
-<td>Ann=C3=A9e</td><td> <?=3D$ianne?></td>
-</tr>
-<?if (isset ($str_date)) :?>
-<tr>
-<td>Date </td><td><?=3D$str_date?></td>
-</tr>
-<tr>
-<td>P=C3=A9riode d=C3=A9but </td><td><?=3D$str_start?></td>
-</tr>
-<tr>
-<td>P=C3=A9riode fin </td><td><?=3D$str_end?></td>
-</tr>
-<?
-endif;
-?>
-<td>N=C2=B0 de tva </td>
-<td><?=3D$str_tva?></td>
-</tr><tr>
-<td>Nom</td><td><?=3D$str_name?></td>
-</tr><tr>
-<td>Adresse</td><td><?=3D$str_adress?></td>
-</tr><tr>
-<td>Pays code postal et localite BE</td><td><?=3D$str_country?></td>
-</tr>
-</tr>
-
-</table>

Deleted: tag/rel652/rapport_avance/form_parameter.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/form_parameter.php	2012-12-27 00:27:39 UTC =
(rev 455)
+++ tag/rel652/rapport_avance/form_parameter.php	2012-12-27 01:26:31 UTC =
(rev 456)
@@ -1,195 +0,0 @@
-<?php
-global $tab;
-function show($p_code,$p_desc) {
-	global $cn,$tab;
-	echo "<h2>".h($p_code)." ".$p_desc."</h2>";
-	$plugin_code=3D$_REQUEST['plugin_code'];
-	$dossier=3DDossier::id();
-	$a_code=3D$cn->get_array("
-			select pi_id, pc.tva_id,tva_label,tva_comment,tva_rate, pcm_val
-			from tva_belge.parameter_chld as pc
-			left join tva_rate as tv on (pc.tva_id=3Dtv.tva_id)
-			where pcode=3D$1 order by pi_id",
-			array($p_code));
-	if (sizeof($a_code) =3D=3D 0) {
-		echo '<span class=3D"notice" style=3D"display:block">Aucun param=C3=A8=
tre donn=C3=A9 </span>';
-
-		echo HtmlInput::button("add_param","Ajout param=C3=A8tre","onclick=3D\=
"show_addparam('$p_code','$plugin_code','$dossier','$tab');\"");
-		return;
-	}
-	$n_max=3Dsizeof($a_code);
-	echo "<table class=3D\"result\">";
-	echo "<tr>";
-	echo th("Code TVA");
-	echo th("Label");
-	echo th("Description");
-	echo th("Taux");
-	echo th("utilisant le poste comptable");
-	echo "</tr>";
-	for ($i=3D0;$i<$n_max;$i++)
-	{
-		echo "<tr>";
-		echo td($a_code[$i]['tva_id']);
-		echo td($a_code[$i]['tva_label']);
-		echo td($a_code[$i]['tva_comment']);
-		echo td($a_code[$i]['tva_rate']);
-		echo td("Poste comptable :".$a_code[$i]['pcm_val']);
-		echo '<td>';
-		echo '<form id=3D"f'.$a_code[$i]['pi_id'].'" method=3D"POST">';
-		echo HtmlInput::hidden("pi_id",$a_code[$i]['pi_id']);
-		echo HtmlInput::hidden("tab",$tab);
-		echo HtmlInput::anchor("Effacer","","onclick=3D\"if ( confirm('Vous co=
nfirmez?')) { $('f".$a_code[$i]['pi_id']."').submit(this);} else {return =
false;}\"");
-		echo "</form>";
-		echo '</td>';
-		echo "</tr>";
-	}
-	echo "</table>";
-	echo HtmlInput::button("add_param","Ajout param=C3=A8tre","onclick=3D\"=
show_addparam('$p_code','$plugin_code','$dossier','$tab');\"");
-}
-?>
-<?
-	$tab_default=3D(isset ($_REQUEST['tab']))?$_REQUEST['tab']:'opout';
-?>
-<a href=3D"javascript:void(0)" class=3D"line" onclick=3D"tva_show_param(=
'opout')">Op=C3=A9ration =C3=A0 la sortie</a>&nbsp;
-<a href=3D"javascript:void(0)" class=3D"line" style=3D"" onclick=3D"tva_=
show_param('opin')">Op=C3=A9ration =C3=A0 l'entr=C3=A9e </a>&nbsp;
-<a href=3D"javascript:void(0)" class=3D"line" onclick=3D"tva_show_param(=
'tvadue')">TVA Due</a>&nbsp;
-<a href=3D"javascript:void(0)" class=3D"line" onclick=3D"tva_show_param(=
'tvaded')">TVA D=C3=A9ductible</a>&nbsp;
-<a href=3D"javascript:void(0)" class=3D"line" onclick=3D"tva_show_param(=
'lintra')">Listing Client Intracomm.</a>&nbsp;
-<a href=3D"javascript:void(0)" class=3D"line" onclick=3D"tva_show_param(=
'assujetti')">Listing Client assujetti.</a>&nbsp;
-<a href=3D"javascript:void(0)" class=3D"line" onclick=3D"tva_show_param(=
'divers')">Divers</a>
-<form method=3D"POST">
-	<?
-	echo HtmlInput::hidden('tab',$tab_default);
-	echo HtmlInput::request_to_hidden(array('gDossier','ac','plugin_code','=
sa'));
-	?>
-<div style=3D"display:none" id=3D"opout">
-<h1><?=3D_("Op=C3=A9ration =C3=A0 la sortie");?></h1>
-<? $tab=3D"opout";?>
-<?=3Dshow("GRIL00",_("Grille 00 : op=C3=A9rations soumises =C3=A0 un r=C3=
=A9gime particulier"))?>
-<?=3Dshow("GRIL01",_("Grille 01 : Op=C3=A9rations pour lesquelles la TVA=
 est due (6%)"))?>
-<?=3Dshow("GRIL02",_("Grille 02 : Op=C3=A9rations pour lesquelles la TVA=
 est due (12%)"))?>
-<?=3Dshow("GRIL03",_("Grille 03 : Op=C3=A9rations pour lesquelles la TVA=
 est due (21%)"))?>
-<?=3Dshow("GRIL44",_("Grille 44 : Op=C3=A9rations pour lesquelles la TVA=
 =C3=A9trang=C3=A8re est due par le cocontractant"))?>
-<?=3Dshow("GRIL45",_("Grille 45 : Op=C3=A9rations pour lesquelles la TVA=
 est due par le cocontractant"))?>
-<?=3Dshow("GRIL46",_("Grille 46 : Livraisons intracommunautaires exempt=C3=
=A9es effectu=C3=A9es en Belgique et ventes ABC"))?>
-<?=3Dshow("GRIL47",_("Grille 47 :Autres op=C3=A9rations exempt=C3=A9es e=
t autres op=C3=A9rations effectu=C3=A9es =C3=A0 l=E2=80=99=C3=A9tranger")=
)?>
-<?=3Dshow("GRIL48",_("Grille 48 : Op=C3=A9rations relatives aux notes de=
 cr=C3=A9dit des grilles 44 et 48"))?>
-<?=3Dshow("GRIL49",_("Grille 49 : Op=C3=A9rations relatives aux notes de=
 cr=C3=A9dit"))?>
-</div>
-<div style=3D"display:none" id=3D"opin">
-	<? $tab=3D"opin";?>
-<h1><?=3D_("Op=C3=A9ration =C3=A0 l'entr=C3=A9e");?></h1>
-<?=3Dshow("GRIL81",_("Grille 81 : Op=C3=A9ration sur les marchandises, m=
ati=C3=A8res premi=C3=A8res..."))?>
-<?=3Dshow("GRIL82",_("Grille 82 : Op=C3=A9ration sur les services et bie=
ns divers"))?>
-<?=3Dshow("GRIL83",_("Grille 83 : Op=C3=A9ration sur les biens d'investi=
ssements"))?>
-<?=3Dshow("GRIL84",_("Grille 84 : Montant des notes de cr=C3=A9dit re=C3=
=A7ues et des corrections n=C3=A9gatives relatif aux op=C3=A9rations insc=
rites en grilles 86 et 88"))?>
-<?=3Dshow("GRIL85",_("Grille 85 : Montant des notes de cr=C3=A9dit re=C3=
=A7ues et des corrections n=C3=A9gatives relatif aux autres op=C3=A9ratio=
ns du cadre III  "))?>
-<?=3Dshow("GRIL86",_("Grille 86 : Acquisitions intracommunautaires effec=
tu=C3=A9es en Belgique et ventes ABC  "))?>
-<?=3Dshow("GRIL87",_(" Autres op=C3=A9rations =C3=A0 l'entr=C3=A9e pour =
lesquelles la T.V.A. est due par le d=C3=A9clarant "))?>
-<?=3Dshow("GRIL88",_("Services intracommunautaires avec report de percep=
tion"))?>
-</div>
-<div style=3D"display:none" id=3D"tvadue">
-<? $tab=3D"tvadue";?>
-<h1><?=3D_("TVA Due");?></h1>
-<?=3Dshow("GRIL54",_("Grille 54 : tva due sur op=C3=A9ration grille 01,0=
2 et 03"))?>
-<?=3Dshow("GRIL55",_("Grille 55 : tva due sur op=C3=A9ration grille 86 e=
t 88"))?>
-<?=3Dshow("GRIL56",_("Grille 56 : tva due sur op=C3=A9ration grille 87")=
)?>
-<?=3Dshow("GRIL57",_("Grille 57 :T.V.A. relative aux importations avec r=
eport de perception "))?>
-<?=3Dshow("GRIL61",_("Grille 61 :Diverses r=C3=A9gularisations T.V.A. en=
 faveur de l'Etat"))?>
-<?=3Dshow("GRIL63",_("Grille 63 :T.V.A. =C3=A0 reverser mentionn=C3=A9e =
sur les notes de cr=C3=A9dit re=C3=A7ues"))?>
-</div>
-<div style=3D"display:none" id=3D"tvaded">
-	<? $tab=3D"tvaded";?>
-<h1> <?=3D_("TVA D=C3=A9ductible");?></h1>
-<?=3Dshow("GRIL59",_("Grille 59 : taxe d=C3=A9ductible"))?>
-<?=3Dshow("GRIL62",_("Grille 62 : Diverses r=C3=A9gularisations T.V.A. e=
n faveur du d=C3=A9clarant"))?>
-<?=3Dshow("GRIL64",_("Grille 56 : T.V.A. =C3=A0 r=C3=A9cup=C3=A9rer ment=
ionn=C3=A9e sur les notes de cr=C3=A9dit d=C3=A9livr=C3=A9es "))?>
-</div>
-<div style=3D"display:none" id=3D"divers">
-	<? $tab=3D"divers";?>
-<fieldset>
-<legend><?=3D_('Divers')?></legend>
-
-
-<TABLE class=3D"result">
-<TR>
-	<TH><?=3D_('Poste comptable')?></TH>
-	<TH><?=3D_('Description')?></TH>
-	<th></th>
-</TR>
-<TR>
-
-	<TD>
-	<?
-	$atva=3D$cn->get_value("select pcm_val from tva_belge.parameter_chld wh=
ere pcode=3D'ATVA'");
-	$ip_tva=3Dnew IPoste('ATVA',$atva);
-	$ip_tva->set_attribute('gDossier',Dossier::id());
-	$ip_tva->set_attribute('jrn',0);
-	$ip_tva->set_attribute('account','ATVA');
-	$ip_tva->set_attribute('label','ATVA_label');
-	echo $ip_tva->input();
-	$lib=3D$cn->get_value("select pcm_lib from tmp_pcmn where pcm_val=3D$1"=
,array($atva));
-	?>
-	</TD>
-	<TD>
-		<SPAN ID=3D"ATVA_label"><?=3Dh($lib)?></SPAN>
-	</td>
-	<?=3Dtd(_("Poste comptable utilis=C3=A9 pour les avances faites =C3=A0 =
la TVA"))?>
-</tr>
-<TR>
-	<TD>
-	<?
-	$crtva=3D$cn->get_value("select pcm_val from tva_belge.parameter_chld w=
here pcode=3D'CRTVA'");
-	$ip_tva=3Dnew IPoste('CRTVA',$crtva);
-	$ip_tva->set_attribute('gDossier',Dossier::id());
-	$ip_tva->set_attribute('jrn',0);
-	$ip_tva->set_attribute('account','CRTVA');
-	$ip_tva->set_attribute('label','CRTVA_label');
-	echo $ip_tva->input();
-	$lib=3D$cn->get_value("select pcm_lib from tmp_pcmn where pcm_val=3D$1"=
,array($crtva));
-	?>
-	</TD>
-	<TD>
-		<SPAN ID=3D"CRTVA_label"><?=3Dh($lib)?></SPAN>
-	</td>
-<?=3Dtd(("Poste comptable utilis=C3=A9 pour les cr=C3=A9ances sur la  TV=
A"))?>
-</tr>
-<TR>
-<TD>
-	<?
-	$dttva=3D$cn->get_value("select pcm_val from tva_belge.parameter_chld w=
here pcode=3D'DTTVA'");
-	$ip_tva=3Dnew IPoste('DTTVA',$dttva);
-	$ip_tva->set_attribute('gDossier',Dossier::id());
-	$ip_tva->set_attribute('jrn',0);
-	$ip_tva->set_attribute('account','DTTVA');
-	$ip_tva->set_attribute('label','DTTVA_label');
-	echo $ip_tva->input();
-	$lib=3D$cn->get_value("select pcm_lib from tmp_pcmn where pcm_val=3D$1"=
,array($dttva));
-	?>
-	</TD>
-	<TD>
-		<SPAN ID=3D"DTTVA_label"><?=3Dh($lib)?></SPAN>
-	</td>
-	<?=3Dtd(_("Poste comptable utilis=C3=A9 pour les dettes envers la TVA")=
)?>
-</tr>
-
-</TABLE>
-	<?=3DHtmlInput::submit("save_misc","Sauver")?>
-</fieldset>
-</div>
-<div style=3D"display:none" id=3D"lintra">
-	<? $tab=3D"lintra";?>
-<fieldset><legend>Listing intracommunautaires</legend>
-<?=3Dshow("CLINTRA",_("Code TVA pour clients  Intracommunataire"))?>
-</fieldset>
-</div>
-	<div style=3D"display:none" id=3D"assujetti">
-	<? $tab=3D"assujetti";?>
-<fieldset><legend>Listing Client nationaux</legend>
-<?=3Dshow("ASSUJETTI",_("Code TVA pour clients  nationaux"))?>
-</fieldset>
-</div>
-	</form>
-<script charset=3D"UTF-8" lang=3D"javascript">
-	tva_show_param('<?=3D$tab_default?>');
-	</script>

Deleted: tag/rel652/rapport_avance/form_periode.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/form_periode.php	2012-12-27 00:27:39 UTC (r=
ev 455)
+++ tag/rel652/rapport_avance/form_periode.php	2012-12-27 01:26:31 UTC (r=
ev 456)
@@ -1,21 +0,0 @@
-<fieldset>
-<legend>
-   <?=3D_('Entrez la p=C3=A9riode de la d=C3=A9claration')?>
-</legend>
-<form class=3D"print" method=3D"GET">
-<?=3D_('Ann=C3=A9e')?> <?=3D$str_year?><br/>
-<?=3D$str_monthly?>   <?=3D_('Mois')?> : <?=3D$str_month?><br/>
-<?=3D$str_quaterly?>   <?=3D_('Trimestre')?> : <?=3D$str_quater?><br/>
-<?=3D$str_hidden?>
-<?php
-if (isset ($by_year) && $by_year =3D=3D true ) :
-?>
-<?=3D_('Par ann=C3=A9e')?> <?=3D$str_byyear?><br/>
-<?php
-echo HtmlInput::request_to_hidden(array('ac'));
-endif;
-?>
-<br>
-<?=3D$str_submit?>
-</form>
-</fieldset>
\ No newline at end of file

Deleted: tag/rel652/rapport_avance/js_scripts.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/js_scripts.js	2012-12-27 00:27:39 UTC (rev =
455)
+++ tag/rel652/rapport_avance/js_scripts.js	2012-12-27 01:26:31 UTC (rev =
456)
@@ -1,164 +0,0 @@
-function show_declaration(p_type,p_id) {
-    try {
-	$('detail').innerHTML=3D'<image src=3D"image/loading.gif" border=3D"0" =
alt=3D"Chargement...">';
-	$('detail').show();
-	$('main').hide();
-	var gDossier=3D$('gDossier').value;var code=3D$('plugin_code').value;
-	var queryString=3D'act=3Ddsp_decl&gDossier=3D'+gDossier+'&plugin_code=3D=
'+code;
-	queryString+=3D'&type=3D'+p_type+'&id=3D'+p_id;
-	var action=3Dnew Ajax.Request ( 'ajax.php',
-				  {
-				 method:'get',
-				 parameters:queryString,
-				 onFailure:error_show_declaration,
-				 onSuccess:success_show_declaration
-			       }
-			       );
-    } catch(e) {alert('show_declaration '+e.message);}
-}
-function success_show_declaration(answer) {
-    try {
-	var xml=3Danswer.responseXML;
-	var html=3Dxml.getElementsByTagName('code');
-	if ( html.length =3D=3D 0 ) {var rec=3Danswer.responseText;alert ('erre=
ur :'+rec);}
-	var code_html=3DgetNodeText(html[0]);
-	code_html=3Dunescape_xml(code_html);
-	$('detail').innerHTML=3Dcode_html;
-	code_html.evalScripts();
-
-    } catch(e) {alert('success_show_declaration '+e.message);}
-}
-function error_show_declaration() {
-    alert('error_show_declaration : ajax not supported');
-}
-function record_writing(plugin,dossier,p_id) {
-    // call ajax to fill with form
-    query=3D'gDossier=3D'+dossier+'&plugin_code=3D'+plugin+'&act=3Drw&p_=
id=3D'+p_id;
-
-    // add a section
-    show_box({id:'record_write',html:loading(),cssclass:'inner_box',styl=
e:'position:absolute;top:0;left:0%;margin-top:10%;height:80%;margin-left:=
10%;width:80%;',js_error:null,js_success:success_record_writing,qs:query,=
fixed:1,callback:'ajax.php'});
-}
-function remove_form(plugin,dossier,p_id,type) {
-    // call ajax to fill with form
-    query=3D'gDossier=3D'+dossier+'&plugin_code=3D'+plugin+'&act=3Drm_fo=
rm&p_id=3D'+p_id+"&type=3D"+type;
-
-    // add a section
-    show_box({id:'remove_form',html:loading(),cssclass:'inner_box',style=
:'position:absolute;top:0;left:20%;margin-top:10%;',js_error:null,js_succ=
ess:success_box,qs:query,callback:'ajax.php'});
-}
-
-function success_record_writing(req) {
-    try{
-	var answer=3Dreq.responseXML;
-	var a=3Danswer.getElementsByTagName('ctl');
-	var html=3Danswer.getElementsByTagName('code');
-	if ( a.length =3D=3D 0 ) {var rec=3Dreq.responseText;alert ('erreur :'+=
rec);}
-	var name_ctl=3Da[0].firstChild.nodeValue;
-	var code_html=3DgetNodeText(html[0]);
-
-	code_html=3Dunescape_xml(code_html);
-	g(name_ctl).innerHTML=3Dcode_html;
-    }
-    catch (e) {
-	alert("success_box"+e.message);}
-    try{
-	code_html.evalScripts();}
-    catch(e){
-	alert("answer_box Impossible executer script de la reponse\n"+e.message=
);}
-}
-function save_write(obj) {
-    var query=3D"act=3Dsw&"+$(obj).serialize();
-    var action=3Dnew Ajax.Request ( 'ajax.php',
-				  {
-				      method:'get',
-				      parameters:query,
-				      onFailure:null,
-				      onSuccess:success_save_write
-				  });
-    return false;
-}
-function success_save_write(req){
-
-    try{
-	var answer=3Dreq.responseXML;
-	var a=3Danswer.getElementsByTagName('ctl');
-	var html=3Danswer.getElementsByTagName('code');
-	if ( a.length =3D=3D 0 ) {var rec=3Dreq.responseText;alert ('erreur :'+=
rec);}
-	var name_ctl=3Da[0].firstChild.nodeValue;
-	var code_html=3DgetNodeText(html[0]);
-
-	code_html=3Dunescape_xml(code_html);
-	g(name_ctl).innerHTML=3Dcode_html;
-    }
-    catch (e) {
-	alert("success_box"+e.message);}
-    try{
-	code_html.evalScripts();}
-    catch(e){
-	alert("answer_box Impossible executer script de la reponse\n"+e.message=
);}
-}
-function show_addparam(pcode,plugin_code,dossier,tab)
-{
-	try {
-		waiting_box();
-		 var action=3Dnew Ajax.Request ( 'ajax.php',
-				  {
-				      method:'get',
-				      parameters:"act=3Dadd_param&pcode=3D"+pcode+"&gDossier=3D"+dos=
sier+"&plugin_code=3D"+plugin_code+'&tab=3D'+tab,
-				      onFailure:null,
-				      onSuccess:success_showaddparam
-				  });
-	}catch (e){
-		alert(e.message);
-	}
-}
-
-function success_showaddparam(req) {
-  try{
-		remove_waiting_box();
-		var sx=3D0;
-		if ( window.scrollY)
-		{
-			sx=3Dwindow.scrollY+120;
-		}
-		else
-		{
-			sx=3Ddocument.body.scrollTop+120;
-		}
-
-		var div_style=3D"top:"+sx+";width:60%;heigth:80%";
-		removeDiv("paramadd_id");
-		add_div({
-			"id":'paramadd_id',
-			"drag":"1",
-			"cssclass":"inner_box",
-			"style":div_style
-		});
-		var answer=3Dreq.responseXML;
-		var html=3Danswer.getElementsByTagName('code');
-		var code_html=3DgetNodeText(html[0]);
-		code_html=3Dunescape_xml(code_html);
-		g("paramadd_id").innerHTML=3Dcode_html;
-	}
-	catch (e) {
-		alert("success_box "+e.message);
-	}
-	try{
-		code_html.evalScripts();
-	}
-	catch(e){
-		alert("answer_box Impossible executer script de la reponse\n"+e.messag=
e);
-	}
-}
-
-function tva_show_param(p_div)
-{
-	try{
-		var div=3D['opin','opout','tvadue','tvaded','divers','lintra','assujet=
ti'];
-		for (var r =3D0;r<div.length;r++ ) {$(div[r]).hide();  }
-		$(p_div).show();
-		$('tab').value=3Dp_div;
-	} catch(e)
-	{
-		alert(e.message)
-	}
-}
\ No newline at end of file

Deleted: tag/rel652/rapport_avance/list_assujetti.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/list_assujetti.inc.php	2012-12-27 00:27:39 =
UTC (rev 455)
+++ tag/rel652/rapport_avance/list_assujetti.inc.php	2012-12-27 01:26:31 =
UTC (rev 456)
@@ -1,99 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published b=
y
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-130=
7  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-
-/*!\file
- * \brief listing intracom
- */
-echo '<div class=3D"content" style=3D"width:80%;margin-left:10%">';
-require_once('class_ext_list_assujetti.php');
-// verify the year
-if ( isset($_REQUEST['year']) && (trim(strlen($_REQUEST['year'])) < 4 ||=
 isNumber($_REQUEST['year'] ) =3D=3D 0 ||$_REQUEST['year'] < 2000||$_REQU=
EST['year']>2100)) {
-  alert(j(_('Ann=C3=A9e invalide'.' ['.$_REQUEST['year'].']')));
-  echo Ext_List_Assujetti::choose_periode();
-  echo '</div>';
-  exit;
-}
-
-// if the periode is not set we have to ask it
-if ( ! isset($_REQUEST['decl']) ){
-  echo Ext_List_Assujetti::choose_periode(true);
-  echo '</div>';
-  exit;
-}
-
-$cn=3Dnew Database(Dossier::id());
-if (isset($_POST['save'] )) {
-  $save=3Dnew Ext_List_Assujetti($cn);
-  $save->from_array($_POST);
-  $save->insert();
-  echo h2info(_('D=C3=A9claration sauv=C3=A9e'));
-  echo $save->display();
-
-  /**
-   *@todo add a div for the button generate, get_xml, create ODS, print.=
..
-   */
-//   echo '<div style=3D"position:absolute;z-index:14;top:25%;right:30" =
class=3D"noprint">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</d=
iv>';
-  echo '</div>';
-  exit;
-}
-
-$tva=3Dnew Ext_List_Assujetti($cn);
-
-$str_quaterly=3D'';
-$str_month=3D"";
-$str_year=3D$_GET['year'];
-$str_byyear=3D'1';
-$str_quater=3D'';
-$str_hidden=3D'';$str_submit=3D'';$str_monthly=3D'';
-$by_year=3Dtrue;
-$tva->blank($_REQUEST['year'],1,3);
-
-
-// xdebug_disable();
-try {
-  $r=3D$tva->compute();
-} catch (Exception $e) {
-
-  echo Ext_List_Assujetti::choose_periode();
-  echo '</div>';
-  exit();
-  }
-require_once('form_periode.php');
-echo '<form class=3D"print" method=3D"post">';
-echo dossier::hidden();
-echo HtmlInput::extension();
-echo HtmlInput::hidden('start_periode',$tva->start_periode);
-echo HtmlInput::hidden('end_periode',$tva->end_periode);
-echo HtmlInput::hidden('flag_periode',$tva->flag_periode);
-echo HtmlInput::hidden('name',$tva->tva_name);
-echo HtmlInput::hidden('num_tva',$tva->num_tva);
-echo HtmlInput::hidden('adress',$tva->adress);
-echo HtmlInput::hidden('country',$tva->country);
-echo HtmlInput::hidden('periode_dec',$tva->periode_dec);
-echo HtmlInput::hidden('exercice',$tva->exercice);
-echo $tva->display_info();
-echo $r;
-echo $tva->display_declaration_amount();
-echo HtmlInput::submit('save',_('Sauvegarde'));
-echo '</form>';
-echo '</div>';
-

Deleted: tag/rel652/rapport_avance/list_intra.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/list_intra.inc.php	2012-12-27 00:27:39 UTC =
(rev 455)
+++ tag/rel652/rapport_avance/list_intra.inc.php	2012-12-27 01:26:31 UTC =
(rev 456)
@@ -1,119 +0,0 @@
- <?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published b=
y
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-130=
7  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-
-/*!\file
- * \brief listing intracom
- */
-require_once('class_ext_list_intra.php');
-echo '<div class=3D"content" style=3D"width:80%;margin-left:10%">';
-
-// verify the year
-if ( isset($_REQUEST['year']) && (trim(strlen($_REQUEST['year'])) < 4 ||=
 isNumber($_REQUEST['year'] ) =3D=3D 0 ||$_REQUEST['year'] < 2000||$_REQU=
EST['year']>2100)) {
-  alert(j(_('Ann=C3=A9e invalide'.' ['.$_REQUEST['year'].']')));
-  echo Ext_List_Intra::choose_periode();
-  echo '</div>';
-  exit;
-}
-
-// if the periode is not set we have to ask it
-if ( ! isset($_REQUEST['decl']) ){
-  echo Ext_List_Intra::choose_periode(true);
-  echo '</div>';
-  exit;
-}
-
-$cn=3Dnew Database(Dossier::id());
-if (isset($_POST['save'] )) {
-  $save=3Dnew Ext_List_Intra($cn);
-  $save->from_array($_POST);
-  $save->insert();
-  echo h2info(_('D=C3=A9claration sauv=C3=A9e'));
-  echo $save->display();
-
-  /**
-   *@todo add a div for the button generate, get_xml, create ODS, print.=
..
-   */
-//   echo '<div style=3D"position:absolute;z-index:14;top:25%;right:30" =
class=3D"noprint">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</d=
iv>';
-  echo '</div>';
-  exit;
-}
-
-$tva=3Dnew Ext_List_Intra($cn);
-
-/* by month */
-if ( $_REQUEST['periodic']=3D=3D1) {
-  $str_monthly=3D'';
-  $str_month=3D$_GET['bymonth'];$str_year=3D$_GET['year'];$str_quaterly=3D=
"";$str_hidden=3D'';$str_submit=3D'';$str_quater=3D'-';
-  $tva->blank($_REQUEST['year'],$_GET['bymonth'],1);
-
-}
-
-/* by quater */
-if ($_REQUEST['periodic'] =3D=3D 2) {
-  $str_quaterly=3D'';
-  $str_month=3D"-";
-  $str_year=3D$_GET['year'];
-  $str_quater=3D$_REQUEST['byquaterly'];
-  $str_hidden=3D'';$str_submit=3D'';$str_monthly=3D'';
-  $tva->blank($_REQUEST['year'],$_GET['byquaterly'],2);
-}
-/* by year */
-if ($_REQUEST['periodic'] =3D=3D 3) {
-  $str_quaterly=3D'';
-  $str_month=3D"";
-  $str_year=3D$_GET['year'];
-  $str_byyear=3D'1';
-  $str_quater=3D'';
-  $str_hidden=3D'';$str_submit=3D'';$str_monthly=3D'';
-  $by_year=3Dtrue;
-  $tva->blank($_REQUEST['year'],$_GET['byquaterly'],3);
-}
-
-try {
-  $r=3D$tva->compute();
-} catch (Exception $e) {
-
-  echo Ext_List_Intra::choose_periode();
-  echo '</div>';
-  exit();
-  }
-
-require_once('form_periode.php');
-
-echo '<form class=3D"print" method=3D"post">';
-echo dossier::hidden();
-echo HtmlInput::extension();
-echo HtmlInput::hidden('start_periode',$tva->start_periode);
-echo HtmlInput::hidden('end_periode',$tva->end_periode);
-echo HtmlInput::hidden('flag_periode',$tva->flag_periode);
-echo HtmlInput::hidden('name',$tva->tva_name);
-echo HtmlInput::hidden('num_tva',$tva->num_tva);
-echo HtmlInput::hidden('adress',$tva->adress);
-echo HtmlInput::hidden('country',$tva->country);
-echo HtmlInput::hidden('periode_dec',$tva->periode_dec);
-echo HtmlInput::hidden('exercice',$tva->exercice);
-echo $tva->display_info();
-echo $r;
-echo $tva->display_declaration_amount();
-echo HtmlInput::submit('save',_('Sauvegarde'));
-echo '</form>';
-echo '</div>';

Deleted: tag/rel652/rapport_avance/list_tva.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/list_tva.inc.php	2012-12-27 00:27:39 UTC (r=
ev 455)
+++ tag/rel652/rapport_avance/list_tva.inc.php	2012-12-27 01:26:31 UTC (r=
ev 456)
@@ -1,143 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published b=
y
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-130=
7  USA
- */
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-require_once('class_iselect.php');
-require_once 'class_sort_table.php';
-
-echo '<div id=3D"detail" style=3D"display:none; width:80%;margin-left:10=
%">';
-echo '<image src=3D"image/loading.gif" border=3D"0" alt=3D"Chargement...=
">';
-echo '</div>';
-/* !\file
- * \brief show all the declaration by date
- */
-
-echo '<div id=3D"main" class=3D"content" style=3D"width:80%;margin-left:=
10%">';
-echo '<form method=3D"get">';
-echo HtmlInput::request_to_hidden(array('ac'));
-echo _('Filtrer par ');
-$choice =3D new ISelect('type');
-$choice->value =3D array(
-	array('label' =3D> 'Toutes', 'value' =3D> 0),
-	array('label' =3D> 'D=C3=A9clarations', 'value' =3D> 1),
-	array('label' =3D> 'Listings assujetti', 'value' =3D> 2),
-	array('label' =3D> 'Listings intracom', 'value' =3D> 3)
-);
-$choice->selected =3D (isset($_REQUEST['type'])) ? $_REQUEST['type'] : 0=
;
-$choice->javascript =3D ' onchange=3D"submit(this)"';
-echo HtmlInput::extension();
-echo HtmlInput::hidden('sa', 'ltva');
-echo dossier::hidden();
-echo $choice->input();
-echo HtmlInput::submit('rc', 'Recharger');
-echo '</form>';
-
-$url =3D HtmlInput::request_to_string(array('ac', 'plugin_code', 'gDossi=
er', 'sa', 'type'));
-$sort=3D new Sort_Table();
-$sort->add('Date d=C3=A9claration	', $url, ' order by date_decl asc', ' =
order by date_decl desc', 'da', 'dd');
-$sort->add('P=C3=A9riode	', $url, ' order by exercice asc,periode_dec as=
c', ' order by exercice desc,periode_dec desc', 'pa', 'pd');
-
-$option_order =3D (isset($_GET['ord'])) ? $_GET['ord'] : 'dd';
-
-$sql_order =3D $sort->get_sql_order($option_order);
-
-switch ($choice->selected)
-{
-	case 0:
-		$sql =3D "
-select da_id as id, 'D=C3=A9claration trim/mens' as type_title,1 as type=
_decl,to_char(date_decl,'DD.MM.YYYY') as date_fmt,date_decl,
-case when periodicity =3D'1' then 'Mensuel'
-when periodicity =3D '2' then 'Trimestriel'
-end as fmt_periodicity,
-periode_dec,exercice
-from tva_belge.declaration_amount
-union all
-select i_id as id, 'Listing Intracom' as type_title, 3 as type_decl, to_=
char(date_decl,'DD.MM.YYYY') as date_fmt,date_decl,
-case when periodicity =3D'1' then 'Mensuel'
-when periodicity =3D '2' then 'Trimestriel'
-when periodicity =3D '3' then 'Annuel'
-end as fmt_periodicity,
-periode_dec,exercice
-from tva_belge.intracomm
-union all
-select a_id as id, 'Listing assujetti' as type_title, 2 as type_decl, to=
_char(date_decl,'DD.MM.YYYY') as date_fmt,date_decl,
- 'Annuel' as fmt_periodicity,
-periode_dec,exercice
-from tva_belge.assujetti
-";
-
-		break;
-
-	case 1:
-
-		$sql =3D "
-select da_id as id, 'D=C3=A9claration trim/mens' as type_title,1 as type=
_decl,to_char(date_decl,'DD.MM.YYYY') as date_fmt,
-case when periodicity =3D'1' then 'Mensuel'
-when periodicity =3D '2' then 'Trimestriel'
-end as fmt_periodicity,
-periode_dec,exercice
-from tva_belge.declaration_amount=20
-";
-		break;
-	case 2:
-		$sql =3D "
-select a_id as id, 'Listing assujetti' as type_title, 2 as type_decl, to=
_char(date_decl,'DD.MM.YYYY') as date_fmt,date_decl,
- 'Annuel' as fmt_periodicity,
-periode_dec,exercice
-from tva_belge.assujetti
-";
-		break;
-	case 3:
-		$sql =3D "
-select i_id as id, 'Listing Intracom' as type_title, 3 as type_decl, to_=
char(date_decl,'DD.MM.YYYY') as date_fmt,date_decl,
-case when periodicity =3D'1' then 'Mensuel'
-when periodicity =3D '2' then 'Trimestriel'
-when periodicity =3D '3' then 'Annuel'
-end as fmt_periodicity,
-periode_dec,exercice
-from tva_belge.intracomm
-";
-		break;
-}
-$sql =3D $sql . $sql_order;
-$res =3D $cn->get_array($sql);
-?>
-<table class=3D"result" >
-	<tr>
-		<th>Type de d=C3=A9claration</th>
-		<th>Periodicit=C3=A9</th>
-		<th> <?=3D$sort->get_header(1)?></th>
-		<th><?=3D$sort->get_header(0)?></th>
-
-		<? for ($i =3D 0; $i < count($res); $i++):?>
-		<tr>
-			<?
-			$aref =3D sprintf('<a href=3D"javascript:void(0)" onclick=3D"show_dec=
laration(\'%s\',\'%s\')">', $res[$i]['type_decl'], $res[$i]['id']);
-			echo td($aref . $res[$i]['type_title'] . '</a>');
-			echo td($aref . $res[$i]['fmt_periodicity'] . '</a>');
-			echo td($aref.$res[$i]['periode_dec'].' - '.$res[$i]['exercice'].'</a=
>');
-			echo td($aref.$res[$i]['date_fmt'].'</a>');
-			?>
-		</tr>
-	<? endfor;?>
-</table>
-</div>
-
-

Deleted: tag/rel652/rapport_avance/tva_constant.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/tva_constant.php	2012-12-27 00:27:39 UTC (r=
ev 455)
+++ tag/rel652/rapport_avance/tva_constant.php	2012-12-27 01:26:31 UTC (r=
ev 456)
@@ -1,32 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published b=
y
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-130=
7  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-
-/*!\file
- * \brief
- */
-
-  $GLOBALS['quaterly_limit']=3Darray(
-				   1 =3D> array('01.01','31.03'),
-				   2 =3D> array('01.04','30.06'),
-				   3 =3D> array('01.07','30.09'),
-				   4 =3D> array('01.10','31.12')
-			);

Deleted: tag/rel652/rapport_avance/tva_param.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/tva_param.inc.php	2012-12-27 00:27:39 UTC (=
rev 455)
+++ tag/rel652/rapport_avance/tva_param.inc.php	2012-12-27 01:26:31 UTC (=
rev 456)
@@ -1,77 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published b=
y
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-130=
7  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-
-/*!\file
- * \brief set up the parameters
- */
-require_once('class_tva_parameter.php');
-$cn=3Dnew Database(dossier::id());
-
-// save all the parameters
-if ( isset ($_POST['save_misc']))  {
-	extract($_POST);
-
-	foreach ( array('CRTVA','ATVA','DTTVA') as $i){
-		$value=3D${$i};
-		if ( trim(${$i})=3D=3D'') $value=3Dnull;
-		if ( $cn->get_value("select count(*) from tva_belge.parameter_chld whe=
re pcode=3D$1",array($i))=3D=3D0)
-		{
-			$cn->exec_sql("insert into tva_belge.parameter_chld(pcode,pcm_val) va=
lues($1,$2) ",
-					array($i,$value));
-		}else {
-
-		$cn->exec_sql("update tva_belge.parameter_chld set pcm_val=3D$1::accou=
nt_type where pcode=3D$2",
-				array($value,$i));
-		}
-	}
-
-	unset($_POST['save_misc']);
-}
-
-if ( isset ($_POST['save_addparam'])){
-	extract ($_POST);
-	try {
-		if ( trim($tva_id)=3D=3D"")			throw new Exception("TVA n'existe pas");
-		if ( trim($paccount)=3D=3D"")			throw new Exception("Poste comptable v=
ide");
-		if ( $cn->get_value("select count(tva_id) from tva_rate where tva_id=3D=
$1",array($tva_id))=3D=3D0) throw new Exception("TVA $tva_id n'existe pas=
");
-		$cn->exec_sql("insert into tva_belge.parameter_chld(pcode,tva_id,pcm_v=
al) values ($1,$2,$3::account_type)",
-		array($pcode,$tva_id,$paccount));
-	} catch(Exception $e) {
-		alert("Ne peut sauver : ".$e->getMessage());
-	}
-}
-if ( isset ($_POST['pi_id'])){
-	$cn->exec_sql("delete from tva_belge.parameter_chld where pi_id=3D$1",a=
rray($_POST['pi_id']));
-}
-/* show all the possible parameters */
-$tvap=3Dnew Tva_Parameter($cn);
-require_once('class_itva_popup.php');
-$a=3Dnew IPopup('popup_tva');
-$a->set_title('Choississez la tva qui convient');
-echo $a->input();
-require_once('class_iposte.php');
-echo IPoste::ipopup('ipop_account');
-
-echo dossier::hidden();
-echo HtmlInput::extension();
-echo $tvap->display();
-



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Dec 26 20:39:09 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1To2RB-0002eG-Ok
	for mharc-phpcompta-dev@gnu.org; Wed, 26 Dec 2012 20:39:09 -0500
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 27 Dec 2012 02:30:05 +0100 (CET)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 91.121.80.190
Message-ID: <mailman.976191.1356572348.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r457 - tag/rel652/rapport_avance
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 27 Dec 2012 01:39:08 -0000

Author: danydb
Date: 2012-12-27 02:30:05 +0100 (Thu, 27 Dec 2012)
New Revision: 457

Removed:
   tag/rel652/rapport_avance/class_install_plugin.php
Log:
remove obsolete files

Deleted: tag/rel652/rapport_avance/class_install_plugin.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- tag/rel652/rapport_avance/class_install_plugin.php	2012-12-27 01:26:3=
1 UTC (rev 456)
+++ tag/rel652/rapport_avance/class_install_plugin.php	2012-12-27 01:30:0=
5 UTC (rev 457)
@@ -1,241 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published b=
y
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-130=
7  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-
-/*!\file
- * \brief this class manages the installation and the patch of the plugi=
n
- */
-
-class Install_Plugin
-{
-
-  function __construct($p_cn) {
-    $this->cn=3D$p_cn;
-  }
-
-  /**
-   *@brief install the plugin, create all the needed schema, tables, pro=
c
-   * in the database
-   *@param $p_dossier is the dossier id
-   */
-  function install() {
-    $this->cn->start();
-    // create the schema
-    $this->create_schema();
-    // create table + put default values
-    $this->create_table_parameter();
-    $this->create_table_declaration_amount();
-    $this->create_table_intra();
-    $this->create_table_intra_child();
-    $this->create_table_assujetti();
-    $this->create_table_assujetti_child();
-
-    $this->cn->commit();
-  }
-  function create_schema() {
-    $this->cn->exec_sql('create schema tva_belge');
-  }
-  function create_table_assujetti() {
-    $sql=3D"
-CREATE TABLE tva_belge.assujetti
-(
-  a_id serial NOT NULL,
-  start_date date NOT NULL,
-  end_date date NOT NULL,
-  xml_oid oid,
-  periodicity character(1) NOT NULL,
-  tva_name text,
-  num_tva text,
-  adress text,
-  country text,
-  date_decl date DEFAULT now(),
-  periode_dec integer,
-  CONSTRAINT assujetti_pk PRIMARY KEY (a_id)
-)
-";
-    $this->cn->exec_sql($sql);
-  }
-  function create_table_assujetti_child() {
-   $sql=3D"
-CREATE TABLE tva_belge.assujetti_chld
-(
-  ac_id serial NOT NULL,
-  a_id bigint,
-  ac_tvanum text NOT NULL,
-  ac_amount numeric(20,4) NOT NULL,
-  ac_vat numeric(20,4) NOT NULL,
-  ac_qcode text NOT NULL,
-  ac_name text NOT NULL,
-  CONSTRAINT assujetti_chld_pk PRIMARY KEY (ac_id),
-  CONSTRAINT assujetti_fk FOREIGN KEY (a_id)
-      REFERENCES tva_belge.assujetti (a_id) MATCH SIMPLE
-      ON UPDATE NO ACTION ON DELETE CASCADE
-)
-";
-    $this->cn->exec_sql($sql);
-  }
-  function create_table_intra() {
-    $sql=3D<<<EOF
-
-CREATE TABLE tva_belge.intracomm
-(
-  i_id serial NOT NULL,
-  start_date date not null,
-  end_date date not null,
-  xml_oid oid,
-  periodicity char(1) not null,
-  tva_name text,
-  num_tva text,
-  adress text,
-  country text,
-  date_decl date default now(),
-  periode_dec integer,
-  CONSTRAINT intracom_pk PRIMARY KEY (i_id)
-)
-EOF;
-    $this->cn->exec_sql($sql);
-  }
-  function create_table_intra_child() {
-$sql=3D<<<EOF
-
-CREATE TABLE tva_belge.intracomm_chld
-(
-  ic_id serial,
-  i_id bigint,
-  ic_tvanum text NOT NULL,
-  ic_amount numeric(20,4) NOT NULL,
-  ic_code character varying(1) NOT NULL,
-  ic_periode character varying(6) NOT NULL,
-  ic_qcode text not null,
-  ic_name text not null,
-  CONSTRAINT intracom_chld_pk PRIMARY KEY (ic_id),
- CONSTRAINT intracom_fk FOREIGN KEY (i_id)
-      REFERENCES tva_belge.intracomm (i_id) MATCH SIMPLE
-      ON UPDATE NO ACTION ON DELETE CASCADE
-)
-EOF;
-$this->cn->exec_sql($sql);
-  }
-  /**
-   *@brief create the table tva_belge.declaration_amount
-   */
-  function create_table_declaration_amount() {
-    $sql=3D<<<EOF
-      create table tva_belge.declaration_amount
-(
- da_id serial,
- d00 numeric(20,4) default 0.0 not null,
- d01 numeric(20,4) default 0.0 not null,
- d02 numeric(20,4) default 0.0 not null,
- d03 numeric(20,4) default 0.0 not null,
- d44 numeric(20,4) default 0.0 not null,
- d45 numeric(20,4) default 0.0 not null,
- d46 numeric(20,4) default 0.0 not null,
- d47 numeric(20,4) default 0.0 not null,
- d48 numeric(20,4) default 0.0 not null,
- d49 numeric(20,4) default 0.0 not null,
- d81 numeric(20,4) default 0.0 not null,
- d82 numeric(20,4) default 0.0 not null,
- d83 numeric(20,4) default 0.0 not null,
- d84 numeric(20,4) default 0.0 not null,
- d85 numeric(20,4) default 0.0 not null,
- d86 numeric(20,4) default 0.0 not null,
- d87 numeric(20,4) default 0.0 not null,
- d88 numeric(20,4) default 0.0 not null,
- d54 numeric(20,4) default 0.0 not null,
- d55 numeric(20,4) default 0.0 not null,
- d56 numeric(20,4) default 0.0 not null,
- d57 numeric(20,4) default 0.0 not null,
- d61 numeric(20,4) default 0.0 not null,
- d63 numeric(20,4) default 0.0 not null,
- dxx numeric(20,4) default 0.0 not null,
- d59 numeric(20,4) default 0.0 not null,
- d62 numeric(20,4) default 0.0 not null,
- d64 numeric(20,4) default 0.0 not null,
- dyy numeric(20,4) default 0.0 not null,
- d71 numeric(20,4) default 0.0 not null,
- d72 numeric(20,4) default 0.0 not null,
- d91 numeric(20,4) default 0.0 not null,
- start_date date not null,
- end_date date not null,
- xml_oid oid,
- periodicity char(1) not null,
- tva_name text,
- num_tva text,
- adress text,
- country text,
- date_decl date default now(),
- periode_dec integer,
-  CONSTRAINT declaration_amount_pkey PRIMARY KEY (da_id)
- );
-EOF;
-$this->cn->exec_sql($sql);
-
-  }
-  function create_table_parameter() {
-$sql=3D<<<EOF
-CREATE TABLE tva_belge.parameter
-(
-  pcode text NOT NULL,
-  pvalue text,
-  paccount text,
-  CONSTRAINT parameter_pkey PRIMARY KEY (pcode)
- );
-EOF;
-$this->cn->exec_sql($sql);
-// load default value
-$array=3Darray(
-	     'GRIL00'=3D>array('6',''),
-	     'GRIL01'=3D>array('3',''),
-	     'GRIL02'=3D>array('2',''),
-	     'GRIL03'=3D>array('1',''),
-	     'GRIL44'=3D>array('',''),
-	     'GRIL45'=3D>array('',''),
-	     'GRIL46'=3D>array('5','70%,71%'),
-	     'GRIL47'=3D>array('',''),
-	     'GRIL48'=3D>array('','7091'),
-	     'GRIL49'=3D>array('','7092'),
-	     'GRIL81'=3D>array('1,2,3','60%'),
-	     'GRIL82'=3D>array('1,2,3','61%'),
-	     'GRIL83'=3D>array('1,2,3','22%,23%,24%,25%'),
-	     'GRIL84'=3D>array('1,2,3,4','6091'),
-	     'GRIL85'=3D>array('',''),
-	     'GRIL86'=3D>array('5','61%,22%,23%,24%,25%,60%'),
-	     'GRIL87'=3D>array('',''),
-	     'GRIL88'=3D>array('',''),
-	     'GRIL54'=3D>array('1,2,3','7%'),
-	     'GRIL55'=3D>array('',''),
-	     'GRIL56'=3D>array('',''),
-	     'GRIL57'=3D>array('',''),
-	     'GRIL61'=3D>array('',''),
-	     'GRIL63'=3D>array('',''),
-	     'GRIL59'=3D>array('1,2,3','6%,22%,23%,24%,25%'),
-	     'GRIL62'=3D>array('',''),
-	     'GRIL64'=3D>array('',''),
-	     'ATVA'=3D>array('','4117')
-	     );
-
-foreach ($array as $code=3D>$value) {
-  $this->cn->exec_sql('insert into tva_belge.parameter(pcode,pvalue,pacc=
ount) values ($1,$2,$3)',
-		      array($code,$value[0],$value[1]));
-  }
-}
-}



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


