From 06d05bff50746e71e897c40dcd5ab12d8497a82a Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 27 Nov 2010 01:29:08 +0000 Subject: [PATCH] =?UTF-8?q?0000135:=20POST=20-=20IT=20ajout=20de=20post-it?= =?UTF-8?q?=20sur=20les=20op=C3=A9rations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/ajax_ledger.php | 4 +++- html/js/acc_ledger.js | 1 + include/class_acc_ledger.php | 6 ++++-- include/class_acc_operation.php | 3 +++ include/class_database.php | 4 +++- include/constant.php | 2 +- include/template/ledger_detail_ach.php | 24 +++++++++++++++++++++++- include/template/ledger_detail_fin.php | 25 +++++++++++++++++++++++++ include/template/ledger_detail_misc.php | 23 +++++++++++++++++++++++ include/template/ledger_detail_top.php | 1 + include/template/ledger_detail_ven.php | 25 +++++++++++++++++++++++++ sql/upgrade.sql | 14 ++++++++++++++ 12 files changed, 126 insertions(+), 6 deletions(-) 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 @@ + + + +
input(),' colspan="2" '); ?> +
+
+ + + + +
+ Note +
+width=25; +$inote->heigh=5; +$inote->value=$obj->det->note; +echo $inote->input(); +?> +
+
+
-
diff --git a/include/template/ledger_detail_fin.php b/include/template/ledger_detail_fin.php index e86eccb4d..f893d7731 100644 --- a/include/template/ledger_detail_fin.php +++ b/include/template/ledger_detail_fin.php @@ -6,6 +6,7 @@ +
+ +
input());
+
+ + + + + + +
+ Note +
+width=25; +$inote->heigh=5; +$inote->value=$obj->det->note; +echo $inote->input(); +?> + +
+
+ +
diff --git a/include/template/ledger_detail_misc.php b/include/template/ledger_detail_misc.php index 48ef09040..4dbfae4fb 100644 --- a/include/template/ledger_detail_misc.php +++ b/include/template/ledger_detail_misc.php @@ -15,6 +15,7 @@ require_once ('class_anc_plan.php'); + + +
'; } ?>
+
+ + + + + + +
+ Note +
+width=25; +$inote->heigh=5; +$inote->value=$obj->det->note; +echo $inote->input(); +?> + +
+
det->jr_internal); ?>
+ + + + +
MY_TVA_USE=='Y') echo tr($row); ?>
+
+ + + + + + +
+ Note +
+width=25; +$inote->heigh=5; +$inote->value=$obj->det->note; +echo $inote->input(); +?> + +
+
+
diff --git a/sql/upgrade.sql b/sql/upgrade.sql index de917d9c7..0b3b836af 100644 --- a/sql/upgrade.sql +++ b/sql/upgrade.sql @@ -133,3 +133,17 @@ CREATE TRIGGER t_check_jrn FOR EACH ROW EXECUTE PROCEDURE comptaproc.jrn_check_periode(); + +CREATE TABLE jrn_note +( + n_id integer NOT NULL DEFAULT nextval('jrnx_note_n_id_seq'::regclass), + n_text text, + jr_id bigint NOT NULL, + CONSTRAINT jrnx_note_pkey PRIMARY KEY (n_id), + CONSTRAINT jrnx_note_j_id_fkey FOREIGN KEY (jr_id) + REFERENCES jrn (jr_id) MATCH SIMPLE + ON UPDATE CASCADE ON DELETE CASCADE +) +; + +COMMENT ON TABLE jrn_note IS 'Note about operation'; \ No newline at end of file