';
+ $ret.= '
';
$ret.= '
'._("Mise à jour").'
';
$ret.= '';
- $ret.= '';
-
- }
- // Update the PA
- if ( $sa == "pa_update" )
- {
- $new=new Anc_Plan($cn,$_GET['pa_id']);
- $new->name=$_POST['pa_name'];
- $new->description=$_POST['pa_description'];
- $new->update();
- $ret='
';
- $ret.='
'._('Mis à jour').'
';
- $ret.="";
- }
- // show the form for add a poste
- if ( $sa=='po_add')
- {
- $po=new Anc_Account($cn);
- $po->pa_id=$_REQUEST['pa_id'];
- $wSa=HtmlInput::hidden("sa","po_write");
- $ret.='
';
- $ret.='";
- $ret.="
";
- }
- // record the poste
- if ( $sa=="po_write")
- {
- // var_dump($_POST);
- $po=new Anc_Account($cn);
- $po->get_from_array($_POST);
- $po->add();
- $sa="list";
-
- }
- /* delete pa */
- if ( $sa == "pa_delete")
- {
- $delete=new Anc_Plan($cn,$_GET['pa_id']);
- $delete->delete();
- }
- /* po detail
- *
- */
- if ( $sa=="po_detail")
- {
- $po=new Anc_Account($cn,$_GET['po_id']);
- $po->get_by_id();
- $ret.='
';
- }
- if ( $sa=="po_update")
- {
- $po=new Anc_Account($cn);
- $po->get_from_array($_POST);
- $po->update();
- $sa="list";
- }
- if ( $sa=="po_delete")
- {
- $po=new Anc_Account($cn,$_REQUEST['po_id']);
- $po->delete();
- $sa="list";
- }
- /* List poste */
- if ( $sa == "list" )
- {
- $count=0;
+ /**
+ * Detail now
+ */
+ $count=0;
$new=new Anc_Plan($cn,$_REQUEST['pa_id']);
$new->get();
$array=$new->get_poste_analytique(" order by po_name");
- $ret.='
';
+ $ret.='
';
$ret.='
';
$ret.="";
$ret.="| "._("Nom")." ";
@@ -222,76 +234,76 @@ if ( isset($_REQUEST['sa']))
}
$ret.=" |
";
- $ret.=HtmlInput::button_anchor(_('Ajout'),"?ac=".$_REQUEST['ac']."&sa=po_add&pa_id=".$_GET['pa_id']."&".$str_dossier);
- $ret.='
';
-
+ // ---> montre form pour ajouter po
+ $ret.=HtmlInput::button_anchor(_('Ajout'),"?ac=".$_REQUEST['ac']."&sa=po_add&pa_id=".$_GET['pa_id']."&".$str_dossier,'','','smallbutton');
+ $href=http_build_query(array('ac'=>$_REQUEST['ac'],'gDossier'=>$_REQUEST['gDossier']));
+ $ret.= '
'._('Retour').'';
+ $ret.= '
';
+
}
-
}
-
+else {
+ $sa="anc_menu";
+}
//---------------------------------------------------------------------------
// Show lmenu
//
//---------------------------------------------------------------------------
-$obj=new Anc_Plan($cn);
-$list=$obj->get_list();
-
-
-
-
-if ( empty($list) )
+if ($sa=='anc_menu')
{
- echo '';
- if ( ! isset ( $_REQUEST['sa']))
- echo '
'.
- _("Aucun plan analytique n'est défini").
- '
';
+ $obj=new Anc_Plan($cn);
+ $list=$obj->get_list();
-}
-else
-{
- echo '';
+ }
}
//---------------------------------------------------------------------------
-// show the redcontent part
+// show the content part
//
//
//---------------------------------------------------------------------------
diff --git a/include/cfgledger.inc.php b/include/cfgledger.inc.php
index 6ddbfaa68..03abf1b6c 100644
--- a/include/cfgledger.inc.php
+++ b/include/cfgledger.inc.php
@@ -36,7 +36,7 @@ require_once 'class_acc_ledger.php';
$gDossier=dossier::id();
global $cn;
-
+$show_menu=1;
$ledger=new Acc_Ledger($cn,-1);
$sa=HtmlInput::default_value("sa","",$_REQUEST);
//////////////////////////////////////////////////////////////////////////
@@ -50,6 +50,7 @@ if (isset($_POST['update']))
if ( $ledger->load() == -1) throw new Exception (_('Journal inexistant'));
$ledger->verify_ledger($_POST);
$ledger->update($_POST);
+ $show_menu=1;
} catch (Exception $e)
{
alert($e->getMessage());
@@ -71,6 +72,7 @@ if (isset($_POST['efface']))
echo '
';
echo '
'.h($name). " est effacé"."
";
echo '';
+ $show_menu=1;
}
catch (Exception $e)
{
@@ -90,6 +92,7 @@ if (isset($_POST['add']))
$ledger->save_new($_POST);
$sa="detail";
$_REQUEST['p_jrn']=$ledger->jrn_def_id;
+ $show_menu=1;
}
catch (Exception $e)
{
@@ -97,12 +100,7 @@ if (isset($_POST['add']))
}
}
-//////////////////////////////////////////////////////////////////////////
-// Display list of ledgers
-//////////////////////////////////////////////////////////////////////////
-echo '';
+
@@ -116,14 +114,17 @@ switch ($sa)
try
{
$ledger->id=$_REQUEST['p_jrn'];
- echo '
';
+ echo '
";
+ $show_menu=0;
}
catch (Exception $e)
{
@@ -131,17 +132,24 @@ switch ($sa)
}
break;
case 'add': /* Add a new ledger */
- echo '
';
+ echo '
';
echo '';
echo "
";
+ $show_menu=0;
}
-
-
+//////////////////////////////////////////////////////////////////////////
+// Display list of ledgers
+//////////////////////////////////////////////////////////////////////////
+if ( $show_menu == 1 ) {
+ echo '
';
+ echo $ledger->listing();
+ echo '
';
+}
html_page_stop();
diff --git a/include/class_acc_ledger.php b/include/class_acc_ledger.php
index 03e258db8..44a54b066 100644
--- a/include/class_acc_ledger.php
+++ b/include/class_acc_ledger.php
@@ -3358,8 +3358,9 @@ class Acc_Ledger extends jrn_def_sql
$base_url = "?" . dossier::get() . "&ac=" . $_REQUEST['ac'];
$r = "";
- $r.='
';
- $r.='| ' . _('Création') . ' |
';
+ $r.=_('Filtre')." ".HtmlInput::filter_table("cfgledger_table_id", "0", "1");
+ $r.='';
+ $r.='| ' . _('Ajout journal') . ' |
';
$ret = $this->db->exec_sql("select distinct jrn_def_id,jrn_def_name,
jrn_def_class_deb,jrn_def_class_cred,jrn_def_type
from jrn_def order by jrn_def_name");
@@ -3370,7 +3371,7 @@ class Acc_Ledger extends jrn_def_sql
{
$l_line = Database::fetch_array($ret, $i);
$url = $base_url . "&sa=detail&p_jrn=" . $l_line['jrn_def_id'];
- $r.=sprintf('| %s |
', $url, h($l_line['jrn_def_name']));
+ $r.=sprintf('| %s |
', $url, h($l_line['jrn_def_name']).' ('.$l_line['jrn_def_type'].')');
}
$r.= "
";
return $r;
diff --git a/include/class_acc_ledger_sold.php b/include/class_acc_ledger_sold.php
index 5d01d2b5d..3d98b1fab 100644
--- a/include/class_acc_ledger_sold.php
+++ b/include/class_acc_ledger_sold.php
@@ -40,6 +40,7 @@ require_once('class_own.php');
require_once('class_itva_popup.php');
require_once('class_acc_ledger_fin.php');
require_once 'class_stock_goods.php';
+require_once 'class_acc_ledger.php';
/* !\brief Handle the ledger of sold,
*
@@ -1356,6 +1357,6 @@ class Acc_Ledger_Sold extends Acc_Ledger {
$a = new Acc_Ledger_Sold($cn, 2);
echo $a->input();
}
-
-}
+
+ }