From 2b9217003242ffd72a988c857504f8ec874effe9 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Fri, 28 Jan 2011 11:38:49 +0000 Subject: [PATCH] Compute_internal use now hexadecimal and jrn_def_code is now the first letter + 2 digits --- include/class_acc_ledger.php | 4 ++-- include/param_jrn_add.inc.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/class_acc_ledger.php b/include/class_acc_ledger.php index 7c62f3535..858997d9a 100644 --- a/include/class_acc_ledger.php +++ b/include/class_acc_ledger.php @@ -1710,10 +1710,10 @@ class Acc_Ledger function compute_internal_code($p_grpt) { if ( $this->id==0) return; - $num = $this->db->get_next_seq('s_internal'); + $num =$this->db->get_next_seq('s_internal'); $atype=$this->get_propertie(); $type=$atype['jrn_def_code']; - $internal_code=sprintf("%s-%s",$type,$num); + $internal_code=sprintf("%s%06X",$type,$num); $this->jr_internal=$internal_code; return $internal_code; } diff --git a/include/param_jrn_add.inc.php b/include/param_jrn_add.inc.php index 66a3d35d9..98c4973c5 100644 --- a/include/param_jrn_add.inc.php +++ b/include/param_jrn_add.inc.php @@ -79,7 +79,7 @@ if ( isset ($_POST["add"]) ) $p_jrn_class_deb=FormatString($_POST["p_jrn_class_deb"]); if (strlen(trim($p_jrn_name))==0) return; // compute the jrn_def.jrn_def_code - $p_code=sprintf("%s-%02d",trim($_POST['p_jrn_type']),Acc_Ledger::next_number($cn,$_POST['p_jrn_type'])); + $p_code=sprintf("%s%02d",trim(substr($_POST['p_jrn_type'],0,1)),Acc_Ledger::next_number($cn,$_POST['p_jrn_type'])); $p_jrn_fiche_deb=""; $p_jrn_fiche_cred="";