diff --git a/html/ajax_misc.php b/html/ajax_misc.php
index 869676e3c..8d878825c 100644
--- a/html/ajax_misc.php
+++ b/html/ajax_misc.php
@@ -522,6 +522,9 @@ EOF;
require_once 'template/plugin_detail.php';
break;
case 'saldo':
- require_once 'ajax_bank_saldo.inc.php';
+ require_once 'ajax_bank_saldo.php';
+ break;
+ case 'up_predef':
+ require_once 'ajax_update_predef.php';
break;
}
\ No newline at end of file
diff --git a/html/get_saldo.php b/html/get_saldo.php
deleted file mode 100644
index 03b5e97c2..000000000
--- a/html/get_saldo.php
+++ /dev/null
@@ -1,66 +0,0 @@
-check();
-if ( $user->check_jrn($_GET['j'])=='X' ) return '{"saldo":"0"}';
-/* make a filter on the exercice */
-
-$filter_year=" j_tech_per in (select p_id from parm_periode ".
- "where p_exercice='".$user->get_exercice()."')";
-
-
-$id=$cn->get_value('select jrn_def_bank from jrn_def where jrn_def_id=$1',array($_GET['j']));
-$acc=new Fiche($cn,$id);
-
-$res=$acc->get_bk_balance($filter_year." and ( trim(jr_pj_number) != '' and jr_pj_number is not null)" );
-
-
-if ( empty($res) ) return '{"saldo":"0"}';
-$solde=$res['solde'];
-if ( $res['debit'] < $res['credit'] ) $solde=$solde*(-1);
-
-echo '{"saldo":"'.$solde.'"}';
-
-
-
diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js
index 76d2597e7..3b248004f 100644
--- a/html/js/acc_ledger.js
+++ b/html/js/acc_ledger.js
@@ -32,10 +32,10 @@ function update_predef(p_type,p_direct)
{
var jrn=g("p_jrn").value;
var dossier=g("gDossier").value;
- var querystring='gDossier='+dossier+'&l='+jrn+'&t='+p_type+'&d='+p_direct;
+ var querystring='gDossier='+dossier+'&l='+jrn+'&t='+p_type+'&d='+p_direct+"&op=up_predef";
g("p_jrn_predef").value=jrn;
var action=new Ajax.Request(
- "get_predef.php",
+ "ajax_misc.php",
{
method:'get',
parameters:querystring,
diff --git a/html/show_document.php b/html/show_document.php
index a7484426b..eb342a3fd 100644
--- a/html/show_document.php
+++ b/html/show_document.php
@@ -35,6 +35,7 @@ require_once ('class_user.php');
$User=new User(new Database());
$User->Check();
$User->check_dossier($gDossier);
+
/* Show the document */
if ( $action == 'sh')
{
diff --git a/include/ajax_bank_saldo.inc.php.php b/include/ajax_bank_saldo.php.php
similarity index 100%
rename from include/ajax_bank_saldo.inc.php.php
rename to include/ajax_bank_saldo.php.php
diff --git a/html/get_predef.php b/include/ajax_update_predef.php.php
similarity index 100%
rename from html/get_predef.php
rename to include/ajax_update_predef.php.php