diff --git a/doc/developper/Doxyfile b/doc/developper/Doxyfile index 5cf03c545..c827a12e4 100644 --- a/doc/developper/Doxyfile +++ b/doc/developper/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = noalyss # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = Version-7 +PROJECT_NUMBER = Version-7.1 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. @@ -656,7 +656,7 @@ RECURSIVE = YES # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. -EXCLUDE = ../../html/addon ../../include/tfpdf ../../unit-test ../../include/ext ../../include/config.inc.php +EXCLUDE = ../../html/addon ../../unit-test ../../include/ext ../../include/config.inc.php # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded diff --git a/html/ajax_misc.php b/html/ajax_misc.php index c209d9d32..ef7ac145c 100644 --- a/html/ajax_misc.php +++ b/html/ajax_misc.php @@ -191,6 +191,8 @@ $path = array( "ledger_show"=>"ajax_ledger_show", //Show the available distribution keys for analytic "anc_key_choice"=>"ajax_anc_key_choice" , + //Clean the detail for analytic + "anc_key_clean"=>"ajax_anc_key_clean" , // Show the activities computed with the selected distribution key "anc_key_compute"=>"ajax_anc_key_compute" , //From admin, revoke the access to a folder from an user diff --git a/html/extension.raw.php b/html/extension.raw.php index 728aafacc..d8f8abb72 100644 --- a/html/extension.raw.php +++ b/html/extension.raw.php @@ -34,7 +34,7 @@ require_once NOALYSS_INCLUDE.'/lib/iselect.class.php'; require_once NOALYSS_INCLUDE.'/class/user.class.php'; global $g_user,$cn,$g_parameter; - +$http=new HttpInput(); $cn=Dossier::connect(); $g_user=new User($cn); $g_user->check(); @@ -42,7 +42,7 @@ $only_plugin=$g_user->check_dossier(dossier::id()); set_language(); $ext=new Extension($cn); -if ( $ext->search($_REQUEST['plugin_code']) != -1 ) +if ( $ext->search($http->request("plugin_code")) != -1 ) { /* security */ if ( !isset ($_SESSION['g_user']) || $ext->can_request($_SESSION['g_user']) == 0 ) diff --git a/html/js/anc_script.js b/html/js/anc_script.js index d18e81a86..ce7cc580a 100644 --- a/html/js/anc_script.js +++ b/html/js/anc_script.js @@ -491,6 +491,55 @@ function anc_key_choice(p_dossier, p_table, p_amount,p_ledger) error_message(e.message); } } + +/** + * reset all the details of a row + * @param p_dossier is the dossier + * @param p_table the table id of the target + * @param p_amount amount to distribute + * @param p_ledger ledger id + * @param p_jrnx_id jrnx.id + */ +function anc_key_clean(p_dossier, p_table, p_amount,p_ledger,p_jrnx_id,p_sequence) +{ + waiting_box(); + var op = 'op=anc_key_clean'; + var queryString = op + "&gDossier=" + p_dossier + "&t=" + p_table + "&amount=" + p_amount+"&jrnx_id="+p_jrnx_id+'&p_seq='+p_sequence; + try { + queryString+='&led='+p_ledger; + var action = new Ajax.Request( + "ajax_misc.php", + { + method: 'get', + parameters: queryString, + onFailure: error_box, + onSuccess: function(req, json) { + try + { + var answer = req.responseXML; + remove_waiting_box(); + var html = answer.getElementsByTagName('code'); + if (html.length == 0) { + var rec = req.responseText; + alert_box('erreur :' + rec); + } + + var code_html = getNodeText(html[0]); // Firefox ne prend que les 4096 car. + code_html = unescape_xml(code_html); + $(p_table+"t"+p_sequence).innerHTML=code_html; + } catch (e) + { + error_message(e.message); + } + } + } + + ); + + } catch (e) { + error_message(e.message); + } +} /** * Add a row for distribution key. * This function add a row in the table key distribution diff --git a/include/ajax/ajax_anc_key_clean.php b/include/ajax/ajax_anc_key_clean.php new file mode 100644 index 000000000..6944c92f6 --- /dev/null +++ b/include/ajax/ajax_anc_key_clean.php @@ -0,0 +1,76 @@ +get("amount", "number"); + $table_id=$http->get("t"); + $ledger=$http->get('led',"number"); + $jrnx_id=$http->get("jrnx_id","string",""); + $sequence=$http->get("p_seq","number"); +} +catch (Exception $exc) +{ + error_log($exc->getTraceAsString()); + return; +} + + +require_once 'class/anc_operation.class.php'; +global $g_user; + +if ($g_user->get_ledger_access($ledger)=='W') +{ + ob_start(); + $anc_op = new Anc_Operation($cn); + $anc_op->j_id = $jrnx_id; + $anc_op->in_div= $t ; + + /* compute total price */ + bcscale(2); +// echo $anc_op->display_table(1, $amount, $t); + echo $anc_op->display_form_plan(NULL,1,1,$sequence,$amount,$table_id,FALSE); + + $response = ob_get_clean(); +} else { + $response = _("Interdit"); +} +$html = escape_xml($response); +header('Content-type: text/xml; charset=UTF-8'); +echo << + + +$html + +EOF; +?> \ No newline at end of file diff --git a/include/ajax/ajax_anc_search.php b/include/ajax/ajax_anc_search.php index 5a4711ce1..00c114e5c 100644 --- a/include/ajax/ajax_anc_search.php +++ b/include/ajax/ajax_anc_search.php @@ -52,8 +52,11 @@ echo $texte->input(); echo ''; echo dossier::hidden(); $hid=new IHidden(); -echo $hid->input("c1",$_REQUEST['c1']); -echo $hid->input("c2",$_REQUEST['c2']); +$c1=$http->request('c1'); +$c2=$http->request('c2'); + +echo $hid->input("c1",$c1); +echo $hid->input("c2",$c2); echo $hid->input("go"); echo HtmlInput::submit("go",_("Recherche")); echo ''; @@ -61,15 +64,15 @@ echo ''; if ( isset($_REQUEST['go'])) { $cn=Dossier::connect(); - $plan=new Anc_Plan($cn,$_REQUEST['c2']); - $plan->pa_id=$_REQUEST['c2']; + $plan=new Anc_Plan($cn,$c2); + $plan->pa_id=$c2; if ( $plan->exist()==false) exit(_("Ce plan n'existe pas")); - + $plabel=$http->request("plabel"); $sql="select po_name , po_description from poste_analytique ". "where pa_id=$1 and ". " (po_name ~* $2 or po_description ~* $3) order by po_name"; - $array=$cn->get_array($sql,array($_REQUEST['c2'],$_REQUEST['plabel'],$_REQUEST['plabel'])); + $array=$cn->get_array($sql,array($_c2,$plabel,$plabel)); if (empty($array) == true) { @@ -81,7 +84,7 @@ if ( isset($_REQUEST['go'])) foreach ($array as $line) { $js=sprintf("onclick=\"$('%s').value='%s';removeDiv('%s')\"", - $_REQUEST['c1'], + $c1, $line['po_name'],$ctl); echo ''. diff --git a/include/ajax/ajax_periode.php b/include/ajax/ajax_periode.php index df7af35ac..367546ef2 100644 --- a/include/ajax/ajax_periode.php +++ b/include/ajax/ajax_periode.php @@ -234,37 +234,7 @@ switch ($act) $a_answer["content"]=$ex->getMessage(); } break; -// case "add_per": -// $per=new Periode($cn, $periode_id); -// $per->load(); -// -// $p_exercice=new ISelect('p_exercice'); -// $p_exercice->value=$cn->make_array("select distinct p_exercice,p_exercice from parm_periode order by 1 desc"); -// $title=_('Ajout période'); -// $title_par="

"._('On ne peut ajouter une période que sur un exercice qui existe'). -// "

"; -// -// $p_start=new IDate('p_start'); -// $p_end=new IDate('p_end'); -// -// $html=''; -// $html.=HtmlInput::title_box($title, 'mod_periode'); -// $html.=$title_par; -// $html.='
' ; -// $html.=HtmlInput::hidden("ac", $http->post("ac")); -// $html.=Dossier::hidden(); -// $html.=''; -// -// $html.=tr(td(_(' Début période : ')).td($p_start->input())); -// $html.=tr(td(_(' Fin période : ')).td($p_end->input())); -// $html.=tr(td(_(' Exercice : ')).td($p_exercice->input())); -// $html.='
'; -// $html.=HtmlInput::submit('add_per', _('sauver')); -// $html.=HtmlInput::button('close', _('fermer'), -// 'onclick="removeDiv(\'mod_periode\')"'); -// $html.='
'; -// $a_answer['content']=$html; -// break; + case 'insert_periode': try { diff --git a/include/class/anc_group_operation.class.php b/include/class/anc_group_operation.class.php index 05f519981..c5e45061d 100644 --- a/include/class/anc_group_operation.class.php +++ b/include/class/anc_group_operation.class.php @@ -114,6 +114,7 @@ class Anc_Group_Operation $wDescription->input().""; $Plan=new Anc_Plan($this->db); $aPlan=$Plan->get_list(); + $this->a_operation=(empty($this->a_operation))?[]:$this->a_operation; $max=(count($this->a_operation)<$this->nMaxRow)?$this->nMaxRow:count($this->a_operation); $ret.=''; /* show 10 rows */ diff --git a/include/class/anc_operation.class.php b/include/class/anc_operation.class.php index 9726ac317..d6f7b59f9 100644 --- a/include/class/anc_operation.class.php +++ b/include/class/anc_operation.class.php @@ -642,6 +642,22 @@ class Anc_Operation $button_key->name="js".$p_id.$p_seq; $button_key->label=_("Clef"); $result .= $button_key->input(); + /** + * Add a button to clean the detail + */ + $button_clean=new IButton(); + $button_clean->javascript=sprintf("anc_key_clean('%s','%s','%s','%s','%s','%s');", + $gDossier, + $p_id, + $p_amount, + $ledger, + $this->j_id, + $p_seq + ); + $button_clean->name=uniqid(); + $button_clean->label=_("Efface détail"); + $result.=$button_clean->input(); + } diff --git a/include/class/document.class.php b/include/class/document.class.php index a703f7b7e..a58f1de64 100644 --- a/include/class/document.class.php +++ b/include/class/document.class.php @@ -949,6 +949,7 @@ class Document /* if we do not use vat this var. is not set */ if ( !isset(${$tva}) ) return ''; if ( !isset (${'e_march'.$this->counter}) ) return ""; + if ( !isset (${$tva}) ) return ""; // check that something is sold if ( ${$price} == 0 || ${$qt} == 0 || strlen(trim( $price )) ==0 @@ -964,6 +965,7 @@ class Document $price='e_march'.$this->counter.'_price' ; $tva='e_march'.$this->counter.'_tva_id'; if ( !isset (${'e_march'.$this->counter}) ) return ""; + if ( !isset (${$tva}) ) return ""; // check that something is sold if ( ${$price} == 0 || ${$qt} == 0 || strlen(trim( $price )) ==0 @@ -981,6 +983,7 @@ class Document $price='e_march'.$this->counter.'_price' ; $tva='e_march'.$this->counter.'_tva_id'; if ( !isset (${'e_march'.$this->counter}) ) return ""; + if ( !isset (${$tva}) ) return ""; // check that something is sold if ( ${$price} == 0 || ${$qt} == 0 || strlen(trim( $price )) ==0 diff --git a/include/class/periode_ledger_table.class.php b/include/class/periode_ledger_table.class.php index d3b9c28b0..263b23105 100644 --- a/include/class/periode_ledger_table.class.php +++ b/include/class/periode_ledger_table.class.php @@ -73,7 +73,7 @@ class Periode_Ledger_Table } function get_resource_periode_ledger($p_ledger_id) { - $ret=$this->cn->exec_sql($this->sql." where jrn_def_id = $1 order by p_start desc",[$p_ledger_id]); + $ret=$this->cn->exec_sql($this->sql." where jrn_def_id = $1 order by p_start asc",[$p_ledger_id]); return $ret; } /** diff --git a/include/class/print_ledger_detail_item.class.php b/include/class/print_ledger_detail_item.class.php index a92ea36ad..745fea52b 100644 --- a/include/class/print_ledger_detail_item.class.php +++ b/include/class/print_ledger_detail_item.class.php @@ -25,6 +25,8 @@ */ require_once NOALYSS_INCLUDE.'/class/acc_ledger_sold.class.php'; require_once NOALYSS_INCLUDE.'/class/acc_ledger_purchase.class.php'; +require_once NOALYSS_INCLUDE.'/class/pdf_land.class.php'; + class Print_Ledger_Detail_Item extends PDFLand { public function __construct (Database $p_cn,Acc_Ledger $p_jrn) diff --git a/include/lib/data_sql.class.php b/include/lib/data_sql.class.php index e3bdb1656..ac5e6d94f 100644 --- a/include/lib/data_sql.class.php +++ b/include/lib/data_sql.class.php @@ -70,7 +70,7 @@ */ abstract class Data_SQL { - private $cn; //! Database connection + var $cn; //! Database connection var $name; //! Array of logical and real name var $primary_key; //! Column name of the primary key var $type; //! Type of the data diff --git a/include/periode.inc.php b/include/periode.inc.php index 36791c454..095419064 100644 --- a/include/periode.inc.php +++ b/include/periode.inc.php @@ -81,16 +81,17 @@ $wSel->value=$sel_jrn; $wSel->name='jrn_def_id'; $wSel->selected=$p_ledger_id; echo _("Choisissez global ou uniquement le journal à fermer").$wSel->input(); -echo HtmlInput::submit('choose', 'Valider'); -echo HtmlInput::hidden('ac', $_REQUEST['ac']); -echo ""; +echo HtmlInput::hidden('ac', $http->request('ac')); // display a filter by exercice echo _("Montrer l'exercice"); $max_exercice=$cn->get_value("select max(p_exercice) from parm_periode"); -$p_exercice=$http->request("p_exercice","string",$max_exercice); +$p_exercice=$http->request("p_exercice_sel","string",$max_exercice); Periode::filter_exercice($p_exercice); - $js_close_selected="jsper.close_selected()"; + +echo HtmlInput::submit('choose', 'Valider'); +echo ""; + echo HtmlInput::button_action(_("Fermer les périodes sélectionnées"), $js_close_selected);