[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r638 - in trunk/rapport_avance: . include
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r638 - in trunk/rapport_avance: . include |
Date: |
Mon, 30 Dec 2013 22:30:26 +0100 (CET) |
Author: danydb
Date: 2013-12-30 22:30:25 +0100 (Mon, 30 Dec 2013)
New Revision: 638
Added:
trunk/rapport_avance/ajax_modify_param_detail.php
Modified:
trunk/rapport_avance/ajax.php
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.php
trunk/rapport_avance/rapav_javascript.js
Log:
Formulaire are done
Modified: trunk/rapport_avance/ajax.php
===================================================================
--- trunk/rapport_avance/ajax.php 2013-12-20 15:09:20 UTC (rev 637)
+++ trunk/rapport_avance/ajax.php 2013-12-30 21:30:25 UTC (rev 638)
@@ -10,7 +10,7 @@
'listing_modify,listing_remove_modele,listing_display_definition,'.
'listing_param_add,save_param_listing,listing_detail_remove,'.
'listing_search_code,rapav_listing_display,parameter_send_mail,send_mail,'
- . 'include_follow,include_follow_save');
+ . 'include_follow,include_follow_save,modify_param_detail');
if ( in_array($act,$a_action ) == true )
{
include 'ajax_'.$act.'.php';
Added: trunk/rapport_avance/ajax_modify_param_detail.php
===================================================================
--- trunk/rapport_avance/ajax_modify_param_detail.php
(rev 0)
+++ trunk/rapport_avance/ajax_modify_param_detail.php 2013-12-30 21:30:25 UTC
(rev 638)
@@ -0,0 +1,88 @@
+<?php
+
+// require_once '.php';
+require_once 'include/class_formulaire_param_detail.php';
+$errcode = 0;
+$fp_id = HtmlInput::default_value_get('fp_id', -1);
+$title="none";$comment="";$tab='none';
+if ($fp_id != -1)
+{
+ $obj = new Formulaire_Param_Detail_SQL($fp_id);
+ switch ($obj->type_detail)
+ {
+ // --- Formula
+ case 1:
+ $obj = new Rapav_Formula($fp_id);
+ $title = "Formule";
+ $comment='
+ <p>
+ Entrez une formule avec des postes comptables, la syntaxe est
la même que celle des "rapports"
+ </p>
+ <p>
+ Exemple : [70%]*0.25+[71%]
+ </p>';
+ $tab='formula';
+ break;
+ // -- Poste comptable et code
+ case 2:
+ $obj = new RAPAV_Account_Tva($fp_id);
+ $title = "Poste Comptable et code TVA";
+ $tab='account_tva';
+ $comment='<p>
+ Entrez un poste comptable et un code de TVA
+ </p>';
+ break;
+ // -- Calcul sur formulaire
+ case 3:
+ $obj = new RAPAV_Compute($fp_id);
+ $title = "Compute";
+ $tab='compute_id';
+ $comment='<p>
+ Entrez une formule avec des codes utilisés dans ce formulaire
+ </p>';
+ break;
+ // -- Poste comptable
+ case 4:
+ $obj = new RAPAV_Account($fp_id);
+ $comment="";
+ $tab='new_account_id';
+ $title = "Poste comptable";
+ break;
+ // -- operation reconciliee
+ case 5:
+ $comment='';
+ $obj = new RAPAV_Reconcile($fp_id);
+ $title = "Opérations rapprochées";
+ $tab="new_reconcile_id";
+ break;
+ default:
+ $errcode = 1;
+ echo HtmlInput::title_box('Erreur', 'param_detail_div');
+ echo "Erreur type formule inconnu";
+ break;
+ }
+} else
+{
+ $errcode = 2;
+ echo HtmlInput::title_box('Erreur', 'param_detail_div');
+ echo _('Paramètre invalide');
+}
+
+if ($errcode == 0)
+{
+ echo HtmlInput::title_box($title, 'param_detail_div');
+ echo '<div class="content" style="padding:10px">';
+ echo $comment;
+ echo '<form method="post"
onsubmit="save_param_detail(\'modify_param_detail_frm\');return false;"
id="modify_param_detail_frm">';
+ $obj->input();
+ echo HtmlInput::hidden('p_id',$obj->p_id);
+ echo HtmlInput::hidden('tab',$tab);
+ echo HtmlInput::hidden('fp_id',$obj->fp_id);
+ echo HtmlInput::hidden('ac',$_REQUEST['ac']);
+ echo HtmlInput::hidden('plugin_code',$_REQUEST['plugin_code']);
+ echo Dossier::hidden();
+ echo HtmlInput::submit('save_modify_param_detail','Sauve');
+ echo '</form>';
+ echo '</div>';
+}
+?>
\ No newline at end of file
Modified: trunk/rapport_avance/ajax_save_param_detail.php
===================================================================
--- trunk/rapport_avance/ajax_save_param_detail.php 2013-12-20 15:09:20 UTC
(rev 637)
+++ trunk/rapport_avance/ajax_save_param_detail.php 2013-12-30 21:30:25 UTC
(rev 638)
@@ -31,11 +31,11 @@
*/
require_once 'class_impress.php';
require_once 'include/class_formulaire_param_detail.php';
-$fp_id = 0;
+$fp_id = HtmlInput::default_value_get('fp_id', '-1');
switch ($tab)
{
case 'account_tva':
- $acc_tva = new RAPAV_Account_Tva();
+ $acc_tva = new RAPAV_Account_Tva($fp_id);
$acc_tva->tva_id = $code_tva;
$acc_tva->tmp_val = $formtva;
$acc_tva->jrn_def_type = $code_jrn;
@@ -50,7 +50,7 @@
$html = "Erreur dans la formule " . $acc_tva->errcode;
} else
{
- $acc_tva->insert();
+ $acc_tva->save();
$code = 'ok';
$fp_id = $acc_tva->fp_id;
$html = '<td>';
@@ -59,14 +59,12 @@
$html.=ob_get_contents();
ob_end_clean();
$html.= '</td>';
- $html.='<td id="del_' . $acc_tva->fp_id . '">';
- $html.=HtmlInput::anchor("Effacer", "",
sprintf("onclick=\"delete_param_detail('%s','%s','%s','%s')\""
- , $_REQUEST['plugin_code'],
$_REQUEST['ac'], $_REQUEST['gDossier'], $acc_tva->fp_id));
- $html.= '</td>';
+ $html.=$acc_tva->button_delete();
+ $html.=$acc_tva->button_modify();
}
break;
case 'formula':
- $acc_formula = new RAPAV_Formula();
+ $acc_formula = new RAPAV_Formula($fp_id);
$acc_formula->fp_formula = $formula_new;
$acc_formula->p_id = $p_id;
$acc_formula->type_detail = 1;
@@ -78,7 +76,7 @@
$html = $acc_formula->errcode;
} else
{
- $acc_formula->insert();
+ $acc_formula->save();
$fp_id = $acc_formula->fp_id;
$code = 'ok';
$html = '<td>';
@@ -87,14 +85,12 @@
$html.=ob_get_contents();
ob_end_clean();
$html.= '</td>';
- $html.='<td id="del_' . $acc_formula->fp_id . '">';
- $html.=HtmlInput::anchor("Effacer", "",
sprintf("onclick=\"delete_param_detail('%s','%s','%s','%s')\""
- , $_REQUEST['plugin_code'],
$_REQUEST['ac'], $_REQUEST['gDossier'], $acc_formula->fp_id));
- $html.='</td>';
+ $html.=$acc_formula->button_delete();
+ $html.=$acc_formula->button_modify();
}
break;
case 'compute_id':
- $acc_compute = new RAPAV_Compute();
+ $acc_compute = new RAPAV_Compute($fp_id);
$acc_compute->fp_formula = $form_compute;
$acc_compute->p_id = $p_id;
$acc_compute->type_detail = 3;
@@ -105,7 +101,7 @@
$html = $acc_compute->errcode;
} else
{
- $acc_compute->insert();
+ $acc_compute->save();
$fp_id = $acc_compute->fp_id;
$code = 'ok';
$html = '<td>';
@@ -114,14 +110,12 @@
$html.=ob_get_contents();
ob_end_clean();
$html.= '</td>';
- $html.='<td id="del_' . $acc_compute->fp_id . '">';
- $html.=HtmlInput::anchor("Effacer", "",
sprintf("onclick=\"delete_param_detail('%s','%s','%s','%s')\""
- , $_REQUEST['plugin_code'],
$_REQUEST['ac'], $_REQUEST['gDossier'], $acc_compute->fp_id));
- $html.='</td>';
+ $html.=$acc_compute->button_delete();
+ $html.=$acc_compute->button_modify();
}
break;
case 'new_account_id':
- $acc_account = new RAPAV_Account();
+ $acc_account = new RAPAV_Account($fp_id);
$acc_account->tmp_val = $account_first;
$acc_account->with_tmp_val = $account_second;
$acc_account->p_id = $p_id;
@@ -135,7 +129,7 @@
$html = $acc_account->errcode;
} else
{
- $acc_account->insert();
+ $acc_account->save();
$fp_id = $acc_account->fp_id;
$code = 'ok';
$html = '<td>';
@@ -144,15 +138,13 @@
$html.=ob_get_contents();
ob_end_clean();
$html.= '</td>';
- $html.='<td id="del_' . $acc_account->fp_id . '">';
- $html.=HtmlInput::anchor("Effacer", "",
sprintf("onclick=\"delete_param_detail('%s','%s','%s','%s')\""
- , $_REQUEST['plugin_code'],
$_REQUEST['ac'], $_REQUEST['gDossier'], $acc_account->fp_id));
- $html.='</td>';
+ $html.=$acc_account->button_delete();
+ $html.=$acc_account->button_modify();
}
break;
case 'new_reconcile_id':
- $acc_account = new RAPAV_Reconcile();
+ $acc_account = new RAPAV_Reconcile($fp_id);
$acc_account->tmp_val = $acrec_first;
$acc_account->with_tmp_val = $acrec_second;
$acc_account->operation_pcm_val = $acrec_third;
@@ -166,7 +158,7 @@
$html = $acc_account->errcode;
} else
{
- $acc_account->insert();
+ $acc_account->save();
$fp_id = $acc_account->fp_id;
$code = 'ok';
$html = '<td>';
@@ -175,10 +167,8 @@
$html.=ob_get_contents();
ob_end_clean();
$html.= '</td>';
- $html.='<td id="del_' . $acc_account->fp_id . '">';
- $html.=HtmlInput::anchor("Effacer", "",
sprintf("onclick=\"delete_param_detail('%s','%s','%s','%s')\""
- , $_REQUEST['plugin_code'],
$_REQUEST['ac'], $_REQUEST['gDossier'], $acc_account->fp_id));
- $html.='</td>';
+ $html.=$acc_account->button_delete();
+ $html.=$acc_account->button_modify();
}
break;
}
Modified: trunk/rapport_avance/include/class_formulaire_param.php
===================================================================
--- trunk/rapport_avance/include/class_formulaire_param.php 2013-12-20
15:09:20 UTC (rev 637)
+++ trunk/rapport_avance/include/class_formulaire_param.php 2013-12-30
21:30:25 UTC (rev 638)
@@ -408,10 +408,8 @@
echo '<td>';
echo $formula->display_row();
echo '</td>';
- echo "<td id=\"del_" . $formula->fp_id . "\">";
- echo HtmlInput::anchor("Effacer", "",
sprintf("onclick=\"delete_param_detail('%s','%s','%s','%s')\""
- ,
$_REQUEST['plugin_code'], $_REQUEST['ac'], $_REQUEST['gDossier'],
$formula->fp_id));
- echo '</td>';
+ echo $formula->button_delete();
+ echo $formula->button_modify();
echo '</tr>';
}
if ($max == 0)
Modified: trunk/rapport_avance/include/class_formulaire_param_detail.php
===================================================================
--- trunk/rapport_avance/include/class_formulaire_param_detail.php
2013-12-20 15:09:20 UTC (rev 637)
+++ trunk/rapport_avance/include/class_formulaire_param_detail.php
2013-12-30 21:30:25 UTC (rev 638)
@@ -43,6 +43,61 @@
require_once 'template/param_detail_new.php';
}
+ function button_delete()
+ {
+ $html='<td id="del_' . $this->fp_id . '">';
+ $html.=HtmlInput::anchor("Effacer", "",
sprintf("onclick=\"delete_param_detail('%s','%s','%s','%s')\""
+ , $_REQUEST['plugin_code'], $_REQUEST['ac'],
$_REQUEST['gDossier'], $this->fp_id));
+ $html.= '</td>';
+ return $html;
+ }
+ function button_modify()
+ {
+ $html='<td id="mod_' . $this->fp_id . '">';
+ $html.=HtmlInput::anchor("Modifier", "",
sprintf("onclick=\"modify_param_detail('%s','%s','%s','%s')\""
+ , $_REQUEST['plugin_code'], $_REQUEST['ac'],
$_REQUEST['gDossier'], $this->fp_id));
+ $html.= '</td>';
+ return $html;
+ }
+ /**
+ * display a choice of ledger
+ * @global cn
+ */
+ function input_ledger()
+ {
+ global $cn;
+ $select = new ISelect('p_ledger');
+ $a_ledger = $cn->make_array('select jrn_def_id,jrn_def_name from
jrn_def order by 2', 1);
+ $a_ledger[0]['label'] = '-- Tous les journaux -- ';
+ $select->value = $a_ledger;
+ if ( $this->fp_id != -1)
+ {
+ $select->selected=$this->jrn_def_id;
+ }
+
+ echo '<p> Filtrage par journal ' . $select->input() . '</p>';
+ }
+
+ /**
+ * Display a select for the date
+ */
+ function input_date_paiement()
+ {
+ $s_date = new ISelect('p_paid');
+ $s_date->value = array();
+ $s_date->value[] = array("value" => 0, "label" => 'Date d\'opération');
+ $s_date->value[] = array("value" => 1, "label" => 'Date de paiement');
+ $s_date->value[] = array("value" => 2, "label" => 'Date d\'échéance');
+ echo '<p> Si la date donnée concerne la date de paiement ou
d\'écheance, cela limitera la recherche aux journaux VEN et ACH ';
+ echo HtmlInput::infobulle(36);
+ if ( $this->fp_id != -1)
+ {
+ $s_date->selected=$this->date_paid;
+ }
+ echo $s_date->input();
+ echo '</p>';
+ }
+
}
class RAPAV_Formula extends Formulaire_Param_Detail
@@ -55,9 +110,13 @@
printf("Résultat de la formule %s utilisant $ledger %s",
$this->fp_formula, $paid);
}
- static function new_row()
+ function input()
{
$account = new IPoste("formula_new", "", "form_id");
+ if ($this->fp_id != -1)
+ {
+ $account->value=$this->fp_formula;
+ }
$account->size = 50;
$account->label = _("Recherche poste");
$account->set_attribute('gDossier', dossier::id());
@@ -66,15 +125,19 @@
$account->set_attribute('noquery', 1);
$account->set_attribute('account', $account->id);
echo $account->input();
- RAPAV::input_date_paiement();
- RAPAV::input_ledger();
+ $this->input_date_paiement();
+ $this->input_ledger();
}
-
+ static function new_row()
+ {
+ $obj=new RAPAV_Formula();
+ $obj->input();
+ }
function verify()
{
global $errcode;
$ret = RAPAV::verify_compute($this->fp_formula);
- $this->errocode=$errcode;
+ $this->errcode = $errcode;
return $ret;
}
@@ -86,13 +149,13 @@
function display_row()
{
global $cn;
- $ledger = RAPAV::get_ledger_name($this->jrn_def_id);;
+ $ledger = RAPAV::get_ledger_name($this->jrn_def_id);
$type_total = $cn->get_value("select tt_label from
rapport_advanced.total_type where tt_id=$1", array($this->tt_id));
$paid = RAPAV::str_date_type($this->date_paid);
printf("Poste comptable %s avec le code tva %s (%s) dans le journal de
type %s [ %s ] $ledger %s", $this->tmp_val, $this->tva_id, $this->tva_id,
$this->jrn_def_type, $type_total, $paid);
}
- static function new_row()
+ function input()
{
global $cn;
$account = new IPoste("formtva", "", "formtva_id");
@@ -101,17 +164,19 @@
$account->set_attribute('gDossier', dossier::id());
$account->set_attribute('noquery', 1);
$account->set_attribute('account', $account->id);
+ $account->value=$this->tmp_val;
$tva = new ITva_Popup("code_tva");
$tva->id = HtmlInput::generate_id("code_tva");
$tva->set_attribute('gDossier', dossier::id());
-
+ $tva->value=$this->tva_id;
// Jrn type
$select = new ISelect('code_jrn');
$select->value = array(
array('value' => 'VEN', 'label' => 'journaux Vente'),
array('value' => 'ACH', 'label' => 'journaux Achat')
);
+ $select->selected=$this->jrn_def_type;
echo '<table>';
echo '<tr><td>Poste comptable</td>';
echo td($account->input());
@@ -123,14 +188,19 @@
echo '</tr>';
$code_base = new ISelect('code_base');
$code_base->value = $cn->make_array("select tt_id,tt_label from
rapport_advanced.total_type order by 2");
+ $code_base->selected=$this->tt_id;
echo td("Type de total");
echo td($code_base->input());
echo '</tr>';
echo '</table>';
- RAPAV::input_date_paiement();
- RAPAV::input_ledger();
+ $this->input_date_paiement();
+ $this->input_ledger();
}
-
+ static function new_row()
+ {
+ $obj=new RAPAV_Account_Tva();
+ $obj->input();
+ }
function verify()
{
global $cn;
@@ -157,21 +227,27 @@
printf("Total des codes du formulaire %s", $this->fp_formula);
}
- static function new_row($p_id)
+ function input()
{
global $cn;
- $f_id = $cn->get_value("select f_id from
rapport_advanced.formulaire_param where p_id=$1", array($p_id));
+ $f_id = $cn->get_value("select f_id from
rapport_advanced.formulaire_param where p_id=$1", array($this->p_id));
$account = new IText("form_compute");
$account->size = 50;
+ $account->value=$this->fp_formula;
echo $account->input();
echo HtmlInput::button('rapav_search_code_bt', 'Cherche codes',
sprintf(" onclick=\"rapav_search_code('%s','%s','%s','%s')\"", $_REQUEST['ac'],
$_REQUEST['plugin_code'], $_REQUEST['gDossier'], $f_id));
}
-
+ static function new_row($p_id)
+ {
+ $obj=new RAPAV_Compute();
+ $obj->p_id=$p_id;
+ $obj->input();
+ }
function verify()
{
global $errcode;
- $ret = RAPAV::verify_compute($this->p_formula);
- $this->errocode=$errcode;
+ $ret = RAPAV::verify_compute($this->fp_formula);
+ $this->errcode = $errcode;
return $ret;
}
@@ -186,21 +262,22 @@
function display_row()
{
global $cn;
- $ledger = RAPAV::get_ledger_name($this->jrn_def_id);;
+ $ledger = RAPAV::get_ledger_name($this->jrn_def_id);
$paid = RAPAV::str_date_type($this->date_paid);
$total_type_account = $cn->get_value('select tt_label from
rapport_advanced.total_type_account where tt_id=$1',
array($this->type_sum_account));
printf("Total %s poste comptable %s utilisé avec le poste comptable %s
utilisant $ledger %s", $total_type_account, $this->tmp_val,
$this->with_tmp_val, $paid);
}
- static function new_row($p_id)
+ function input()
{
global $cn;
$sum_type = new ISelect('account_sum_type');
$sum_type->value = $cn->make_array("select tt_id, tt_label from
rapport_advanced.total_type_account ");
-
+ $sum_type->selected=$this->type_sum_account;
$account = new IPoste("account_first", "", "account_first_id");
$account->size = 10;
$account->label = _("Recherche poste");
+ $account->value=$this->tmp_val;
$account->set_attribute('gDossier', dossier::id());
$account->set_attribute('account', $account->id);
@@ -209,6 +286,7 @@
$account_second->label = _("Recherche poste");
$account_second->set_attribute('gDossier', dossier::id());
$account_second->set_attribute('account', $account_second->id);
+ $account_second->value=$this->with_tmp_val;
echo '<p>';
echo 'Calculer ';
echo $sum_type->input();
@@ -221,10 +299,14 @@
echo ' utilisé avec le poste comptable ' . HtmlInput::infobulle(203);
echo $account_second->input();
echo '</p>';
- RAPAV::input_date_paiement();
- RAPAV::input_ledger();
+ $this->input_date_paiement();
+ $this->input_ledger();
}
-
+ static function new_row()
+ {
+ $obj=new RAPAV_Account();
+ $obj->input();
+ }
function verify()
{
@@ -248,34 +330,38 @@
{
global $cn;
$total_type_account = $cn->get_value('select tt_label from
rapport_advanced.total_type_account where tt_id=$1',
array($this->type_sum_account));
- $ledger = RAPAV::get_ledger_name($this->jrn_def_id);;
+ $ledger = RAPAV::get_ledger_name($this->jrn_def_id);
printf("Total %s poste comptable %s utilisé avec le poste comptable %s
rapprochée dans la période donnée
avec une opération utilisant le poste comptable %s
utilisant $ledger", $total_type_account, $this->tmp_val, $this->with_tmp_val,
$this->operation_pcm_val);
}
- static function new_row($p_id)
+ function input()
{
global $cn;
$sum_type = new ISelect('account_sum_type');
$sum_type->value = $cn->make_array("select tt_id, tt_label from
rapport_advanced.total_type_account ");
-
+ $sum_type->selected=$this->type_sum_account;
$account = new IPoste("acrec_first", "", "acrec_first_id");
$account->size = 10;
$account->label = _("Recherche poste");
$account->set_attribute('gDossier', dossier::id());
$account->set_attribute('account', $account->id);
+ $account->value=$this->tmp_val;
$account_second = new IPoste("acrec_second", "", "acrec_second_id");
$account_second->size = 10;
$account_second->label = _("Recherche poste");
$account_second->set_attribute('gDossier', dossier::id());
$account_second->set_attribute('account', $account_second->id);
-
+ $account_second->value=$this->with_tmp_val;
+
$account_third = new IPoste("acrec_third", "", "acrec_third_id");
$account_third->size = 10;
$account_third->label = _("Recherche poste");
$account_third->set_attribute('gDossier', dossier::id());
$account_third->set_attribute('account', $account_third->id);
+ $account_third->value=$this->operation_pcm_val;
+
echo '<p>';
echo 'Calculer ';
echo $sum_type->input();
@@ -293,9 +379,13 @@
echo $account_third->input();
echo '</p>';
- RAPAV::input_ledger();
+ $this->input_ledger();
}
-
+ static function new_row()
+ {
+ $obj=new RAPAV_Reconcile();
+ $obj->input();
+ }
function verify()
{
Modified: trunk/rapport_avance/include/class_rapav.php
===================================================================
--- trunk/rapport_avance/include/class_rapav.php 2013-12-20 15:09:20 UTC
(rev 637)
+++ trunk/rapport_avance/include/class_rapav.php 2013-12-30 21:30:25 UTC
(rev 638)
@@ -34,38 +34,9 @@
return $ledger;
}
- /**
- * display a choice of ledger
- * @global cn
- */
- static function input_ledger()
- {
- global $cn;
- $select = new ISelect('p_ledger');
- $a_ledger = $cn->make_array('select jrn_def_id,jrn_def_name from
jrn_def order by 2', 1);
- $a_ledger[0]['label'] = '-- Tous les journaux -- ';
- $select->value = $a_ledger;
+
- echo '<p> Filtrage par journal ' . $select->input() . '</p>';
- }
-
/**
- * Display a select for the date
- */
- static function input_date_paiement()
- {
- $s_date = new ISelect('p_paid');
- $s_date->value = array();
- $s_date->value[] = array("value" => 0, "label" => 'Date d\'opération');
- $s_date->value[] = array("value" => 1, "label" => 'Date de paiement');
- $s_date->value[] = array("value" => 2, "label" => 'Date d\'échéance');
- echo '<p> Si la date donnée concerne la date de paiement ou
d\'écheance, cela limitera la recherche aux journaux VEN et ACH ';
- echo HtmlInput::infobulle(36);
- echo $s_date->input();
- echo '</p>';
- }
-
- /**
* Compute the string to display for date
* @param $p_type
* @return string
@@ -151,10 +122,11 @@
// remove the valid
preg_match_all("/\[([A-Z]*[0-9]*)*([0-9]*[A-Z]*)\]/i", $formula, $e);
- $formula = preg_replace("/\[([A-Z]*[0-9]*)*([0-9]*[A-Z]*)\]/i", '',
$formula);
+ $formula = preg_replace("/\[([A-Z]*[0-9]*)*([0-9]*[A-Z]*)%*\]/i", '',
$formula);
$formula = preg_replace('/([0-9]+.{0,1}[0.9]*)*(\+|-|\*|\/)*/', '',
$formula);
$formula = preg_replace('/(\(|\))/', '', $formula);
$formula = preg_replace('/\s/', '', $formula);
+ $formula = preg_replace('/FROM=/', '', $formula);
// if something remains it should be a mistake
if ($formula != '')
Modified: trunk/rapport_avance/rapav_javascript.js
===================================================================
--- trunk/rapport_avance/rapav_javascript.js 2013-12-20 15:09:20 UTC (rev
637)
+++ trunk/rapport_avance/rapav_javascript.js 2013-12-30 21:30:25 UTC (rev
638)
@@ -113,6 +113,41 @@
alert("add_param_detail" + e.message);
}
}
+function modify_param_detail(plugin_code,ac,dossier,fp_id)
+{
+ try
+ {
+ var querystring = 'plugin_code=' + plugin_code + '&ac=' + ac +
'&gDossier=' + dossier + '&act=modify_param_detail' + "&fp_id=" + fp_id;
+ waiting_box();
+ var action = new Ajax.Request(
+ "ajax.php",
+ {
+ method: 'get',
+ parameters: querystring,
+ onFailure: error_get_predef,
+ onSuccess: function(req) {
+ remove_waiting_box();
+ removeDiv('param_detail_div');
+ var nTop = calcy(90);
+ var nLeft = "200px";
+ var str_style = "top:" + nTop + "px;left:" + nLeft +
";width:70em;height:auto";
+ add_div({
+ id: 'param_detail_div',
+ style: str_style,
+ cssclass: 'inner_box',
+ drag: 1
+ });
+ $('param_detail_div').innerHTML = req.responseText;
+ req.responseText.evalScripts();
+ }
+ }
+ );
+
+ } catch (e)
+ {
+ alert("add_param_detail" + e.message);
+ }
+}
/**
address@hidden display a popup and let you select an existing code
*/
@@ -292,12 +327,18 @@
var afpid =
answer.getElementsByTagName('fp_id');
var fp_id = afpid[0].firstChild.nodeValue;
var p_id = ap_id[0].firstChild.nodeValue;
- // Ajoute une ligne avec résultat
- var mytable = g("table_" + p_id).tBodies[0];
- var nNumberRow = mytable.rows.length;
- var oRow = mytable.insertRow(nNumberRow);
- oRow.id = "tr_" + fp_id;
- oRow.innerHTML = code_html;
+ var update=$('tr_'+fp_id);
+ if ( update== undefined )
+ {
+ // Ajoute une ligne avec résultat
+ var mytable = g("table_" +
p_id).tBodies[0];
+ var nNumberRow = mytable.rows.length;
+ var oRow = mytable.insertRow(nNumberRow);
+ oRow.id = "tr_" + fp_id;
+ oRow.innerHTML = code_html;
+ } else {
+ $(update).innerHTML=code_html;
+ }
removeDiv('param_detail_div');
}
---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r638 - in trunk/rapport_avance: . include,
phpcompta-dev <=