From 41cc846adee44c4e42bca98983097a65abc0b26f Mon Sep 17 00:00:00 2001 From: sparkyx Date: Sun, 23 Dec 2007 19:40:46 +0000 Subject: [PATCH] module budget : detail is finished --- html/budget.php | 10 ++++++++++ include/bud_detail.inc.php | 9 +++++++-- include/class_bud_data.php | 6 +++++- include/constant.php | 2 +- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/html/budget.php b/html/budget.php index 5d2203ff4..f186e93fd 100644 --- a/html/budget.php +++ b/html/budget.php @@ -49,6 +49,13 @@ echo '
'; echo '
'; echo "

Budget : ".dossier::name()."

"; echo '

'; +echo '
+ + + + +
'; + echo '
'; @@ -66,6 +73,9 @@ switch($p_action) { case 'detail': $def=3; break; + case 'synthese': + $def=4; + break; } diff --git a/include/bud_detail.inc.php b/include/bud_detail.inc.php index 4984c7c97..282462a5a 100644 --- a/include/bud_detail.inc.php +++ b/include/bud_detail.inc.php @@ -107,9 +107,14 @@ echo $button_other; echo '
'; -$hidden=dossier::hidden().widget::hidden('bh_id',$_REQUEST['bh_id']). - widget::hidden('po_id',$po_id).widget::hidden('p_action','detail'); //---------------------------------------------------------------------- // Show 20 lines by default //---------------------------------------------------------------------- +require_once ('class_bud_data.php'); +echo JS_PROTOTYPE_JS; +echo JS_BUD_SCRIPT; +extract($_GET); +$obj=new Bud_Data($cn,$bh_id,$po_id); +$r=$obj->load(); +echo $obj->form(); diff --git a/include/class_bud_data.php b/include/class_bud_data.php index e24d81d88..9d22128f5 100644 --- a/include/class_bud_data.php +++ b/include/class_bud_data.php @@ -55,6 +55,10 @@ class Bud_Data { } function load() { + if ( $this->po_id == -1) + $sql_po_id="po_id is null"; + else + $sql_po_id=".$this->po_id"; $sql=" select bd_id,bc_id,bc_code,bd.bh_id,bd.bh_name,". " tmp_pcmn.pcm_val as pcm_val,pcm_lib ". " from bud_detail ". @@ -62,7 +66,7 @@ class Bud_Data { " join bud_card using (bc_id) ". " join tmp_pcmn using (pcm_val) ". " where bd.bh_id=".$this->bh_id. - " and po_id=".$this->po_id; + " and $sql_po_id ;"; echo_debug(__FILE__.':'.__LINE__.'- load',' SQL ',$sql); $res1=ExecSql($this->cn,$sql); diff --git a/include/constant.php b/include/constant.php index 98ecbf0c0..2a8e06f77 100644 --- a/include/constant.php +++ b/include/constant.php @@ -34,7 +34,7 @@ define ("phpcompta_user","phpcompta"); // the domain can't start by a number !!! define ("domaine",""); define ("MAX_COMPTE",4); -define ('MAX_BUD_DETAIL',3); +define ('MAX_BUD_DETAIL',20); define ("DEBUG","true");