diff --git a/include/bank.inc.php b/include/bank.inc.php
index 3361ab7cd..c275c7f4c 100644
--- a/include/bank.inc.php
+++ b/include/bank.inc.php
@@ -25,6 +25,8 @@ require_once("class_document.php");
require_once("class_fiche.php");
require_once("class_parm_code.php");
require_once("check_priv.php");
+require_once ('class_pre_op_fin.php');
+
/*!\file
* \brief the purpose off this file encode expense and to record them
*
@@ -59,6 +61,7 @@ if ( isset ($_REQUEST['url']))
}
$sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:"";
+
//----------------------------------------------------------------------
// ask the saldo of the bank
if ( $sub_action == "solde" )
@@ -218,6 +221,26 @@ echo ShowMenuJrnUser($gDossier,'FIN',$p_jrn,
'
');
echo '';
+//--------------------------------------------------------------------------------
+// use a predefined operation
+//--------------------------------------------------------------------------------
+if ( $sub_action=="use_opd" ) {
+ $op=new Pre_op_fin($cn);
+ $op->set_od_id($_REQUEST['pre_def']);
+ $p_post=$op->compute_array();
+ echo_debug(__FILE__.':'.__LINE__.'- ','p_post = ',$p_post);
+ // submit button in the form
+ $submit=''.
+ '';
+
+ $form=FormFin($cn,$_GET['p_jrn'],$User->GetPeriode(),$submit,$p_post,false,$p_post['nb_item']);
+ echo '
';
+ echo $form;
+ echo '
';
+ exit();
+ }
+
+
//-----------------------------------------------------
// if we request to add an item
// the $_POST['add_item'] is set
@@ -321,6 +344,21 @@ if ( $p_jrn != -1 )
$form=FormFin($cn,$p_jrn,$User->GetPeriode(),$submit,null,false,$jrn->GetDefLine('deb'));
echo '
';
+ exit();
+ }
+
//-----------------------------------------------------
// if we request to add an item
// the $_POST['add_item'] is set
@@ -208,7 +223,7 @@ if ( isset($_POST['record_and_print_invoice']))
NoAccess();
exit -1;
}
-
+ $nb_number=$_POST['nb_item'];
// First we save the invoice, the internal code will be used to change the description
// and upload the file
if ( form_verify_input($cn,$p_jrn,$User->GetPeriode(),$_POST,$nb_number)== true) {
@@ -245,8 +260,8 @@ if ( isset($_POST['record_and_print_invoice']))
echo '';
// Button return
- printf ('',
- $p_jrn);
+ printf ('',
+ $p_jrn,dossier::get());
exit();
}
//-----------------------------------------------------
@@ -294,4 +309,21 @@ if ( $p_jrn != -1 )
echo '
';
echo $form;
echo '
';
+ //--------------------
+ // predef op.
+ echo '';
+
}
diff --git a/include/impress_bilan.php b/include/impress_bilan.php
index 6f33d0e78..efbcc3207 100644
--- a/include/impress_bilan.php
+++ b/include/impress_bilan.php
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* $Revision$ */
-include_once("class_widget.php");
+require_once ('class_bilan.php');
/*! \file
* \brief form who call the printing of the bilan in RTF
* file included by user_impress
@@ -29,34 +29,18 @@ include_once("class_widget.php");
// Show the jrn and date
//-----------------------------------------------------
include_once("postgres.php");
-$ret=make_array($cn,"select fr_id,fr_label
+/*$ret=make_array($cn,"select fr_id,fr_label
from formdef
order by fr_label");
+*/
//-----------------------------------------------------
// Form
//-----------------------------------------------------
-$w=new widget("select");
-$w->table=1;
-
-echo '