diff --git a/html/ajax_ledger.php b/html/ajax_ledger.php
index 7a62b85ac..ab9b989fd 100644
--- a/html/ajax_ledger.php
+++ b/html/ajax_ledger.php
@@ -331,6 +331,8 @@ case 'save':
array($_POST['lib'],$_POST['npj'],$jr_id,$_POST['p_date']));
$cn->exec_sql("update jrnx set j_date=to_date($1,'DD.MM.YYYY') where j_grpt in (select jr_grpt_id from jrn where jr_id=$2)",
array($_POST['p_date'],$jr_id));
+ $cn->exec_sql("select comptaproc.jrn_add_note($1,$2)",
+ array($jr_id,$_POST['jrn_note']));
$rapt=$_POST['rapt'];
if (trim($rapt) != '')
{
@@ -360,7 +362,7 @@ case 'save':
// CA
//////////////////////////////////////////////////
$owner = new Own($cn);
- if ( $owner->MY_ANALYTIC != "nu" )
+ if ( $owner->MY_ANALYTIC != "nu" && isset ($_POST['op']) )
{
// for each item, insert into operation_analytique */
$op=new Anc_Operation($cn);
diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js
index 662d5cd54..6692d9713 100644
--- a/html/js/acc_ledger.js
+++ b/html/js/acc_ledger.js
@@ -877,6 +877,7 @@ function op_save(obj)
queryString+='&jr_id='+obj.jr_id.value;
queryString+='&div='+obj.whatdiv.value;
queryString+='&act=save';
+
if ( g('inpopup'))
{
var action=new Ajax.Request ( 'ajax_ledger.php',
diff --git a/include/class_acc_ledger.php b/include/class_acc_ledger.php
index 6dab081a3..e76ff17df 100644
--- a/include/class_acc_ledger.php
+++ b/include/class_acc_ledger.php
@@ -722,6 +722,7 @@ class Acc_Ledger
$r.=$sort_echeance;
$r.=$sort_pj;
$r.=$sort_description;
+ $r.=th('Notes');
$r.=$sort_amount;
// if $p_paid is not equal to 0 then we have a paid column
if ( $p_paid != 0 )
@@ -791,7 +792,7 @@ class Acc_Ledger
$tmp_jr_comment=h($row['jr_comment']);
$r.=$tmp_jr_comment;
$r.="";
-
+ $r.=td(h($row['n_text']),' style="font-size:6"');
// Amount
// If the ledger is financial :
// the credit must be negative and written in red
@@ -2267,7 +2268,7 @@ class Acc_Ledger
jr_pj_number,
n_text
from
- jrn right join jrn_note using(jr_id)
+ jrn left join jrn_note using(jr_id)
join jrn_def on jrn_def_id=jr_def_id
join parm_periode on p_id=jr_tech_per";
@@ -2289,6 +2290,7 @@ class Acc_Ledger
$per=new Periode($this->db,$period);
list($date_start,$date_end)=$per->get_date_limit();
+
}
$desc='';
$qcode=(isset($qcode))?$qcode:"";
diff --git a/include/class_acc_operation.php b/include/class_acc_operation.php
index 807a4e0e2..2ea9ad7a3 100644
--- a/include/class_acc_operation.php
+++ b/include/class_acc_operation.php
@@ -552,6 +552,9 @@ class Acc_Detail extends Acc_Operation
{
$this->det->$key=$val;
}
+ $sql="select n_text from jrn_note where jr_id=$1";
+ $this->det->note=$this->db->get_value($sql,array($this->jr_id));
+ $this->det->note=preg_replace('/< *script/i','[script',$this->det->note);
}
}
/////////////////////////////////////////////////////////////////////////////
diff --git a/include/class_database.php b/include/class_database.php
index 02921d1e0..a64a9a203 100644
--- a/include/class_database.php
+++ b/include/class_database.php
@@ -114,11 +114,12 @@ class Database
{
try
{
+
$this->sql=$p_string;
$this->array=$p_array;
if ( $p_array==null )
{
- $this->ret=@pg_query($this->db,$p_string);
+ $this->ret=@pg_query($this->db,$p_string);
}
else
{
@@ -138,6 +139,7 @@ class Database
print_r($p_array);
echo $a->getMessage();
echo $a->getTrace();
+ echo pg_last_error($this->db);
}
throw ($a);
}
diff --git a/include/constant.php b/include/constant.php
index dfb8db1b8..2bd858e9b 100644
--- a/include/constant.php
+++ b/include/constant.php
@@ -48,7 +48,7 @@ define ('MAX_ARTICLE',9);
define ('MAX_CAT',15);
define ('MAX_FORECAST_ITEM',10);
-define ("DEBUG",false);
+define ("DEBUG",true);
// Erreur
define ("NOERROR",0);
diff --git a/include/template/ledger_detail_ach.php b/include/template/ledger_detail_ach.php
index cdbfe3386..5705c348c 100644
--- a/include/template/ledger_detail_ach.php
+++ b/include/template/ledger_detail_ach.php
@@ -10,6 +10,7 @@
endif; ?>
echo HtmlInput::hidden('whatdiv',$div).HtmlInput::hidden('jr_id',$jr_id).dossier::hidden();?>
+
input(),' colspan="2" ');
?>
+
+ |
+
+
+
+|
+ Note
+ |
+
+|
+
+$inote=new ITextarea('jrn_note');
+$inote->width=25;
+$inote->heigh=5;
+$inote->value=$obj->det->note;
+echo $inote->input();
+?>
+ |
+ |
+
+
+