From MAILER-DAEMON Thu Apr 04 14:58:00 2013 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UNpMG-0000No-Du for mharc-phpcompta-dev@gnu.org; Thu, 04 Apr 2013 14:58:00 -0400 To: phpcompta-dev@nongnu.org Content-Type: text/plain; charset=UTF-8 Date: Thu, 4 Apr 2013 20:53:50 +0200 (CEST) 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: From: phpcompta-dev@nongnu.org Subject: [Phpcompta-dev] r5209 - phpcompta/tags/rel650/html X-BeenThere: phpcompta-dev@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: phpcompta-dev@nongnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2013 18:57:58 -0000 Author: danydb Date: 2013-04-04 20:53:49 +0200 (Thu, 04 Apr 2013) New Revision: 5209 Modified: phpcompta/tags/rel650/html/style.css Log: 0000807: Legend n'est pas agrandi Modified: phpcompta/tags/rel650/html/style.css =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/style.css 2013-03-29 18:50:16 UTC (rev 520= 8) +++ phpcompta/tags/rel650/html/style.css 2013-04-04 18:53:49 UTC (rev 520= 9) @@ -547,7 +547,7 @@ margin:1px; background-color: orange; } -h1.legend, .legend { +h1.legend, legend { font-weight: bold; font-style: italic; font-size: 110% ; --- PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web) Projet opensource http://www.phpcompta.eu From MAILER-DAEMON Fri Apr 05 09:33:02 2013 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UO6lK-0002Gk-Cx for mharc-phpcompta-dev@gnu.org; Fri, 05 Apr 2013 09:33:02 -0400 To: phpcompta-dev@nongnu.org Content-Type: text/plain; charset=UTF-8 Date: Fri, 5 Apr 2013 15:29:02 +0200 (CEST) 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: From: phpcompta-dev@nongnu.org Subject: [Phpcompta-dev] r479 - in trunk: . import_doli/include 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 13:33:00 -0000 Author: danydb Date: 2013-04-05 15:29:01 +0200 (Fri, 05 Apr 2013) New Revision: 479 Modified: trunk/ trunk/import_doli/include/class_impdol_operation.php trunk/rapport_avance/include/class_formulaire_param.php Log: Merged revisions 469-470,475,478 via svnmerge from=20 https://danydb@www.phpcompta.eu/svn/svn_extension/tag/rel652 ........ r469 | danydb | 2013-03-29 18:19:32 +0100 (Fri, 29 Mar 2013) | 1 line =20 Correct data ........ r470 | danydb | 2013-03-29 18:28:21 +0100 (Fri, 29 Mar 2013) | 1 line =20 Correct data ........ r475 | danydb | 2013-03-30 20:52:29 +0100 (Sat, 30 Mar 2013) | 1 line =20 Bug with negative sale ........ r478 | danydb | 2013-03-30 21:32:01 +0100 (Sat, 30 Mar 2013) | 1 line =20 Negative VAT rate ........ Property changes on: trunk ___________________________________________________________________ Name: svnmerge-integrated - /tag/rel652:1-470 + /tag/rel652:1-478 Modified: trunk/import_doli/include/class_impdol_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 --- trunk/import_doli/include/class_impdol_operation.php 2013-03-30 20:32= :01 UTC (rev 478) +++ trunk/import_doli/include/class_impdol_operation.php 2013-04-05 13:29= :01 UTC (rev 479) @@ -316,7 +316,7 @@ =20 $oper_tiers =3D new Impdol_Operation_Tmp_Sql($atiers[0]['o_id']); $nb_detail =3D count($adetail); - $sum =3D 0; + $sum =3D 0; $sum_side=3D0; $grpt =3D $cn->get_value("select nextval('s_grpt');"); $internal =3D $ledger->compute_internal_code($grpt); =20 @@ -361,6 +361,7 @@ $sql =3D "insert into quant_purchase(qp_internal,j_id,qp_fiche,qp= _quantite,qp_price,qp_vat,qp_vat_code,qp_supplier) values($1,$2,$3,$4,$5,$6,$7,$8)"; $cn->exec_sql($sql, array(null, $id, $oper->getp("fiche"), $oper-= >getp("number_unit"), $save_amount, $amount_tva, $tva_id, $oper_tiers->ge= tp("fiche"))); + $sum_side =3D ($save_amount > 0) ? bcadd($sum_side, $amount_tvac)= :$sum_side; break; case 'VEN': $cn->exec_sql("insert into quant_sold @@ -369,7 +370,7 @@ ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10)= ", array(null, /* 1 qs_internal */ $oper->getp("fiche"), /* 2 qs_fiche */ $oper->getp("number_unit"), /* 3 qs_quantite */ - $jrnx->amount, /* 4 qs_price */ + $save_amount, /* 4 qs_price */ $amount_tva, /* 5 qs_vat */ $tva_id, /* 6 qs_vat_code */ $oper_tiers->getp('fiche'), /* 7 qs_client */ @@ -378,18 +379,21 @@ 'Y' /* 10 qs_valid */ )); =20 + $sum_side =3D ($save_amount > 0) ? bcadd($sum_side, $amount_tvac)= :$sum_side; break; } /* save VAT into an array */ - if (isset($tva[$tva_id])) + $side=3D($amount_tva > 0)?1:0; + if (isset($tva[$tva_id][$side])) { - $tva[$tva_id] =3D bcadd($tva[$tva_id], $amount_tva); + $tva[$tva_id][$side] =3D bcadd($tva[$tva_id][$side], $amount_tva); } else { - $tva[$tva_id] =3D $amount_tva; + $tva[$tva_id][$side] =3D $amount_tva; } $sum =3D bcadd($sum, $amount_tvac); + } // loop e // Record the tiers =20 @@ -405,31 +409,32 @@ $jtiers->qcode =3D $oper_tiers->getp("qcode"); $jtiers->desc =3D mb_substr($oper_tiers->getp("desc"),0,80,'UTF8'); $jtiers->insert_jrnx(); - /* Record the vat 1 */ - foreach ($tva as $key =3D> $value) + foreach ($tva as $key =3D> $atva) { - $tva =3D new Acc_TVA($cn, $key); - $tva->load(); - $poste =3D $tva->get_side($oth_side); - $op_tva =3D new Acc_Operation($cn); - $op_tva->date =3D $date; - $op_tva->amount =3D $value; - $op_tva->poste =3D $poste; - $op_tva->grpt =3D $grpt; - $op_tva->type =3D $oth_side; - $op_tva->jrn =3D $jrn; - $op_tva->user =3D $_SESSION['g_user']; - $op_tva->periode =3D 0; - $op_tva->qcode =3D null; - $op_tva->desc =3D $tva->tva_label; - $op_tva->insert_jrnx(); + foreach ($atva as $tvaid=3D>$tva_value) + { + $tva =3D new Acc_TVA($cn, $key); + if ( $tva->load() =3D=3D -1 ) die ("Code TVA inconnu $tvaid"); + $poste =3D $tva->get_side($oth_side); + $op_tva =3D new Acc_Operation($cn); + $op_tva->date =3D $date; + $op_tva->amount =3D $tva_value; + $op_tva->poste =3D $poste; + $op_tva->grpt =3D $grpt; + $op_tva->type =3D $oth_side; + $op_tva->jrn =3D $jrn; + $op_tva->user =3D $_SESSION['g_user']; + $op_tva->periode =3D 0; + $op_tva->qcode =3D null; + $op_tva->desc =3D $tva->tva_label; + $op_tva->insert_jrnx(); + } } - /* record into jrn */ $acc_jrn =3D new Acc_Operation($cn); $acc_jrn->jrn =3D $jrn; - $acc_jrn->amount =3Dabs ($sum); + $acc_jrn->amount =3Dabs ($sum_side); $acc_jrn->desc =3D mb_substr($oper_tiers->getp("desc"),0,80,'UTF8'); $acc_jrn->date =3D $date; $acc_jrn->grpt =3D $grpt; 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 2013-03-30 20= :32:01 UTC (rev 478) +++ trunk/rapport_avance/include/class_formulaire_param.php 2013-04-05 13= :29:01 UTC (rev 479) @@ -107,7 +107,6 @@ // 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]; --- PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web) Projet opensource http://www.phpcompta.eu From MAILER-DAEMON Fri Apr 05 10:03:42 2013 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UO7F0-0003qH-UY for mharc-phpcompta-dev@gnu.org; Fri, 05 Apr 2013 10:03:42 -0400 To: phpcompta-dev@nongnu.org Content-Type: text/plain; charset=UTF-8 Date: Fri, 5 Apr 2013 15:59:37 +0200 (CEST) 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: From: phpcompta-dev@nongnu.org Subject: [Phpcompta-dev] r480 - trunk/import_account/include X-BeenThere: phpcompta-dev@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: phpcompta-dev@nongnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 14:03:41 -0000 Author: danydb Date: 2013-04-05 15:59:37 +0200 (Fri, 05 Apr 2013) New Revision: 480 Modified: trunk/import_account/include/class_impacc_operation.php Log: typo missing semicolon Modified: trunk/import_account/include/class_impacc_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 --- trunk/import_account/include/class_impacc_operation.php 2013-04-05 13= :29:01 UTC (rev 479) +++ trunk/import_account/include/class_impacc_operation.php 2013-04-05 13= :59:37 UTC (rev 480) @@ -383,7 +383,7 @@ break; } /* save VAT into an array */ - $side=3D($amount_tva > 0)?1:0 + $side=3D($amount_tva > 0)?1:0; if (isset($tva[$tva_id][$side])) { $tva[$tva_id][$side] =3D bcadd($tva[$tva_id][$side], $amount_tva); --- PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web) Projet opensource http://www.phpcompta.eu From MAILER-DAEMON Sun Apr 14 17:50:04 2013 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1URUoG-0006wp-Ij for mharc-phpcompta-dev@gnu.org; Sun, 14 Apr 2013 17:50:04 -0400 To: phpcompta-dev@nongnu.org Content-Type: text/plain; charset=UTF-8 Date: Sun, 14 Apr 2013 23:46:39 +0200 (CEST) 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: From: phpcompta-dev@nongnu.org Subject: [Phpcompta-dev] r5210 - 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 21:50:04 -0000 Author: danydb Date: 2013-04-14 23:46:39 +0200 (Sun, 14 Apr 2013) New Revision: 5210 Modified: phpcompta/tags/rel650/include/class_acc_ledger_purchase.php phpcompta/tags/rel650/include/class_acc_ledger_sold.php Log: 0000819: Note de d?\195?\169bit et de cr?\195?\169dit n?\195?\169gative a= vec TVA autoliquidation 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 2013-04-0= 4 18:53:49 UTC (rev 5209) +++ phpcompta/tags/rel650/include/class_acc_ledger_purchase.php 2013-04-1= 4 21:46:39 UTC (rev 5210) @@ -667,7 +667,7 @@ $acc_operation->jrn=3D$p_jrn; $acc_operation->type=3D'd'; $acc_operation->periode=3D$tperiode; - if ( $value > 0 ) $tot_debit=3Dbcadd($tot_debit,$val= ue); + $tot_debit=3Dbcadd($tot_debit,abs($value)); $acc_operation->insert_jrnx(); // if TVA is on both side, we deduce it immediately if ( $oTva->get_parameter("both_side")=3D=3D1) 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 2013-04-04 18= :53:49 UTC (rev 5209) +++ phpcompta/tags/rel650/include/class_acc_ledger_sold.php 2013-04-14 21= :46:39 UTC (rev 5210) @@ -1,4 +1,4 @@ -get_parameter("both_side")=3D=3D0) $tot_t= va=3Dround(bcadd($tva_item,$tot_tva),2); - else $n_both=3D$tva_item; + if ($oTva->get_parameter("both_side")=3D=3D0) { + $tot_tva=3Dround(bcadd($tva_item,$tot_tva),2); + }else { + $n_both=3D$tva_item; + if ( $n_both < 0 ) $tot_debit=3Dbcadd($tot_debit,abs($n_both)); + } } =20 /* Save the stock */ /* if the quantity is < 0 then the stock increase (retur= n of * material) */ - $nNeg=3D($ - {"e_quant".$i - } - <0)?-1:1; + $nNeg=3D(${"e_quant".$i}<0)?-1:1; =20 // always save quantity but in withStock we can find // what card need a stock management --- PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web) Projet opensource http://www.phpcompta.eu From MAILER-DAEMON Mon Apr 15 13:00:41 2013 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1URmll-00022n-LH for mharc-phpcompta-dev@gnu.org; Mon, 15 Apr 2013 13:00:41 -0400 To: phpcompta-dev@nongnu.org Content-Type: text/plain; charset=UTF-8 Date: Mon, 15 Apr 2013 18:57:05 +0200 (CEST) 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: From: phpcompta-dev@nongnu.org Subject: [Phpcompta-dev] r5211 - 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 17:00:40 -0000 Author: danydb Date: 2013-04-15 18:57:05 +0200 (Mon, 15 Apr 2013) New Revision: 5211 Modified: phpcompta/tags/rel650/include/class_acc_ledger_fin.php Log: Impossible de sauver dans journaux financiers dans certains cas Modified: phpcompta/tags/rel650/include/class_acc_ledger_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/class_acc_ledger_fin.php 2013-04-14 21:= 46:39 UTC (rev 5210) +++ phpcompta/tags/rel650/include/class_acc_ledger_fin.php 2013-04-15 16:= 57:05 UTC (rev 5211) @@ -444,7 +444,7 @@ =20 public function confirm($p_array, $p_nothing =3D 0) { - global $g_parameter; + global $g_parameter,$g_user; $r =3D ""; bcscale(2); extract($p_array); @@ -455,7 +455,11 @@ } else { - $pPeriode->find_periode($e_date); + if (isDate($e_date) !=3D null) { + $pPeriode->find_periode($e_date); + } else { + $pPeriode->p_id=3D$g_user->get_periode(); + } } =20 list ($l_date_start, $l_date_end) =3D $pPeriode->get_date_limit(); --- PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web) Projet opensource http://www.phpcompta.eu From MAILER-DAEMON Mon Apr 15 14:00:14 2013 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1URnhO-0004xi-JG for mharc-phpcompta-dev@gnu.org; Mon, 15 Apr 2013 14:00:14 -0400 To: phpcompta-dev@nongnu.org Content-Type: text/plain; charset=UTF-8 Date: Mon, 15 Apr 2013 19:56:50 +0200 (CEST) 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: From: phpcompta-dev@nongnu.org Subject: [Phpcompta-dev] r5212 - 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 18:00:13 -0000 Author: danydb Date: 2013-04-15 19:56:50 +0200 (Mon, 15 Apr 2013) New Revision: 5212 Modified: phpcompta/tags/rel650/include/class_acc_ledger_purchase.php Log: 0000819: Note de d?\195?\169bit et de cr?\195?\169dit n?\195?\169gative a= vec TVA autoliquidation 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 2013-04-1= 5 16:57:05 UTC (rev 5211) +++ phpcompta/tags/rel650/include/class_acc_ledger_purchase.php 2013-04-1= 5 17:56:50 UTC (rev 5212) @@ -451,7 +451,6 @@ $acc_operation->amount=3D$acc_amount->amount; $acc_operation->qcode=3D${"e_march".$i}; if( $acc_amount->amount > 0 ) $tot_debit=3Dbcadd($tot_de= bit,$acc_amount->amount); - $j_id=3D$acc_operation->insert_jrnx(); =20 /* Compute sum vat */ @@ -541,7 +540,8 @@ $acc_operation->type=3D'c'; $acc_operation->periode=3D$tperiode; $acc_operation->qcode=3D${"e_client"}; - if ( $cust_amount < 0 ) $tot_debit=3Dbcadd($tot_debit,abs($c= ust_amount)); + if ( $cust_amount < 0 ) + $tot_debit=3Dbcadd($tot_debit,abs($cust_amount)); $let_client=3D$acc_operation->insert_jrnx(); /* * Save all the no deductible @@ -667,7 +667,7 @@ $acc_operation->jrn=3D$p_jrn; $acc_operation->type=3D'd'; $acc_operation->periode=3D$tperiode; - $tot_debit=3Dbcadd($tot_debit,abs($value)); + if ( $value > 0 ) $tot_debit=3Dbcadd($tot_debit,abs(= $value)); $acc_operation->insert_jrnx(); // if TVA is on both side, we deduce it immediately if ( $oTva->get_parameter("both_side")=3D=3D1) @@ -683,6 +683,7 @@ $acc_operation->type=3D'c'; $acc_operation->periode=3D$tperiode; $acc_operation->insert_jrnx(); + if ( $value < 0 ) $tot_debit=3Dbcadd($tot_debit,abs($value)); } =20 } --- PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web) Projet opensource http://www.phpcompta.eu From MAILER-DAEMON Wed Apr 24 17:31:25 2013 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UV7Hh-0000Wn-Kh for mharc-phpcompta-dev@gnu.org; Wed, 24 Apr 2013 17:31:25 -0400 To: phpcompta-dev@nongnu.org Content-Type: text/plain; charset=UTF-8 Date: Wed, 24 Apr 2013 23:28:33 +0200 (CEST) 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: From: phpcompta-dev@nongnu.org Subject: [Phpcompta-dev] r5213 - 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 21:31:24 -0000 Author: danydb Date: 2013-04-24 23:28:32 +0200 (Wed, 24 Apr 2013) New Revision: 5213 Modified: phpcompta/tags/rel650/include/class_follow_up.php Log: 0000824: Impossible de rechercher une action pour les actions li?\195?\16= 9es Modified: phpcompta/tags/rel650/include/class_follow_up.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_follow_up.php 2013-04-15 17:56:50= UTC (rev 5212) +++ phpcompta/tags/rel650/include/class_follow_up.php 2013-04-24 21:28:32= UTC (rev 5213) @@ -1325,6 +1325,7 @@ (select ad_value from fiche_Detail where f_id=3Daction_gestion.f_id_= dest and ad_id=3D1) as name from action_gestion join document_type on (ag_type=3Ddt_id) + join document_state on (s_id=3Dag_state) where $p_sql"; $max_line =3D $cn->count_sql($sql); =20 --- PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web) Projet opensource http://www.phpcompta.eu From MAILER-DAEMON Fri Apr 26 18:05:42 2013 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UVqly-0005Y9-IL for mharc-phpcompta-dev@gnu.org; Fri, 26 Apr 2013 18:05:42 -0400 To: phpcompta-dev@nongnu.org Content-Type: text/plain; charset=UTF-8 Date: Sat, 27 Apr 2013 00:02:55 +0200 (CEST) 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: From: phpcompta-dev@nongnu.org Subject: [Phpcompta-dev] r481 - in trunk/rapport_avance: . 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 22:05:40 -0000 Author: danydb Date: 2013-04-27 00:02:54 +0200 (Sat, 27 Apr 2013) New Revision: 481 Added: trunk/rapport_avance/sql/upgrade3.sql Modified: trunk/rapport_avance/ajax.php trunk/rapport_avance/include/class_rapav_formulaire.php trunk/rapport_avance/include/class_rapport_avance_sql.php trunk/rapport_avance/include/template/formulaire_definition.php trunk/rapport_avance/rapav_javascript.js Log: 0000739: G?\195?\169n?\195?\169ration de d?\195?\169claration - Chargement du mod?\195?\168le et sauvegarde dans la DB Modified: trunk/rapport_avance/ajax.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.php 2013-04-05 13:59:37 UTC (rev 480) +++ trunk/rapport_avance/ajax.php 2013-04-26 22:02:54 UTC (rev 481) @@ -14,7 +14,7 @@ echo '

D=C3=A9finition

'; $form =3D new RAPAV_formulaire($_REQUEST['f_id']); $form->load_definition(); - echo '
'; + echo ''; $form->input_formulaire(); $form->input_definition(); echo '

'; @@ -128,7 +128,14 @@ case 'rapav_declaration_delete': $cn->exec_sql("delete from rapport_advanced.declaration where d_id=3D$= 1", array($_GET['d_id'])); break; - default: + ///////////////////////////////////////////////////////////////////////= //////////////////////////////////////////////// + // Remove a template + ///////////////////////////////////////////////////////////////////////= //////////////////////////////////////////////// + case 'rapav_remove_doc_template': + require_once 'include/class_rapav_formulaire.php'; + $rapav=3Dnew Rapav_Formulaire($_GET['f_id']); + $rapav->remove_doc_template(); + defaut: break; } ?> Modified: trunk/rapport_avance/include/class_rapav_formulaire.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_formulaire.php 2013-04-05 13= :59:37 UTC (rev 480) +++ trunk/rapport_avance/include/class_rapav_formulaire.php 2013-04-26 22= :02:54 UTC (rev 481) @@ -43,7 +43,8 @@ * show a list of all existing declaration * @global type $cn database connection */ - static function listing() + static + function listing() { global $cn; $alist =3D $cn->get_array("select f_id,f_title,f_description from rapp= ort_advanced.formulaire order by 2"); @@ -56,7 +57,7 @@ function load_definition() { $f =3D new Formulaire_Param_Sql(); - $ret =3D $f->seek(" where f_id=3D".sql_string($this->f_id) ." order by= p_order "); + $ret =3D $f->seek(" where f_id=3D" . sql_string($this->f_id) . " order= by p_order "); $max =3D Database::num_row($ret); =20 for ($i =3D 0; $i < $max; $i++) @@ -100,16 +101,8 @@ */ static function save_definition($p_array) { - if ($p_array['f_id'] =3D=3D -1) - { - self::insert_definition($p_array); - return; - } - else - { - self::update_definition($p_array); - return; - } + self::update_definition($p_array); + return; } =20 /** @@ -131,7 +124,7 @@ $form_param->p_code =3D $p_array['p_code'][$i]; $form_param->p_libelle =3D $p_array['p_libelle'][$i]; $form_param->p_type =3D $p_array['p_type'][$i]; - $form_param->p_order =3D (isNumber($p_array['p_order'][$i])=3D=3D0)?$= i*10:$p_array['p_order'][$i]; + $form_param->p_order =3D (isNumber($p_array['p_order'][$i]) =3D=3D 0)= ? $i * 10 : $p_array['p_order'][$i]; $form_param->t_id =3D $p_array['t_id'][$i]; $form_param->f_id =3D $p_array['f_id']; // update or insert the row @@ -140,8 +133,48 @@ else $form_param->update(); } + self::load_file($rapav); } =20 + static function load_file(RAPAV_Formulaire $p_rapav) + { + global $cn; + var_dump($p_rapav); + var_dump($_FILES); + // nothing to save + if (sizeof($_FILES) =3D=3D 0) + return; + + // Start Transaction + $cn->start(); + $name =3D $_FILES['rapav_template']['name']; + $new_name =3D tempnam($_ENV['TMP'], 'rapav_template'); + // check if a file is submitted + if (strlen($_FILES['rapav_template']['tmp_name']) !=3D 0) + { + // upload the file and move it to temp directory + if (move_uploaded_file($_FILES['rapav_template']['tmp_name'], $new_na= me)) + { + $oid =3D $cn->lo_import($new_name); + // check if the lob is in the database + if ($oid =3D=3D false) + { + $cn->rollback(); + return 1; + } + } + // the upload in the database is successfull + $p_rapav->f_lob =3D $oid; + $p_rapav->f_filename =3D $_FILES['rapav_template']['name']; + $p_rapav->f_mimetype =3D $_FILES['rapav_template']['type']; + $p_rapav->f_size=3D $_FILES['rapav_template']['size']; + + // update rapav + $p_rapav->update(); + } + $cn->commit(); + } + function echo_formulaire() { echo '

' . h($this->f_title) . '

'; @@ -158,8 +191,19 @@ $obj->input(); } } - - + /** + * @brief remove a doc template + */ + function remove_doc_template() + { + global $cn; + $cn->lo_unlink($this->f_lob); + $this->f_filename=3Dnull; + $this->f_size=3Dnull; + $this->f_mimetype=3Dnull; + $this->f_lob=3Dnull; + $this->update(); + } } =20 ?> 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 2013-04-05 = 13:59:37 UTC (rev 480) +++ trunk/rapport_avance/include/class_rapport_avance_sql.php 2013-04-26 = 22:02:54 UTC (rev 481) @@ -81,13 +81,21 @@ $this->name =3D array( "f_id" =3D> "f_id", "f_title" =3D> "f_title", - "f_description" =3D> "f_description" + "f_description" =3D> "f_description", + "f_lob"=3D>"f_lob", + "f_mimetype"=3D>"f_mimetype", + "f_filename"=3D>"f_filename", + "f_size"=3D>"f_size" ); =20 $this->type =3D array( "f_id" =3D> "numeric", "f_title" =3D> "text", - "f_description" =3D> "text" + "f_description" =3D> "text", + "f_lob"=3D>"oid", + "f_mimetype"=3D>"text", + "f_filename"=3D>"text", + "f_size"=3D>"numeric" ); =20 $this->default =3D array( Modified: trunk/rapport_avance/include/template/formulaire_definition.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_definition.php 2013-= 04-05 13:59:37 UTC (rev 480) +++ trunk/rapport_avance/include/template/formulaire_definition.php 2013-= 04-26 22:02:54 UTC (rev 481) @@ -113,4 +113,26 @@

+

+

+ + Mod=C3=A8le : + f_filename =3D=3D "") + echo $file->input(); + else { + $remove_doc=3D HtmlInput::anchor("Efface", "", + sprintf("onclick=3D\"rapav_remove_doc_template('%s','%s','%s','%s')\= "", + $_REQUEST['plugin_code'], + $_REQUEST['ac'], + $_REQUEST['gDossier'], + $this->f_id + )); + echo ' '.$this->f_filename.''; + echo ' '.$remove_doc.''; + echo ' '.$file->inp= ut().''; + } + ?>

\ 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 2013-04-05 13:59:37 UTC (rev= 480) +++ trunk/rapport_avance/rapav_javascript.js 2013-04-26 22:02:54 UTC (rev= 481) @@ -375,4 +375,41 @@ { alert(e.message); } +} +/** + * @brief Remove a template + * + * @note sprintf("rapav_remove_doc_template('%s','%s','%s','%s')", + $_REQUEST['plugin_code'], + $_REQUEST['ac'], + $_REQUEST['gDossier'], + $this->f_id +*/ +function rapav_remove_doc_template(plugin_code,ac,dossier,f_id) +{ + if ( ! confirm ("Confirmez-vous l'effacement de ce mod=C3=A8le ?")) + { + return; + } + try { + var querystring=3D'plugin_code=3D'+plugin_code+'&ac=3D'+ac+'&gDossier=3D= '+dossier+'&act=3Drapav_remove_doc_template'+"&f_id=3D"+f_id; + var action=3Dnew Ajax.Request( + "ajax.php", + { + method:'get', + parameters:querystring, + onFailure:error_get_predef, + onSuccess:function() { + $('rapav_template').style.textDecoration=3D'line-through'; + $('rapav_template').style.color=3D'red'; + $('rapav_template_ctl').innerHTML=3D''; + $('rapav_new_file').style.display=3D'block'; + } + } + ); + + }catch (e) + { + alert(e.message); + } } \ No newline at end of file Added: trunk/rapport_avance/sql/upgrade3.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 --- trunk/rapport_avance/sql/upgrade3.sql (rev 0) +++ trunk/rapport_avance/sql/upgrade3.sql 2013-04-26 22:02:54 UTC (rev 48= 1) @@ -0,0 +1,12 @@ +ALTER TABLE rapport_advanced.formulaire ADD COLUMN f_lob oid; +COMMENT ON COLUMN rapport_advanced.formulaire.f_lob IS 'OID for file'; + +ALTER TABLE rapport_advanced.formulaire ADD COLUMN f_filename text; +COMMENT ON COLUMN rapport_advanced.formulaire.f_filename IS 'filename'; + +ALTER TABLE rapport_advanced.formulaire ADD COLUMN f_mimetype text; +COMMENT ON COLUMN rapport_advanced.formulaire.f_mimetype IS 'Mimetype of= the file'; + +ALTER TABLE rapport_advanced.formulaire ADD COLUMN f_size bigint; +COMMENT ON COLUMN rapport_advanced.formulaire.f_size IS 'Size of the fil= e'; + --- PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web) Projet opensource http://www.phpcompta.eu From MAILER-DAEMON Fri Apr 26 18:11:18 2013 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UVqrO-000099-IB for mharc-phpcompta-dev@gnu.org; Fri, 26 Apr 2013 18:11:18 -0400 To: phpcompta-dev@nongnu.org Content-Type: text/plain; charset=UTF-8 Date: Sat, 27 Apr 2013 00:08:34 +0200 (CEST) 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: From: phpcompta-dev@nongnu.org Subject: [Phpcompta-dev] r482 - trunk/rapport_avance X-BeenThere: phpcompta-dev@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: phpcompta-dev@nongnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 22:11:18 -0000 Author: danydb Date: 2013-04-27 00:08:33 +0200 (Sat, 27 Apr 2013) New Revision: 482 Modified: trunk/rapport_avance/rapav_javascript.js Log: documentation 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 2013-04-26 22:02:54 UTC (rev= 481) +++ trunk/rapport_avance/rapav_javascript.js 2013-04-26 22:08:33 UTC (rev= 482) @@ -6,6 +6,10 @@ =20 /** *@brief show the definition of a form and let it modify it + *@param plugin_code code of plugin + *@param ac code AD + *@param dossier gDossier + *@param f_id pk of form_def */ function rapav_form_def(plugin_code,ac,dossier,f_id) { @@ -378,6 +382,10 @@ } /** * @brief Remove a template + * @param plugin_code code of plugin + * @param ac code AD + * @param dossier gDossier + * @param f_id pk of form_def * * @note sprintf("rapav_remove_doc_template('%s','%s','%s','%s')", $_REQUEST['plugin_code'], --- PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web) Projet opensource http://www.phpcompta.eu From MAILER-DAEMON Fri Apr 26 18:12:25 2013 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UVqsT-0000C3-P9 for mharc-phpcompta-dev@gnu.org; Fri, 26 Apr 2013 18:12:25 -0400 To: phpcompta-dev@nongnu.org Content-Type: text/plain; charset=UTF-8 Date: Sat, 27 Apr 2013 00:09:42 +0200 (CEST) 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: From: phpcompta-dev@nongnu.org Subject: [Phpcompta-dev] r483 - trunk/rapport_avance X-BeenThere: phpcompta-dev@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: phpcompta-dev@nongnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 22:12:24 -0000 Author: danydb Date: 2013-04-27 00:09:41 +0200 (Sat, 27 Apr 2013) New Revision: 483 Modified: trunk/rapport_avance/rapav_javascript.js Log: documentation 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 2013-04-26 22:08:33 UTC (rev= 482) +++ trunk/rapport_avance/rapav_javascript.js 2013-04-26 22:09:41 UTC (rev= 483) @@ -361,6 +361,14 @@ alert(e.message); } } +/** + * @brief export of a form + * @param plugin_code code of plugin + * @param ac code AD + * @param dossier gDossier + * @param d_id id=20 + * @returns {undefined} + */ function rapav_form_export(plugin_code,ac,dossier,d_id) { try { --- PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web) Projet opensource http://www.phpcompta.eu From MAILER-DAEMON Tue Apr 30 15:50:03 2013 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UXGYt-0002L7-SO for mharc-phpcompta-dev@gnu.org; Tue, 30 Apr 2013 15:50:03 -0400 To: phpcompta-dev@nongnu.org Content-Type: text/plain; charset=UTF-8 Date: Tue, 30 Apr 2013 21:47:19 +0200 (CEST) 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: From: phpcompta-dev@nongnu.org Subject: [Phpcompta-dev] r484 - in trunk/rapport_avance: . 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 19:50:02 -0000 Author: danydb Date: 2013-04-30 21:47:19 +0200 (Tue, 30 Apr 2013) New Revision: 484 Modified: trunk/rapport_avance/ajax.php trunk/rapport_avance/include/class_formulaire_param.php trunk/rapport_avance/include/class_rapav_declaration.php trunk/rapport_avance/include/class_rapav_formulaire.php trunk/rapport_avance/include/class_rapport_avance_sql.php trunk/rapport_avance/include/formulaire.inc.php trunk/rapport_avance/include/template/declaration_display.php trunk/rapport_avance/include/template/formulaire_definition.php trunk/rapport_avance/rapav_javascript.js trunk/rapport_avance/sql/upgrade3.sql Log: 0000739: G?\195?\169n?\195?\169ration de d?\195?\169claration - Nouveau type de ligne : remarque et texte Modified: trunk/rapport_avance/ajax.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.php 2013-04-26 22:09:41 UTC (rev 483) +++ trunk/rapport_avance/ajax.php 2013-04-30 19:47:19 UTC (rev 484) @@ -11,18 +11,7 @@ require_once 'include/class_rapav_formulaire.php'; if (!isset($_GET['f_id']) && isNum($_GET['f_id']) =3D=3D 0) exit(); - echo '

D=C3=A9finition

'; - $form =3D new RAPAV_formulaire($_REQUEST['f_id']); - $form->load_definition(); - echo ''; - $form->input_formulaire(); - $form->input_definition(); - echo '

'; - $delete =3D new ICheckBox('delete'); - echo "Cochez la case pour effacer ce formulaire " . $delete->input(); - echo '

'; - echo HtmlInput::submit('form_def_sub', 'Sauve'); - echo ''; + require_once 'include/formulaire_definition_show.inc.php'; break; /* * *****************************************************************= ********************************************* * Ajoute une ligne dans la definition @@ -32,6 +21,9 @@ $type_periode =3D $cn->make_array("select t_id,t_description from rapp= ort_advanced.periode_type order by t_description"); ?> + Nouv. + + input(); ?> - - css_size =3D "100%"; - echo $p_info->input(); - ?> - ' 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 + fputcsv($out, array("RAPAV", '3'), ";"); + 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, t_id from rapport_advanced.formulaire_param where f_id=3D$1", array($p_id)= ); for ($i =3D 0; $i < count($array); $i++) { @@ -104,6 +104,7 @@ throw new Exception('Formulaire invalide'); } // $a[1] contains the version + $rapav_version=3D$a[1]; // first line is the title and description $form =3D new formulaire_sql(); $first =3D fgetcsv($in, 0, ";"); @@ -116,10 +117,13 @@ { if ($csv[0] !=3D "RAPAV_DETAIL") { + if ( $rapav_version =3D=3D 2 ) { + unset($csv[6]); + } $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); + p_id, p_code, p_libelle, p_type, p_order, f_id, t_id) + VALUES ($1, $2, $3, $4, $5, $6, $7)", $csv); } else break; } @@ -144,7 +148,7 @@ $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= ')"); =20 - $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 + $cn->exec_sql('insert into rapport_advanced.formulaire_param select = p_id, p_code, p_libelle, p_type, p_order, f_id, t_id from rapport_advanced.restore_formulaire_param where f_id=3D$1',arra= y($form->f_id)); =20 $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, 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 2013-04-26 2= 2:09:41 UTC (rev 483) +++ trunk/rapport_avance/include/class_rapav_declaration.php 2013-04-30 1= 9:47:19 UTC (rev 484) @@ -45,7 +45,7 @@ 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 + $a_row=3D$cn->get_array('select dr_code,dr_libelle,dr_amount from rapp= ort_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 @@ -67,11 +67,11 @@ =20 for ($i =3D 0; $i < count($a_row); $i++) { - printf ('"%s";"%s";%s;"%s"'."\r\n", + printf ('"%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']); + nb($a_row[$i]['dr_amount']) + ); } } function compute($p_id, $p_start, $p_end) @@ -92,7 +92,7 @@ /* * First we compute the formula and tva_code for each detail */ - $array =3D $cn->get_array("select p_id,p_code,p_libelle,p_type,p_order= ,f_id,p_info,t_id + $array =3D $cn->get_array("select p_id,p_code,p_libelle,p_type,p_order= ,f_id,t_id from rapport_advanced.formulaire_param where f_id=3D$1 @@ -111,11 +111,11 @@ /** * Add the lines missing lines */ - $array =3D $cn->get_array("select fp.p_id,p_code,p_libelle,p_type,p_or= der,f_id,p_info,t_id + $array =3D $cn->get_array("select fp.p_id,p_code,p_libelle,p_type,p_or= der,f_id,t_id from rapport_advanced.formulaire_param as fp where f_id=3D$1 - and p_type in (1,2,6)", array($p_id)); + and p_type in (1,2,6,7,8)", array($p_id)); for ($i =3D 0; $i < count($array); $i++) { $row =3D new Rapav_Declaration_Param(); @@ -173,7 +173,6 @@ function insert() { $data =3D new RAPAV_Declaration_Row_SQL(); - $data->dr_info =3D $this->param->p_info; $data->dr_code =3D $this->param->p_code; $data->dr_libelle =3D $this->param->p_libelle; $data->dr_order =3D $this->param->p_order; @@ -193,14 +192,13 @@ * - 'p_type', * - 'p_order', * - 'f_id', - * - 'p_info', * - 't_id' * @param type $p_array */ function from_array($p_array) { $this->param =3D new Formulaire_Param(); - foreach (array('p_id', 'p_code', 'p_libelle', 'p_type', 'p_order', 'f_= id', 'p_info', 't_id') as $e) + foreach (array('p_id', 'p_code', 'p_libelle', 'p_type', 'p_order', 'f_= id', 't_id') as $e) { $this->param->$e =3D $p_array[$e]; } Modified: trunk/rapport_avance/include/class_rapav_formulaire.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_formulaire.php 2013-04-26 22= :09:41 UTC (rev 483) +++ trunk/rapport_avance/include/class_rapav_formulaire.php 2013-04-30 19= :47:19 UTC (rev 484) @@ -112,19 +112,20 @@ */ static function update_definition($p_array) { + global $cn; $rapav =3D new RAPAV_Formulaire($p_array['f_id']); // save into table formulaire $rapav->f_title =3D $p_array['f_title']; $rapav->f_description =3D $p_array['f_description']; $rapav->update(); - - for ($i =3D 0; $i < count($p_array['p_id']); $i++) + $nb_line=3Dcount($p_array['p_id']); + for ($i =3D 0; $i < $nb_line ; $i++) { $form_param =3D new formulaire_param_sql($p_array['p_id'][$i]); $form_param->p_code =3D $p_array['p_code'][$i]; $form_param->p_libelle =3D $p_array['p_libelle'][$i]; $form_param->p_type =3D $p_array['p_type'][$i]; - $form_param->p_order =3D (isNumber($p_array['p_order'][$i]) =3D=3D 0)= ? $i * 10 : $p_array['p_order'][$i]; + $form_param->p_order =3D (isNumber($p_array['p_order'][$i]) =3D=3D 0)= ? ($i+1) * 10 : $p_array['p_order'][$i]; $form_param->t_id =3D $p_array['t_id'][$i]; $form_param->f_id =3D $p_array['f_id']; // update or insert the row @@ -133,14 +134,23 @@ else $form_param->update(); } + // delete checked rows + if ( isset ($p_array["del_row"])) + { + for ($i=3D0;$i "p_type", "p_order" =3D> "p_order", "f_id" =3D> "f_id", - "p_info" =3D> "p_info", "t_id" =3D> "t_id" ); =20 @@ -55,7 +54,6 @@ "p_type" =3D> "numeric", "p_order" =3D> "numeric", "f_id" =3D> "numeric", - "p_info" =3D> "text", "t_id" =3D> "numeric" ); =20 @@ -213,8 +211,7 @@ "dr_order"=3D>"dr_order", "dr_code"=3D>"dr_code", "dr_amount"=3D>"dr_amount", - "dr_type"=3D>"dr_type", - "dr_info"=3D>"dr_info" + "dr_type"=3D>"dr_type" ); =20 $this->type =3D array( @@ -224,8 +221,7 @@ "dr_order"=3D>"text", "dr_code"=3D>"numeric", "dr_amount"=3D>"numeric", - "dr_type"=3D>"numeric", - "dr_info"=3D>'text' + "dr_type"=3D>"numeric" =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 2013-04-26 22:09:41 U= TC (rev 483) +++ trunk/rapport_avance/include/formulaire.inc.php 2013-04-30 19:47:19 U= TC (rev 484) @@ -37,7 +37,8 @@ else { RAPAV_formulaire::save_definition($_POST); - + require_once 'formulaire_definition_show.inc.php'; + exit(); } } if (isset ($_POST['add_form'])) 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 2013-04= -26 22:09:41 UTC (rev 483) +++ trunk/rapport_avance/include/template/declaration_display.php 2013-04= -30 19:47:19 UTC (rev 484) @@ -40,21 +40,25 @@ { case 1: echo '

'.$row['dr_libelle'].'

'; - echo ''.$row['dr_info'].''; break; case 2: echo '

'.$row['dr_libelle'].'

'; - echo ''.$row['dr_info'].''; break; case 6: echo '

'.$row['dr_libelle'].'

'; - echo ''.$row['dr_info'].''; break; case 3: $input=3Dnew INum('amount[]',$row['dr_amount']); $input->size=3D15; echo HtmlInput::hidden('code[]',$row['dr_id']); - echo '

'.$row['dr_code']." ".$row['dr_libelle']." =3D ".$input->inpu= t(). ''.$row['dr_info'].''.'

'; + echo '

'.$row['dr_code']." ".$row['dr_libelle']." =3D ".$input->inpu= t().'

'; + break; + case 7: + echo '

'.$row['dr_libelle'].'

'; + break; + case 8: + echo ' '.$row['dr_libelle'].''; + break; =20 } endfor; Modified: trunk/rapport_avance/include/template/formulaire_definition.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_definition.php 2013-= 04-26 22:09:41 UTC (rev 483) +++ trunk/rapport_avance/include/template/formulaire_definition.php 2013-= 04-30 19:47:19 UTC (rev 484) @@ -32,13 +32,16 @@ + - - "> - + @@ -99,13 +105,6 @@ echo $p_order->input(); ?> - 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 2013-04-26 22:09:41 UTC (rev= 483) +++ trunk/rapport_avance/rapav_javascript.js 2013-04-30 19:47:19 UTC (rev= 484) @@ -366,7 +366,7 @@ * @param plugin_code code of plugin * @param ac code AD * @param dossier gDossier - * @param d_id id=20 + * @param d_id id * @returns {undefined} */ function rapav_form_export(plugin_code,ac,dossier,d_id) @@ -428,4 +428,4 @@ { alert(e.message); } -} \ No newline at end of file +} Modified: trunk/rapport_avance/sql/upgrade3.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 --- trunk/rapport_avance/sql/upgrade3.sql 2013-04-26 22:09:41 UTC (rev 48= 3) +++ trunk/rapport_avance/sql/upgrade3.sql 2013-04-30 19:47:19 UTC (rev 48= 4) @@ -10,3 +10,11 @@ ALTER TABLE rapport_advanced.formulaire ADD COLUMN f_size bigint; COMMENT ON COLUMN rapport_advanced.formulaire.f_size IS 'Size of the fil= e'; =20 +insert into rapport_advanced.type_row(p_type,p_description) values (7,'T= exte'); +insert into rapport_advanced.type_row(p_type,p_description) values (8,'R= emarque'); + +insert into rapport_advanced.formulaire_param(p_code,p_libelle,p_type,p_= order,f_id,t_id) + select p_code||'note',p_info,8,p_order+1,f_id,t_id from rapport_advance= d.formulaire_param where coalesce(p_info,'') <> ''; + +alter table rapport_advanced.formulaire_param drop p_info; +ALTER TABLE rapport_advanced.declaration_row DROP COLUMN dr_info ; --- PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web) Projet opensource http://www.phpcompta.eu From MAILER-DAEMON Tue Apr 30 17:28:32 2013 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UXI6C-0004OQ-Sj for mharc-phpcompta-dev@gnu.org; Tue, 30 Apr 2013 17:28:32 -0400 To: phpcompta-dev@nongnu.org Content-Type: text/plain; charset=UTF-8 Date: Tue, 30 Apr 2013 23:25:43 +0200 (CEST) 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: From: phpcompta-dev@nongnu.org Subject: [Phpcompta-dev] r485 - in trunk/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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 21:28:31 -0000 Author: danydb Date: 2013-04-30 23:25:43 +0200 (Tue, 30 Apr 2013) New Revision: 485 Modified: trunk/rapport_avance/include/class_rapav_declaration.php trunk/rapport_avance/include/class_rapport_avance_sql.php trunk/rapport_avance/include/declaration.inc.php trunk/rapport_avance/raw.php trunk/rapport_avance/sql/upgrade3.sql Log: 0000739: G?\195?\169n?\195?\169ration de d?\195?\169claration Generate document : html, text, rtf 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 2013-04-30 1= 9:47:19 UTC (rev 484) +++ trunk/rapport_avance/include/class_rapav_declaration.php 2013-04-30 2= 1:25:43 UTC (rev 485) @@ -42,6 +42,11 @@ $this->form =3D new RAPAV_Formulaire(); parent::__construct(); } + /** + * @brief export a declaration to CSV + * @global $cn database conx + * @param $p_id pk of rapav_declaration + */ static function to_csv($p_id) { global $cn; @@ -74,6 +79,159 @@ ); } } + function get_file_to_parse() + { + global $cn; + // create a temp directory in /tmp to unpack file and to parse it + $dirname=3Dtempnam($_ENV['TMP'],'rapav_'); + + + unlink($dirname); + mkdir ($dirname); + chdir($dirname); + // Retrieve the lob and save it into $dirname + $cn->start(); + + + $filename=3D$this->d_filename; + $exp=3D$cn->lo_export($this->d_lob,$dirname.DIRECTORY_SEPARATOR.= $filename); + + if ( $exp =3D=3D=3D false ) echo_warning( __FILE__.":".__LINE__."Expor= t NOK $filename"); + + $type=3D"n"; + // if the doc is a OOo, we need to unzip it first + // and the name of the file to change is always content.xml + if ( strpos($this->d_mimetype,'vnd.oasis') !=3D 0 ) + { + ob_start(); + $zip =3D new Zip_Extended; + if ($zip->open($filename) =3D=3D=3D TRUE) { + $zip->extractTo($dirname.DIRECTORY_SEPARATOR); + $zip->close(); + } else { + echo __FILE__.":".__LINE__."cannot unzip model ".$filename; + } + + // Remove the file we do not need anymore + unlink($filename); + ob_end_clean(); + $file_to_parse=3D"content.xml"; + $type=3D"OOo"; + } + else + $file_to_parse=3D$filename; + + $cn->commit(); + return array($file_to_parse,$dirname,$type); + } + function generate_document() + { + global $cn; + if ( $this->d_filename =3D=3D "") return; + + list($file_to_parse,$dirname,$type)=3D$this->get_file_to_parse(); + + // parse the document - return the doc number ? + $this->parse_document($dirname,$file_to_parse,$type); + + // if the doc is a OOo, we need to re-zip it + if ($type=3D=3D'OOo' ) + { + ob_start(); + $zip =3D new Zip_Extended; + $res =3D $zip->open($this->d_filename, ZipArchive::CREATE); + if($res !=3D=3D TRUE) + { + echo __FILE__.":".__LINE__."cannot recreate zip"; + exit; + } + $zip->add_recurse_folder($dirname.DIRECTORY_SEPARATOR); + $zip->close(); + + ob_end_clean(); + + $file_to_save=3D$this->d_filename; + } + else + { + $file_to_save=3D$file_to_parse; + } + + $this->load_document($dirname.DIRECTORY_SEPARATOR.$file_to_save)= ; + } + function parse_document($p_dir,$p_filename,$p_type) + { + global $cn; + // Retrieve all the code + amount + if ($p_type =3D=3D "OOo") { + $array=3D$cn->get_array("select '<<'||dr_code||'>>' as co= de,dr_amount from rapport_advanced.declaration_row where d_id=3D$1 and dr= _type=3D3",array($this->d_id)); + } + else { + $array=3D$cn->get_array("select '<<'||dr_code||'>>' as code,dr_amount= from rapport_advanced.declaration_row where d_id=3D$1 and dr_type=3D3",a= rray($this->d_id)); + } + + // open the files + $ifile=3Dfopen($p_dir.'/'.$p_filename,'r'); + + // check if tmpdir exist otherwise create it + $temp_dir=3D$_SERVER["DOCUMENT_ROOT"].DIRECTORY_SEPARATOR.'tmp'; + if ( is_dir($temp_dir) =3D=3D false ) + { + if ( mkdir($temp_dir) =3D=3D false ) + { + echo "Ne peut pas cr=C3=A9er le r=C3=A9pertoire ".$temp_dir; + exit(); + } + } + // Compute output_name + $oname=3Dtempnam($temp_dir,"rapport_avance_"); + $ofile=3Dfopen($oname,"w+"); + + // read ifile + while (! feof ($ifile)) + { + $buffer=3Dfgets($ifile); + // for each code replace in p_filename the code surrounded by << >> b= y the amount (value) or < or > + foreach ($array as $key=3D>$value) + { + $buffer=3Dstr_replace($value['code'],$value['dr_amount'],$buffer); + } + // write to output + fwrite($ofile,$buffer); + } + + // copy the output to input + fclose($ifile); + fclose($ofile); + + if ( ($ret=3Dcopy ($oname,$p_dir.'/'.$p_filename)) =3D=3D FALSE ) + { + echo _('Ne peut pas sauver '.$oname.' vers '.$p_dir.'/'.$p_filename.'= code d\'erreur =3D'.$ret); + } + /** + * @todo clean files + */ + // unlink ($oname); + + } + function load_document($p_file) + { + global $cn; + $cn->start(); + $this->d_lob=3D$cn->lo_import($p_file); + if ( $this->d_lob =3D=3D false ) + { + echo "ne peut pas importer [$p_file]"; + return 1; + } + $this->d_size=3D filesize($p_file); + $date=3Ddate('ymd-Hi'); + $this->d_filename=3D$date.'-'.$this->d_filename; + $this->update(); + $cn->commit(); + + + } function compute($p_id, $p_start, $p_end) { global $cn; @@ -88,6 +246,10 @@ $this->d_start =3D $p_start; $this->d_end =3D $p_end; $this->to_keep =3D 'N'; + $this->d_lob=3D$this->form->f_lob; + $this->d_filename=3D$this->form->f_filename; + $this->d_mimetype=3D$this->form->f_mimetype; + $this->d_size=3D$this->form->f_size; $this->insert(); /* * First we compute the formula and tva_code for each detail @@ -128,7 +290,12 @@ =20 $cn->commit(); } - + function anchor_document() + { + $url=3DHtmlInput::request_to_string(array('gDossier','ac','plugin_code= ')); + $url=3D'extension.raw.php'.$url.'&act=3Dexport_decla_document&= id=3D'.$this->d_id; + return HtmlInput::anchor($this->d_filename,$url); + } function display() { global $cn; 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 2013-04-30 = 19:47:19 UTC (rev 484) +++ trunk/rapport_avance/include/class_rapport_avance_sql.php 2013-04-30 = 21:25:43 UTC (rev 485) @@ -171,6 +171,10 @@ "d_end"=3D>"d_end", "to_keep"=3D>"to_keep", "d_generated"=3D>"d_generated", + "d_lob"=3D>"d_lob", + "d_filename"=3D>"d_filename", + "d_mimetype"=3D>"d_mimetype", + "d_size"=3D>"d_size", "f_id"=3D>"f_id" ); =20 @@ -181,7 +185,12 @@ "d_end"=3D>"date", "to_keep"=3D>"text", "d_generated"=3D>"date", - "f_id"=3D>"numeric" + "f_id"=3D>"numeric", + "d_lob"=3D>"oid", + "d_filename"=3D>"text", + "d_mimetype"=3D>"text", + "d_size"=3D>"numeric", + ); =20 $this->default =3D array( 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 2013-04-30 19:47:19 = UTC (rev 484) +++ trunk/rapport_avance/include/declaration.inc.php 2013-04-30 21:25:43 = UTC (rev 485) @@ -39,12 +39,14 @@ $decl->to_keep =3D 'Y'; $decl->f_id =3D $_POST['p_form']; $decl->save(); + $decl->generate_document(); $decl->display(); - echo '

Sauv=C3=A9

'; + echo '

'._(' Sauv=C3=A9 ').date('d-m-Y H:i').'

= '; =20 - $ref =3D HtmlInput::array_to_string(array('gDossier', 'plugin_code', 'd= _id'), $_REQUEST, 'extension.raw.php?'); - $ref.=3D"&act=3Dexport_decla_csv"; - echo HtmlInput::button_anchor("Export CSV", $ref, 'export_id'); + $ref_csv =3D HtmlInput::array_to_string(array('gDossier', 'plugin_code'= , 'd_id'), $_REQUEST, 'extension.raw.php?'); + $ref_csv.=3D"&act=3Dexport_decla_csv"; + echo HtmlInput::button_anchor("Export CSV", $ref_csv, 'export_id'); + if ( $decl->d_filename !=3D '' ) echo $decl->anchor_document(); exit(); } /* 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 2013-04-30 19:47:19 UTC (rev 484) +++ trunk/rapport_avance/raw.php 2013-04-30 21:25:43 UTC (rev 485) @@ -1,4 +1,5 @@ d_id =3D $id; + $decl->load(); + + $cn->start(); + if ($decl->d_filename =3D=3D "") + { + ini_set('zlib.output_compression', 'Off'); + header("Pragma: public"); + header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + header("Cache-Control: must-revalidate"); + header('Content-type: ' . 'text/plain'); + header('Content-Disposition: attachment;filename=3Dvide.txt', FALSE); + header("Accept-Ranges: bytes"); + echo "******************"; + echo _("Fichier effac=C3=A9"); + echo "******************"; + exit(); + } + $tmp =3D tempnam($_ENV['TMP'], 'document_'); + + $cn->lo_export($decl->d_lob, $tmp); + + ini_set('zlib.output_compression', 'Off'); + header("Pragma: public"); + header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + header("Cache-Control: must-revalidate"); + header('Content-type: ' . $decl->d_mimetype); + header('Content-Disposition: attachment;filename=3D"' . $decl->d_filena= me . '"', FALSE); + header("Accept-Ranges: bytes"); + $file =3D fopen($tmp, 'r'); + while (!feof($file)) + echo fread($file, 8192); + + fclose($file); + + unlink($tmp); + + $cn->commit(); +} ?> Modified: trunk/rapport_avance/sql/upgrade3.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 --- trunk/rapport_avance/sql/upgrade3.sql 2013-04-30 19:47:19 UTC (rev 48= 4) +++ trunk/rapport_avance/sql/upgrade3.sql 2013-04-30 21:25:43 UTC (rev 48= 5) @@ -18,3 +18,15 @@ =20 alter table rapport_advanced.formulaire_param drop p_info; ALTER TABLE rapport_advanced.declaration_row DROP COLUMN dr_info ; + +ALTER TABLE rapport_advanced.declaration ADD COLUMN d_lob oid; +COMMENT ON COLUMN rapport_advanced.declaration.d_lob IS 'OID for file'; + +ALTER TABLE rapport_advanced.declaration ADD COLUMN d_filename text; +COMMENT ON COLUMN rapport_advanced.declaration.d_filename IS 'filename'; + +ALTER TABLE rapport_advanced.declaration ADD COLUMN d_mimetype text; +COMMENT ON COLUMN rapport_advanced.declaration.d_mimetype IS 'Mimetype o= f the file'; + +ALTER TABLE rapport_advanced.declaration ADD COLUMN d_size bigint; +COMMENT ON COLUMN rapport_advanced.declaration.d_size IS 'Size of the fi= le'; --- PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web) Projet opensource http://www.phpcompta.eu From MAILER-DAEMON Tue Apr 30 17:34:21 2013 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UXIBp-0005vv-Ny for mharc-phpcompta-dev@gnu.org; Tue, 30 Apr 2013 17:34:21 -0400 To: phpcompta-dev@nongnu.org Content-Type: text/plain; charset=UTF-8 Date: Tue, 30 Apr 2013 23:31:42 +0200 (CEST) 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: From: phpcompta-dev@nongnu.org Subject: [Phpcompta-dev] r486 - 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 21:34:20 -0000 Author: danydb Date: 2013-04-30 23:31:41 +0200 (Tue, 30 Apr 2013) New Revision: 486 Modified: trunk/rapport_avance/include/class_rapav_declaration.php Log: 0000739: G?\195?\169n?\195?\169ration de d?\195?\169claration respect type numeric for ODT 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 2013-04-30 2= 1:25:43 UTC (rev 485) +++ trunk/rapport_avance/include/class_rapav_declaration.php 2013-04-30 2= 1:31:41 UTC (rev 486) @@ -194,6 +194,12 @@ // for each code replace in p_filename the code surrounded by << >> b= y the amount (value) or < or > foreach ($array as $key=3D>$value) { + if ( is_numeric($value['dr_amount']) ) + { + $searched=3D'office:value-type=3D"string">'.$value['code']; + $replaced=3D'office:value-type=3D"float" office:value=3D"'.$value['= dr_amount'].'">'.$value['code']; + $buffer=3Dstr_replace($searched, $replaced, $buffer); + } $buffer=3Dstr_replace($value['code'],$value['dr_amount'],$buffer); } // write to output --- PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web) Projet opensource http://www.phpcompta.eu From MAILER-DAEMON Tue Apr 30 18:07:49 2013 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UXIiC-0006tB-VR for mharc-phpcompta-dev@gnu.org; Tue, 30 Apr 2013 18:07:48 -0400 To: phpcompta-dev@nongnu.org Content-Type: text/plain; charset=UTF-8 Date: Wed, 1 May 2013 00:05:15 +0200 (CEST) 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: From: phpcompta-dev@nongnu.org Subject: [Phpcompta-dev] r487 - 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 22:07:47 -0000 Author: danydb Date: 2013-05-01 00:05:14 +0200 (Wed, 01 May 2013) New Revision: 487 Modified: trunk/rapport_avance/include/class_rapav_declaration.php Log: Add special tag 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 2013-04-30 2= 1:31:41 UTC (rev 486) +++ trunk/rapport_avance/include/class_rapav_declaration.php 2013-04-30 2= 2:05:14 UTC (rev 487) @@ -131,9 +131,12 @@ =20 list($file_to_parse,$dirname,$type)=3D$this->get_file_to_parse(); =20 - // parse the document - return the doc number ? + // parse the document $this->parse_document($dirname,$file_to_parse,$type); =20 + // Add special tag + $this->special_tag($dirname,$file_to_parse,$type); + // if the doc is a OOo, we need to re-zip it if ($type=3D=3D'OOo' ) { @@ -220,6 +223,79 @@ // unlink ($oname); =20 } + function special_tag($p_dir,$p_filename,$p_type) + { + global $cn,$g_parameter; + // Retrieve all the code + libelle + $array[]=3Darray('code'=3D>'PERIODE_DECLARATION','value'=3D> format_d= ate($this->d_end)." - ".format_date($this->d_start)); + $array[]=3Darray('code'=3D>'TITRE','value'=3D>$this->d_title); + $array[]=3Darray('code'=3D>'DOSSIER','value'=3D>$cn->format_name($_REQ= UEST['gDossier'],'dos')); + $array[]=3Darray('code'=3D>'NAME','value'=3D>$g_parameter->MY_NAME); + $array[]=3Darray('code'=3D>'STREET','value'=3D>$g_parameter->MY_STREET= ); + $array[]=3Darray('code'=3D>'NUMBER','value'=3D>$g_parameter->MY_NUMBER= ); + $array[]=3Darray('code'=3D>'LOCALITE','value'=3D>$g_parameter->MY_COMM= UNE); + $array[]=3Darray('code'=3D>'COUNTRY','value'=3D>$g_parameter->MY_PAYS)= ; + $array[]=3Darray('code'=3D>'PHONE','value'=3D>$g_parameter->MY_TEL); + $array[]=3Darray('code'=3D>'CEDEX','value'=3D>$g_parameter->MY_CP); + $array[]=3Darray('code'=3D>'FAX','value'=3D>$g_parameter->MY_FAX); + + // open the files + $ifile=3Dfopen($p_dir.'/'.$p_filename,'r'); + + // check if tmpdir exist otherwise create it + $temp_dir=3D$_SERVER["DOCUMENT_ROOT"].DIRECTORY_SEPARATOR.'tmp'; + if ( is_dir($temp_dir) =3D=3D false ) + { + if ( mkdir($temp_dir) =3D=3D false ) + { + echo "Ne peut pas cr=C3=A9er le r=C3=A9pertoire ".$temp_dir; + exit(); + } + } + // Compute output_name + $oname=3Dtempnam($temp_dir,"rapport_avance_"); + $ofile=3Dfopen($oname,"w+"); + + // read ifile + while (! feof ($ifile)) + { + $buffer=3Dfgets($ifile); + // for each code replace in p_filename the code surrounded by << >> b= y the amount (value) or < or > + foreach ($array as $key=3D>$value) + { + if ( $p_type=3D=3D'OOo') + { + $replace=3D'<<'.$value['code'].'>>'; + $fmt_value=3D$value['value']; + $fmt_value=3Dstr_replace('<','<',$fmt_value); + $fmt_value=3Dstr_replace('>','>',$fmt_value); + $fmt_value=3Dstr_replace('&','&',$fmt_value); + $fmt_value=3Dstr_replace('"','"',$fmt_value); + $fmt_value=3Dstr_replace("'",''',$fmt_value); + } else { + $replace=3D'<<'.$value['code'].'>>'; + $fmt_value=3D $value['value']; + } + $buffer=3Dstr_replace($replace,$fmt_value,$buffer); + } + // write to output + fwrite($ofile,$buffer); + } + + // copy the output to input + fclose($ifile); + fclose($ofile); + + if ( ($ret=3Dcopy ($oname,$p_dir.'/'.$p_filename)) =3D=3D FALSE ) + { + echo _('Ne peut pas sauver '.$oname.' vers '.$p_dir.'/'.$p_filename.'= code d\'erreur =3D'.$ret); + } + /** + * @todo clean files + */ + // unlink ($oname); + + } function load_document($p_file) { global $cn; --- PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web) Projet opensource http://www.phpcompta.eu From MAILER-DAEMON Tue Apr 30 18:07:57 2013 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UXIiL-0006tW-31 for mharc-phpcompta-dev@gnu.org; Tue, 30 Apr 2013 18:07:57 -0400 To: phpcompta-dev@nongnu.org Content-Type: text/plain; charset=UTF-8 Date: Wed, 1 May 2013 00:05:26 +0200 (CEST) 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: From: phpcompta-dev@nongnu.org Subject: [Phpcompta-dev] r488 - 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 22:07:56 -0000 Author: danydb Date: 2013-05-01 00:05:26 +0200 (Wed, 01 May 2013) New Revision: 488 Modified: trunk/rapport_avance/include/class_formulaire_param.php Log: New type : text and notice 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 2013-04-30 22= :05:14 UTC (rev 487) +++ trunk/rapport_avance/include/class_formulaire_param.php 2013-04-30 22= :05:26 UTC (rev 488) @@ -52,6 +52,10 @@ return new Formulaire_Title3($form); case 3: return new Formulaire_Formula($form); + case 7: + return new Formulaire_Text($form); + case 8: + return new Formulaire_Notice($form); } } =20 @@ -219,8 +223,42 @@ } =20 } +/** + * @brief display title level 1 + */ +class formulaire_text extends Formulaire_Row +{ =20 + function display() + { + echo '

'.$this->obj->p_libelle.'

'; + } + + function input() + { + echo '

'.$this->obj->p_libelle.'

'; + } + +} /** + * @brief display title level 1 + */ +class formulaire_notice extends Formulaire_Row +{ + + function display() + { + echo span($this->obj->p_libelle, ' class=3D"notice" '); + } + + function input() + { + echo span($this->obj->p_libelle, ' class=3D"notice"'); + } + +} + +/** * @brief display title level 2 */ class formulaire_title2 extends Formulaire_Row --- PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web) Projet opensource http://www.phpcompta.eu

+ A effacer + Code Libell=C3=A9 + Type de ligne @@ -47,16 +50,18 @@ Ordre d'apparition - Message d'aide -
+ definition[$i]->p_id); + echo $a->input(); + ?> + definition[$i]->p_id) ?> definition[$i]->p_code); @@ -67,7 +72,8 @@ definition[$i]->p_libell= e); - $p_libelle->css_size=3D"100%"; + $p_libelle->size=3D"50"; + //$p_libelle->css_size=3D"100%"; echo $p_libelle->input(); ?> - definition[$i]->p_info); - $p_info->css_size=3D"100%"; - echo $p_info->input(); - ?> -