[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 217/218: Mantis #0001442: CA - facilité de m
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 217/218: Mantis #0001442: CA - facilité de manipulation - effacement Button for cleaning detail analytique in operation |
Date: |
Thu, 12 Sep 2019 15:59:13 -0400 (EDT) |
sparkyx pushed a commit to branch entreprise
in repository noalyss.
commit 1c6b9737ad7ae30216474e564eecc872d08b14c6
Author: Dany De Bontridder <address@hidden>
Date: Thu Sep 12 21:42:50 2019 +0200
Mantis #0001442: CA - facilité de manipulation - effacement
Button for cleaning detail analytique in operation
---
html/ajax_misc.php | 2 +
html/js/anc_script.js | 49 ++++++++++++++++++++++
include/ajax/ajax_anc_key_clean.php | 76 +++++++++++++++++++++++++++++++++++
include/class/anc_operation.class.php | 16 ++++++++
4 files changed, 143 insertions(+)
diff --git a/html/ajax_misc.php b/html/ajax_misc.php
index c209d9d..ef7ac14 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/js/anc_script.js b/html/js/anc_script.js
index d18e81a..ce7cc58 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 0000000..6944c92
--- /dev/null
+++ b/include/ajax/ajax_anc_key_clean.php
@@ -0,0 +1,76 @@
+<?php
+/*
+ * This file is part of NOALYSS.
+ *
+ * NOALYSS is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * NOALYSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with NOALYSS; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+/**
+ * @file
+ * @brief show the available distribution keys for analytic activities.
Expected
+ * parameter are
+ * - t for the table id
+ * - amount is the amount to distributed
+ *
+ */
+// Copyright (2014) Author Dany De Bontridder address@hidden
+if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
+
+require_once NOALYSS_INCLUDE.'/lib/http_input.class.php';
+$http=new HttpInput();
+
+try
+{
+ $amount=$http->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 <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<data>
+<ctl></ctl>
+<code>$html</code>
+</data>
+EOF;
+?>
\ No newline at end of file
diff --git a/include/class/anc_operation.class.php
b/include/class/anc_operation.class.php
index 9726ac3..d6f7b59 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();
+
}
- [Noalyss-commit] [noalyss] 143/218: Currency : precision 6, display default currency , protect used currency against delete, (continued)
- [Noalyss-commit] [noalyss] 143/218: Currency : precision 6, display default currency , protect used currency against delete, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 149/218: Currency : purchase, save all detail also in currency, fix problem with the advance payment, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 151/218: Task #1660 : place the button for the inventory on the top, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 157/218: Merge branch 'r700-currency' of gitlab.noalyss.eu:noalyss/noalyss into r700-currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 75/218: Improve waiting box, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 171/218: Mantis #0001666: Export CSV depuis histo ne filtre pas par journal, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 175/218: mantis #1690: Bug : impossible d'utiliser < dans Inplace_Edit Use base64_decode to protect the string in serialize, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 194/218: TEST : fix some little bugs, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 199/218: Merge with dev7109, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 215/218: Improve Doxygen, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 217/218: Mantis #0001442: CA - facilité de manipulation - effacement Button for cleaning detail analytique in operation,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 187/218: Wrong merge broke fiche.class.php, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 205/218: Merge branch 'dev7109' into entreprise, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 211/218: Periode : order by date asc, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 156/218: Merge branch 'r700-currency' of gitlab.noalyss.eu:noalyss/noalyss into r700-currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 163/218: PHP 7.2 mistyped command, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 153/218: Fix problem with total in balance export, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 174/218: Merge branch 'r700-currency' of gitlab.noalyss.eu:noalyss/noalyss into r700-currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 173/218: Mantis #0001682: CA - ajouter possibilité d'exporter le plan analytique, missing file, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 170/218: Merge branch 'r700-currency' of gitlab.noalyss.eu:noalyss/noalyss into r700-currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 172/218: Mantis #0001682: CA - ajouter possibilité d'exporter le plan analytique, add action CSV:Analytic_Axis, Dany De Bontridder, 2019/09/12