Ajout des clef de répartition pour la comptabilité analytique
This commit is contained in:
parent
59e76cb5d3
commit
f1c1f9b196
11 changed files with 982 additions and 8 deletions
|
|
@ -375,32 +375,51 @@ function filter_anc(obj, queryString)
|
|||
return queryString;
|
||||
}
|
||||
/**
|
||||
* @brief use a distribution key
|
||||
* @brief compute and display Analytic activity, related to the choosen distribution key
|
||||
* @param p_dossier is the dossier id
|
||||
* @param p_table is table id to replace
|
||||
* @param p_amount is the amount to distribute
|
||||
* @param p_key_id is the choosen key
|
||||
*
|
||||
*/
|
||||
function anc_key_compute(p_dossier, p_table, p_amount)
|
||||
function anc_key_compute(p_dossier, p_table, p_amount, p_key_id)
|
||||
{
|
||||
waiting_box();
|
||||
var op = "op=anc_key_compute";
|
||||
var queryString = op + "&gDossier=" + p_dossier + "&t=" + p_table + "&amount=" + p_amount;
|
||||
var queryString = op + "&gDossier=" + p_dossier + "&t=" + p_table + "&amount=" + p_amount + '&key=' + p_key_id;
|
||||
try {
|
||||
var action = new Ajax.Request(
|
||||
"ajax_misc.php",
|
||||
{
|
||||
method: 'get',
|
||||
parameters: queryString,
|
||||
onFailure: error_box('Ajax failure'),
|
||||
onSuccess: function(req) {
|
||||
onFailure: error_box,
|
||||
onSuccess: function(req, json) {
|
||||
try
|
||||
{
|
||||
var name_ctl = p_table;
|
||||
var answer = req.responseXML;
|
||||
remove_waiting_box();
|
||||
var html = answer.getElementsByTagName('code');
|
||||
if (html.length == 0) {
|
||||
var rec = req.responseText;
|
||||
alert('erreur :' + rec);
|
||||
}
|
||||
|
||||
var code_html = getNodeText(html[0]); // Firefox ne prend que les 4096 car.
|
||||
code_html = unescape_xml(code_html);
|
||||
console.log(code_html);
|
||||
$(name_ctl).innerHTML = code_html;
|
||||
} catch (e)
|
||||
{
|
||||
error_message(e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
);
|
||||
} catch (e) {
|
||||
error_box(e.message);
|
||||
error_message(e.message);
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
|
@ -408,11 +427,57 @@ function anc_key_compute(p_dossier, p_table, p_amount)
|
|||
* in ajax, a window let you choose what key you want to use
|
||||
*
|
||||
* @param p_dossier is the dossier
|
||||
* @param p_key_id is the choosen key
|
||||
* @param p_table the table id of the target
|
||||
* @param p_amount amount to distribute
|
||||
* @param p_ledger
|
||||
*/
|
||||
function anc_key_choice(p_dossier, p_key_id, p_table, p_amount)
|
||||
function anc_key_choice(p_dossier, p_table, p_amount)
|
||||
{
|
||||
waiting_box();
|
||||
var op = 'op=anc_key_choice';
|
||||
var queryString = op + "&gDossier=" + p_dossier + "&t=" + p_table + "&amount=" + p_amount;
|
||||
try {
|
||||
var ledger=$('p_jrn');
|
||||
if (ledger == null ) {
|
||||
error_message('error : ledger is null ');
|
||||
return;
|
||||
}
|
||||
|
||||
queryString+='&led='+ledger.value;
|
||||
var action = new Ajax.Request(
|
||||
"ajax_misc.php",
|
||||
{
|
||||
method: 'get',
|
||||
parameters: queryString,
|
||||
onFailure: error_box,
|
||||
onSuccess: function(req, json) {
|
||||
try
|
||||
{
|
||||
var name_ctl = 'div_anc_key_choice';
|
||||
var answer = req.responseXML;
|
||||
remove_waiting_box();
|
||||
var html = answer.getElementsByTagName('code');
|
||||
if (html.length == 0) {
|
||||
var rec = req.responseText;
|
||||
alert('erreur :' + rec);
|
||||
}
|
||||
|
||||
console.log('Received ajax_call');
|
||||
var code_html = getNodeText(html[0]); // Firefox ne prend que les 4096 car.
|
||||
code_html = unescape_xml(code_html);
|
||||
console.log(code_html);
|
||||
add_div({id: name_ctl, cssclass: 'inner_box', style: 'top:30%;right:35%;position:absolute', drag: 1});
|
||||
$(name_ctl).innerHTML = code_html;
|
||||
} catch (e)
|
||||
{
|
||||
error_message(e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
} catch (e) {
|
||||
error_message(e.message);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue