diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js
index c211b75a3..1ac13c981 100644
--- a/html/js/acc_ledger.js
+++ b/html/js/acc_ledger.js
@@ -163,7 +163,7 @@ function success_update_bank(req)
}
catch (e)
{
- alert("success_update_bank".e.message);
+ alert("success_update_bank"+e.message);
}
}
/**
@@ -265,11 +265,12 @@ function ledger_fin_add_row()
*/
function ledger_add_row()
{
+ try{
style='class="input_text"';
var mytable=g("sold_item").tBodies[0];
var ofirstRow=mytable.rows[1];
var line=mytable.rows.length;
- var nCell=9;
+ var nCell=mytable.rows[1].cells.length;
var row=mytable.insertRow(line);
var nb=g("nb_item");
for (var e=0;ebank_id == "" )
{
echo h2("Journal de banque non configuré ".$this->get_name(),' class="error"');
- echo ' vous devez donner à ce journal un compte en banque (fiche), modifiez dans CFGLEDGER';
+ echo ' vous devez donner à ce journal un compte en banque (fiche), modifiez dans CFGLED';
alert ("Journal de banque non configuré ".$this->get_name());
}
diff --git a/include/class_acc_ledger_purchase.php b/include/class_acc_ledger_purchase.php
index 4bbe06896..ddeaad489 100644
--- a/include/class_acc_ledger_purchase.php
+++ b/include/class_acc_ledger_purchase.php
@@ -723,7 +723,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
if ( isset($_POST['gen_invoice']) )
{
$ref_doc= $this->create_document($internal,$p_array);
- $this->doc= _('Document généré')." : ";
+ $this->doc= _('Document généré')." : "."
";
$this->doc.=''.$ref_doc.'';
}
diff --git a/include/class_acc_ledger_sold.php b/include/class_acc_ledger_sold.php
index 227b1c50c..796d6c32a 100644
--- a/include/class_acc_ledger_sold.php
+++ b/include/class_acc_ledger_sold.php
@@ -498,7 +498,7 @@ class Acc_Ledger_Sold extends Acc_Ledger
if ( isset($_POST['gen_invoice']))
{
$file=$this->create_document($internal,$p_array);
- $this->doc= _('Document généré')." : ";
+ $this->doc= _('Document généré')." : "."
";
$this->doc.=''.$file.'';
}
}
diff --git a/include/class_fiche.php b/include/class_fiche.php
index 8343279a3..4ad851454 100644
--- a/include/class_fiche.php
+++ b/include/class_fiche.php
@@ -934,47 +934,51 @@ class Fiche
}
// account
- if ( $id == ATTR_DEF_ACCOUNT )
- {
- $v=sql_string($value);
- if ( trim($v) != '' )
- {
- if ( strpos($v,',') != 0)
- {
- $v=$this->cn->get_value('select format_account($1)',
- array($v));
- }
- $sql=sprintf("select account_update(%d,'%s')",
- $this->id,$v);
- try
- {
- $this->cn->exec_sql($sql);
- }
- catch (Exception $e)
- {
- throw new Exception(__LINE__."Erreur : ce compte [$v] n'a pas de compte parent.".
- "L'opération est annulée");
- }
- continue;
- }
- if ( strlen (trim($v)) == 0 )
- {
+ if ($id == ATTR_DEF_ACCOUNT)
+ {
+ $v = sql_string($value);
+ if (trim($v) != '')
+ {
+ if (strpos($v, ',') != 0)
+ {
+ $ac_array = explode(",", $v);
+ if (count($ac_array) <> 2)
+ throw new Exception('Désolé, il y a trop de virgule dans le poste comptable ' . h($v));
+ $part1 = $ac_array[0];
+ $part2 = $ac_array[1];
+ $part1 = $this->cn->get_value('select format_account($1)', array($part1));
+ $part2 = $this->cn->get_value('select format_account($1)', array($part2));
+ $v = $part1 . ',' . $part2;
+ }
+ $sql = sprintf("select account_update(%d,'%s')", $this->id, $v);
+ try
+ {
+ $this->cn->exec_sql($sql);
+ }
+ catch (Exception $e)
+ {
+ throw new Exception(__LINE__ . "Erreur : ce compte [$v] n'a pas de compte parent." .
+ "L'opération est annulée");
+ }
+ continue;
+ }
+ if (strlen(trim($v)) == 0)
+ {
- $sql=sprintf("select account_update(%d,null)",
- $this->id);
- try
- {
- $Ret=$this->cn->exec_sql($sql);
- }
- catch (Exception $e)
- {
- throw new Exception(__LINE__."Erreur : ce compte [$v] n'a pas de compte parent.".
- "L'opération est annulée");
- }
+ $sql = sprintf("select account_update(%d,null)", $this->id);
+ try
+ {
+ $Ret = $this->cn->exec_sql($sql);
+ }
+ catch (Exception $e)
+ {
+ throw new Exception(__LINE__ . "Erreur : ce compte [$v] n'a pas de compte parent." .
+ "L'opération est annulée");
+ }
- continue;
- }
- }
+ continue;
+ }
+ }
// TVA
if ( $id == ATTR_DEF_TVA )
{
diff --git a/include/user.inc.php b/include/user.inc.php
index cd9943802..82690341a 100644
--- a/include/user.inc.php
+++ b/include/user.inc.php
@@ -101,7 +101,7 @@ $compteur=0;
$header=new Sort_Table();
$url=basename($_SERVER['PHP_SELF'])."?action=".$_REQUEST['action'];
$header->add("Login", $url," order by use_login asc", "order by use_login desc","la", "ld");
-$header->add("Nom", $url," order by use_login asc", "order by use_login desc","na", "nd");
+$header->add("Nom", $url," order by use_name asc,use_first_name asc", "order by use_name desc,use_first_name desc","na", "nd");
$header->add('Dossier',$url,' order by ag_dossier asc','order by ag_dossier desc',
'da','dd');
$header->add("Actif", $url," order by use_active asc", "order by use_active desc","aa", "ad");
diff --git a/include/user_detail.inc.php b/include/user_detail.inc.php
index 2082bd848..bcabe1f59 100644
--- a/include/user_detail.inc.php
+++ b/include/user_detail.inc.php
@@ -86,12 +86,11 @@ else
if (isset($_POST["DELETE"]))
{
$cn = new Database();
- $Res = $cn->exec_sql("delete from priv_user where priv_jnt in ( select jnt_id from jnt_use_dos where use_id=$1", array($uid));
+ $Res = $cn->exec_sql("delete from priv_user where priv_jnt in ( select jnt_id from jnt_use_dos where use_id=$1)", array($uid));
$Res = $cn->exec_sql("delete from jnt_use_dos where use_id=$1", array($uid));
$Res = $cn->exec_sql("delete from ac_users where use_id=$1", array($uid));
- echo " User " . h($_POST['fname']) . " " . h($_POST['lname']) . " (" .
- h($_POST['login']) . ") est effacé
";
+ echo " User " . h($_POST['fname']) . " " . h($_POST['lname']) . " est effacé
";
require_once("class_iselect.php");
require_once("user.inc.php");
return;