Author: danydb Date: 2014-02-07 22:40:00 +0100 (Fri, 07 Feb 2014) New Revision: 700
Added: trunk/rapport_avance/doc/test_formule.bin trunk/rapport_avance/doc/test_listing_exemple.pdf Modified: trunk/ trunk/rapport_avance/ajax_listing_search_code.php trunk/rapport_avance/ajax_rapav_search_code.php trunk/rapport_avance/include/class_rapav_declaration.php trunk/rapport_avance/include/class_rapav_formulaire.php trunk/rapport_avance/include/class_rapav_listing_compute.php trunk/rapport_avance/include/class_rapav_listing_formula.php trunk/rapport_avance/include/formulaire.inc.php Log: Merged revisions 660-668 via svnmerge from svn+ssh://[email protected]/svn_extension/tag/rel671 ........ r660 | danydb | 2014-01-12 13:59:05 +0100 (dim., 12 janv. 2014) | 1 line Bug compute ........ r661 | danydb | 2014-01-12 17:06:37 +0100 (dim., 12 janv. 2014) | 1 line Bug : better check of duplicate code ........ r662 | danydb | 2014-01-12 17:40:38 +0100 (dim., 12 janv. 2014) | 1 line Add dynamic search ........ r663 | danydb | 2014-01-12 19:05:21 +0100 (dim., 12 janv. 2014) | 1 line reorder properly declaration ........ r664 | danydb | 2014-01-12 20:34:55 +0100 (dim., 12 janv. 2014) | 1 line Check card_saldo ........ r665 | danydb | 2014-01-12 20:40:58 +0100 (dim., 12 janv. 2014) | 1 line Fix bug listing compute ........ r666 | danydb | 2014-01-12 20:41:13 +0100 (dim., 12 janv. 2014) | 1 line remove dead code ........ r667 | danydb | 2014-01-12 20:41:24 +0100 (dim., 12 janv. 2014) | 1 line Add general test ........ r668 | danydb | 2014-01-12 21:12:42 +0100 (dim., 12 janv. 2014) | 1 line Bug attribut ........ Property changes on: trunk ___________________________________________________________________ Name: svnmerge-integrated - /tag/rel671:1-658 + /tag/rel671:1-699 Modified: trunk/rapport_avance/ajax_listing_search_code.php =================================================================== --- trunk/rapport_avance/ajax_listing_search_code.php 2014-02-07 21:17:23 UTC (rev 699) +++ trunk/rapport_avance/ajax_listing_search_code.php 2014-02-07 21:40:00 UTC (rev 700) @@ -31,8 +31,10 @@ from rapport_advanced.listing_param where l_id=$1 order by 2",array($f_id)); echo HtmlInput::title_box('Code Formulaire','search_code_div'); +echo _('Filtre').':'.HtmlInput::filter_table('code_listing_tb','0,1',1); + ?> -<table> +<table id='code_listing_tb'> <tr> <th> Code Modified: trunk/rapport_avance/ajax_rapav_search_code.php =================================================================== --- trunk/rapport_avance/ajax_rapav_search_code.php 2014-02-07 21:17:23 UTC (rev 699) +++ trunk/rapport_avance/ajax_rapav_search_code.php 2014-02-07 21:40:00 UTC (rev 700) @@ -29,8 +29,9 @@ global $cn; $array=$cn->get_array("select p_id,p_code,p_libelle from rapport_advanced.formulaire_param where p_type=3 and f_id=$1 order by 2",array($f_id)); echo HtmlInput::title_box('Code Formulaire','search_code_div'); +echo _('Filtre').':'.HtmlInput::filter_table('code_tb','0,1',1); ?> -<table> +<table id='code_tb'> <tr> <th> Code Copied: trunk/rapport_avance/doc/test_formule.bin (from rev 668, tag/rel671/rapport_avance/doc/test_formule.bin) =================================================================== --- trunk/rapport_avance/doc/test_formule.bin (rev 0) +++ trunk/rapport_avance/doc/test_formule.bin 2014-02-07 21:40:00 UTC (rev 700) @@ -0,0 +1,115 @@ +RAPAV;4 +"Test Formule";"Test sur toutes les formules possibles" +155;C1;"Formule + Formule2";3;110;15;1 +157;PCTVA1OP;"Poste comptable 6 et TVA 1date opération ";3;150;15;1 +158;PCTVA1PAY;"Poste comptable 6 et TVA 1date Paiements";3;160;15;1 +170;T412;"Journaux Achat";6;180;15;1 +161;T42;"Total Code TVA + Poste Comptable";2;220;15;1 +164;PCTVA2ECH;"Poste Comptable 6 et TVA 1 date Echeance";3;260;15;1 +175;T422;"Journaux Achat";6;270;15;1 +176;PCTVA22OP;"Poste comptable 6 et TVA 1date opération ";3;280;15;1 +177;PCTVA22PAY;"Poste comptable 6 et TVA 1date Paiements";3;300;15;1 +183;PCTVA32ECH;"Poste Comptable 6 et TVA 41 date Echeance";3;390;15;1 +156;T4;"Poste comptable et TVA";1;120;15;1 +172;PCTVA12PAY;"Poste comptable 6 et TVA 1date Paiements";3;200;15;1 +173;PCTVA12ECH;"Poste Comptable 6 et TVA 1 date Echeance";3;210;15;1 +174;T421;" tous les journaux";3;230;15;1 +171;PCTVA12OP;"Poste comptable 6 et TVA 1date opération ";3;190;15;1 +162;PCTVA2OP;"Poste comptable 6 et TVA 1date opération ";3;240;15;1 +165;T43;" Poste Comptable";2;310;15;1 +179;T431;"Tous les journaux";6;320;15;1 +168;PCTVA3ECH;"Poste Comptable 6 et TVA 41 date Echeance";3;350;15;1 +153;F70ECH;"Somme 70% date échéance";3;90;15;1 +154;T3;Compute;1;100;15;1 +169;T411;"Tous les journaux";6;140;15;1 +163;PCTVA2PAY;"Poste comptable 6 et TVA 1date Paiements";3;250;15;1 +178;PCTVA22ECH;"Poste Comptable 6 et TVA 1 date Echeance";3;290;15;1 +159;PCTVA1ECH;"Poste Comptable 6 et TVA 1 date Echeance";3;170;15;1 +160;T41;"Total Code TVA";2;130;15;1 +167;PCTVA3PAY;"Poste comptable 6 et TVA 41date Paiements";3;340;15;1 +152;F70PAY;"Somme 70% date paiement";3;80;15;1 +180;T432;"Journaux Achat";6;360;15;1 +181;PCTVA32OP;"Poste comptable 6 et TVA 41date opération ";3;370;15;1 +182;PCTVA32PAY;"Poste comptable 6 et TVA 41date Paiements";3;380;15;1 +151;F70JRN;"Somme 70% Journaux";3;70;15;1 +150;F70OP;"Somme 70% date opération";3;60;15;1 +145;FORMULE;Formule;3;20;15;1 +146;FORMULE2;"Opérateur ternaire sur la formule";3;30;15;1 +147;COMPUTE;"Opérateur ternaire sur la formule via compute";3;40;15;1 +149;T2;Formule;1;50;15;1 +166;PCTVA3OP;"Poste comptable 6 et TVA 41date opération ";3;330;15;1 +188;T5;"Poste Comptable 6 & 41 date opération";1;400;15;1 +189;T51;"Date opération";2;410;15;1 +190;PDC51;"Solde débit - crédit";3;420;15;1 +191;PCD51;"Solde Crédit - débit";3;430;15;1 +192;PD51;Débit;3;440;15;1 +193;PC51;Crédit;3;450;15;1 +194;T52;"Poste Comptable 6 & 41 Date Echéance";2;460;15;1 +195;PDC52;"Solde débit - crédit";3;470;15;1 +196;PCD52;"Solde Crédit - débit";3;480;15;1 +197;PD52;Débit;3;490;15;1 +198;PC52;Crédit;3;500;15;1 +199;T53;"Poste Comptable 6 & 41 Date Paiement";2;510;15;1 +200;PCD53;"Solde débit - crédit";3;520;15;1 +202;PDC53;"Solde Crédit - débit";3;530;15;1 +203;PD53;Débit;3;540;15;1 +204;PC53;Crédit;3;550;15;1 +211;T54;"Poste comptable 6 et 41 limité à un journal";2;560;15;1 +218;OR1;"Solde Débit - Crédit solde du compte 6% utilisé avec 4% rapprochée avec une opération 55% dans la période donnée";3;570;15;1 +213;PCD54;"Solde Crédit - débit";3;580;15;1 +214;PD54;"Débit la date de paiement";3;590;15;1 +215;PC54;"Crédit date d'échéance";3;600;15;1 +217;T6;"Opération rapprochées";1;610;15;1 +212;PDC54;"Solde débit - crédit";3;620;15;1 +222;OR5;"test order";3;630;15;1 +219;OR2;"Solde crédit - débit solde du compte 6% utilisé avec 4% rapprochée avec une opération 55% dans la période donnée";3;640;15;1 +220;OR3;"Débit opération compte 6% utilisé avec 4% rapprochée avec une opération 55% dans la période donnée";3;650;15;1 +221;OR4;"Crédit opération compte 6% utilisé avec 4% rapprochée avec une opération 55% dans la période donnée limité au journal Achat";3;660;15;1 +148;T1;"Test sur opérateur ternaire";1;10;15;1 +RAPAV_DETAIL +134;147;;;"([FORMULE] > 50000)?1:0";;;;3;;;; +136;145;;;[7%]*2.5;;;;1;;;;0 +137;146;;;([70%]>12)?0:-12;;;;1;;;;0 +138;150;;;[70%];;;;1;;;;0 +140;152;;;[70%];;;;1;;;;2 +139;151;;;[70%];;;;1;;;;1 +141;153;;;[70%];;;;1;;;;2 +142;155;;;[FORMULE]+[C1];;;;3;;;; +143;157;6%;1;;;ACH;1;2;;;;0 +144;158;6%;1;;;ACH;1;2;;;;1 +145;159;6%;1;;;ACH;2;2;;;;2 +146;171;6%;1;;;ACH;1;2;;;;0 +148;173;6%;1;;;ACH;1;2;;;;2 +147;172;6%;1;;;ACH;1;2;;;;1 +149;174;7%;1;;;VEN;0;2;;;;0 +150;162;7%;1;;;VEN;1;2;;;;0 +178;213;6%;;;;;;4;41%;2;;0 +151;163;6%;1;;;ACH;0;2;;;;1 +152;164;6%;1;;;ACH;0;2;;;;2 +155;176;6%;1;;;ACH;0;2;;;;0 +157;177;6%;1;;;ACH;0;2;;;;1 +179;214;61%;;;;;;4;41%;3;;1 +156;178;6%;1;;;ACH;0;2;;;;2 +158;166;6%;1;;;ACH;2;2;;;;0 +159;167;6%;1;;;ACH;2;2;;;;1 +160;168;6%;1;;;ACH;2;2;;;;2 +161;181;6%;1;;;ACH;2;2;;;;0 +162;182;6%;1;;;ACH;2;2;;;;1 +163;183;6%;1;;;ACH;2;2;;;;2 +164;190;61%;;;;;;4;41%;1;;0 +165;191;61%;;;;;;4;41%;2;;0 +166;192;61%;;;;;;4;41%;3;;0 +168;193;61%;;;;;;4;41%;4;;0 +169;195;61%;;;;;;4;41%;1;;2 +170;196;61%;;;;;;4;41%;2;;2 +171;197;61%;;;;;;4;41%;3;;2 +172;198;61%;;;;;;4;41%;4;;2 +173;200;61%;;;;;;4;41%;1;;1 +174;202;61%;;;;;;4;41%;2;;1 +175;203;61%;;;;;;4;41%;3;;1 +176;204;61%;;;;;;4;41%;4;;1 +177;212;6%;;;;;;4;41%;1;;0 +180;215;61%;;;;;;4;41%;4;;2 +181;219;61%;;;;;;5;41%;2;55%; +182;220;61%;;;;;;5;41%;3;55%; +183;221;6%;;;;;;4;41%;4;;0 Copied: trunk/rapport_avance/doc/test_listing_exemple.pdf (from rev 668, tag/rel671/rapport_avance/doc/test_listing_exemple.pdf) =================================================================== (Binary files differ) Modified: trunk/rapport_avance/include/class_rapav_declaration.php =================================================================== --- trunk/rapport_avance/include/class_rapav_declaration.php 2014-02-07 21:17:23 UTC (rev 699) +++ trunk/rapport_avance/include/class_rapav_declaration.php 2014-02-07 21:40:00 UTC (rev 700) @@ -1052,7 +1052,7 @@ jrn1.j_poste like $1 $sql_date and - jrn2.j_poste like $2 + jrn2.j_poste like $4 and jrn1.j_debit='f' $filter_ledger Modified: trunk/rapport_avance/include/class_rapav_formulaire.php =================================================================== --- trunk/rapport_avance/include/class_rapav_formulaire.php 2014-02-07 21:17:23 UTC (rev 699) +++ trunk/rapport_avance/include/class_rapav_formulaire.php 2014-02-07 21:40:00 UTC (rev 700) @@ -122,16 +122,27 @@ static function verify_definition(&$p_array) { global $cn; - for ($i=0;$i<count($p_array['p_code']);$i++) + $count_code=count($p_array['p_code']); + for ($i=0;$i<$count_code;$i++) { $c=$cn->get_value('select count(*) from rapport_advanced.formulaire_param where p_code=$1 and p_id <> $2 and f_id=$3', array($p_array['p_code'][$i],$p_array['p_id'][$i],$p_array['f_id'])); if ( $c > 0 ) { - $p_array['p_code'][$i]='C'.$i.microtime(); + $p_array['p_code'][$i]='C'.$i.microtime(false); } } + + for ($i=0;$i<$count_code;$i++) + { + for ($e=0;$e<$count_code;$e++) { + if ($p_array['p_code'][$i] == $p_array['p_code'][$e] && $i != $e) + { + $p_array['p_code'][$e]='C'.$i.microtime(false); + } + } + } } /** @@ -166,6 +177,7 @@ else $form_param->update(); } + // delete checked rows if ( isset ($p_array["del_row"])) { @@ -176,6 +188,17 @@ } } } + // Reorder + // + $order_param=new formulaire_param_sql(); + $ret=$order_param->seek(' where f_id=$1 order by p_order',array($p_array['f_id'])); + $nb_rows=Database::num_row($ret); + for ($i=0;$i < $nb_rows;$i++) + { + $param=$order_param->next($ret,$i); + $param->p_order=($i+1)*10; + $param->update(); + } self::load_file($rapav); } Modified: trunk/rapport_avance/include/class_rapav_listing_compute.php =================================================================== --- trunk/rapport_avance/include/class_rapav_listing_compute.php 2014-02-07 21:17:23 UTC (rev 699) +++ trunk/rapport_avance/include/class_rapav_listing_compute.php 2014-02-07 21:40:00 UTC (rev 700) @@ -126,7 +126,7 @@ */ for ($i = 0; $i < $nb_later; $i++) { - $compute->set_listing_compute($this->data->lc_id); + $a_later[$i]->set_listing_compute($this->data->lc_id); $a_later[$i]->compute($p_date_start, $p_date_end); $a_later[$i]->save_computed(); } Modified: trunk/rapport_avance/include/class_rapav_listing_formula.php =================================================================== --- trunk/rapport_avance/include/class_rapav_listing_formula.php 2014-02-07 21:17:23 UTC (rev 699) +++ trunk/rapport_avance/include/class_rapav_listing_formula.php 2014-02-07 21:40:00 UTC (rev 700) @@ -209,7 +209,9 @@ function display() { global $cn; - $desc = $cn->get_value('select ad_text from attr_def where ad_id=$1', array($this->data->getp('attribut_card'))); + $desc = $cn->get_value('select ad_text from attr_def + where ad_id=$1', array($this->data->getp('attribut_card'))); + return "Utilisant l'attribut " . h($desc); } @@ -239,13 +241,18 @@ function input() { global $cn; + $this->cat = $cn->get_value('select fd_id + from rapport_advanced.listing + where + l_id=$1 + ', array($this->data->getp('listing_id'))); $select = new ISelect('p_attribute'); $select->value = $cn->make_array('select a.ad_id,a.ad_text from attr_def as a join jnt_fic_attr as j on (a.ad_id=j.ad_id) where - fd_id=' . $this->data->getp('listing_id') . ' order by 2'); + fd_id=' .$this->cat . ' order by a.ad_text '); $select->selected = $this->data->getp('attribut_card'); return "Attribut à afficher pour chaque fiche " . $select->input(); @@ -485,6 +492,7 @@ and lf.f_id = $3 ', array($this->detail->lc_id, $search, $this->fiche->f_id)); $formula = str_replace($piece, $value, $formula); + } /** Protect against division by zero */ if (strpos("1" . $formula, "/0.0000") != 0) @@ -637,6 +645,8 @@ // Saldo case 1: case 2: + $card_saldo = ($this->data->lp_card_saldo == 0) ? "jrn1" : "jrn2"; + $card_saldo = ($this->data->lp_card_saldo == 0) ? "jrn1" : "jrn2"; // Compute D-C $sql = " @@ -800,6 +810,7 @@ echo '</p>'; $ck = new ICheckBox('card_saldo'); + $ck->value=1; $ck->set_check($this->data->lp_card_saldo); echo '<p>'; echo 'Prendre le total de la fiche ' . $ck->input(); Modified: trunk/rapport_avance/include/formulaire.inc.php =================================================================== --- trunk/rapport_avance/include/formulaire.inc.php 2014-02-07 21:17:23 UTC (rev 699) +++ trunk/rapport_avance/include/formulaire.inc.php 2014-02-07 21:40:00 UTC (rev 700) @@ -36,7 +36,6 @@ } else { - //echo '<p class="notice">'._(' dernière sauvegarde ').date('d-m-Y H:i').'</p>'; try { RAPAV_formulaire::save_definition($_POST); --- PhpCompta est un logiciel de comptabilité libre en ligne (full web) Projet opensource http://www.phpcompta.eu _______________________________________________ Phpcompta est un logiciel libre de comptabilité en ligne (http://www.phpcompta.eu) Phpcompta-dev mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/phpcompta-dev
