[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r5562 - in phpcompta/tags/rel670: include include/templa
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r5562 - in phpcompta/tags/rel670: include include/template sql |
Date: |
Thu, 5 Dec 2013 02:14:55 +0100 (CET) |
Author: danydb
Date: 2013-12-05 02:14:55 +0100 (Thu, 05 Dec 2013)
New Revision: 5562
Modified:
phpcompta/tags/rel670/include/class_acc_ledger.php
phpcompta/tags/rel670/include/class_jrn_def_sql.php
phpcompta/tags/rel670/include/template/param_jrn.php
phpcompta/tags/rel670/sql/upgrade.sql
Log:
typo
Task #929 - Ajout d'une description pour les journaux
Modified: phpcompta/tags/rel670/include/class_acc_ledger.php
===================================================================
--- phpcompta/tags/rel670/include/class_acc_ledger.php 2013-12-05 01:13:57 UTC
(rev 5561)
+++ phpcompta/tags/rel670/include/class_acc_ledger.php 2013-12-05 01:14:55 UTC
(rev 5562)
@@ -3317,6 +3317,10 @@
$min_row = new INum("min_row",$this->jrn_deb_max_line);
$min_row->prec=0;
+
+ $description=new ITextarea('p_description');
+ $description->value=$this->jrn_def_description;
+ $str_description=$description->input();
/* Load the card */
$card = $this->get_fiche_def();
@@ -3413,6 +3417,7 @@
$this->jrn_def_pj_pref = $jrn_def_pj_pref;
$this->jrn_def_fiche_deb = (isset($FICHEDEB)) ? join($FICHEDEB,
',') : "";
$this->jrn_deb_max_line=($min_row<1)?1:$min_row;
+ $this->jrn_def_description=$p_description;
switch ($this->jrn_def_type)
{
case 'ACH':
@@ -3509,6 +3514,9 @@
$pj_seq = '';
$last_seq = 0;
$new = 1;
+ $description=new ITextarea('p_description');
+ $description->value="";
+ $str_description=$description->input();
/* bank card */
$qcode_bank = '';
/* Numbering (only FIN) */
@@ -3541,7 +3549,7 @@
$this->jrn_def_fiche_deb = (isset($FICHEDEB)) ? join($FICHEDEB,
',') : "";
$this->jrn_deb_max_line=$min_row;
$this->jrn_def_code = sprintf("%s%02d",
trim(substr($this->jrn_def_type, 0, 1)), Acc_Ledger::next_number($this->db,
$this->jrn_def_type));
-
+ $this->jrn_def_description=$p_description;
switch ($this->jrn_def_type)
{
case 'ACH':
Modified: phpcompta/tags/rel670/include/class_jrn_def_sql.php
===================================================================
--- phpcompta/tags/rel670/include/class_jrn_def_sql.php 2013-12-05 01:13:57 UTC
(rev 5561)
+++ phpcompta/tags/rel670/include/class_jrn_def_sql.php 2013-12-05 01:14:55 UTC
(rev 5562)
@@ -36,6 +36,7 @@
, "jrn_def_pj_pref" => "jrn_def_pj_pref"
, "jrn_def_bank" => "jrn_def_bank"
, "jrn_def_num_op" => "jrn_def_num_op"
+ , "jrn_def_description" => "jrn_def_description"
);
function __construct(& $p_cn, $p_id=-1)
@@ -193,6 +194,7 @@
,jrn_def_pj_pref
,jrn_def_bank
,jrn_def_num_op
+,jrn_def_description
) values ($1
,$2
,$3
@@ -207,6 +209,7 @@
,$12
,$13
,$14
+,$15
) returning jrn_def_id";
$this->jrn_def_id = $this->db->get_value(
@@ -224,6 +227,7 @@
, $this->jrn_def_pj_pref
, $this->jrn_def_bank
, $this->jrn_def_num_op
+ , strip_tags($this->jrn_def_description)
)
);
}
@@ -243,7 +247,8 @@
,jrn_def_pj_pref
,jrn_def_bank
,jrn_def_num_op
-,jrn_def_id) values ($1
+,jrn_def_id
+,jrn_def_description) values ($1
,$2
,$3
,$4
@@ -258,6 +263,7 @@
,$13
,$14
,$15
+,$16
) returning jrn_def_id";
$this->jrn_def_id = $this->db->get_value(
@@ -275,7 +281,8 @@
, $this->jrn_def_pj_pref
, $this->jrn_def_bank
, $this->jrn_def_num_op
- , $this->jrn_def_id)
+ , $this->jrn_def_id
+ , strip_tags($this->jrn_def_description))
);
}
}
@@ -299,7 +306,8 @@
,jrn_def_pj_pref = $12
,jrn_def_bank = $13
,jrn_def_num_op = $14
- where jrn_def_id= $15";
+,jrn_def_description = $15
+ where jrn_def_id= $16";
$res = $this->db->exec_sql(
$sql, array($this->jrn_def_name
, $this->jrn_def_class_deb
@@ -315,6 +323,7 @@
, $this->jrn_def_pj_pref
, $this->jrn_def_bank
, $this->jrn_def_num_op
+ , strip_tags($this->jrn_def_description)
, $this->jrn_def_id)
);
}
@@ -340,6 +349,7 @@
,jrn_def_pj_pref
,jrn_def_bank
,jrn_def_num_op
+,jrn_def_description
from public.jrn_def where jrn_def_id=$1";
/* please adapt */
$res = $this->db->get_array(
Modified: phpcompta/tags/rel670/include/template/param_jrn.php
===================================================================
--- phpcompta/tags/rel670/include/template/param_jrn.php 2013-12-05
01:13:57 UTC (rev 5561)
+++ phpcompta/tags/rel670/include/template/param_jrn.php 2013-12-05
01:14:55 UTC (rev 5562)
@@ -116,6 +116,14 @@
</TD>
</tr>
<?php endif; ?>
+<tr>
+ <td>
+ <?php echo _('Description') ?>
+ </TD>
+ <td>
+ <?php echo $str_description; ?>
+ </td>
+</tr>
</TABLE>
<?php
/////////////////// ACH //////////////////////////////////
Modified: phpcompta/tags/rel670/sql/upgrade.sql
===================================================================
--- phpcompta/tags/rel670/sql/upgrade.sql 2013-12-05 01:13:57 UTC (rev
5561)
+++ phpcompta/tags/rel670/sql/upgrade.sql 2013-12-05 01:14:55 UTC (rev
5562)
@@ -0,0 +1,17 @@
+alter table jrn_def add jrn_def_description text;
+
+CREATE OR REPLACE FUNCTION comptaproc.t_jrn_def_description()
+ RETURNS trigger
+ LANGUAGE plpgsql
+AS $function$
+ declare
+ str varchar(200);
+ BEGIN
+ str := substr(NEW.jrn_def_description,1,200);
+ NEW.jrn_def_description := str;
+
+ RETURN NEW;
+ END;
+$function$
+;
+create trigger jrn_def_description_ins_upd before insert or update on jrn_def
for each row execute procedure comptaproc.t_jrn_def_description();
\ No newline at end of file
---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r5562 - in phpcompta/tags/rel670: include include/template sql,
phpcompta-dev <=