Merge branch 'master' into devel
This commit is contained in:
commit
6c0e04216c
2 changed files with 11 additions and 2 deletions
|
|
@ -132,6 +132,7 @@ var ManageTable = function (p_table_name)
|
|||
var row=p_table.insertRow(p_table.rows.length);
|
||||
row.innerHTML=p_element_row.innerHTML;
|
||||
row.id=p_element_row.id;
|
||||
row.ctl_pk_id=row.id;
|
||||
return;
|
||||
}
|
||||
// loop for each row , compare the innerHTML of the column with the
|
||||
|
|
@ -152,6 +153,7 @@ var ManageTable = function (p_table_name)
|
|||
var row=p_table.insertRow(i);
|
||||
row.innerHTML=p_element_row.innerHTML;
|
||||
row.id=p_element_row.id;
|
||||
row.ctl_pk_id=row.id;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -306,12 +306,19 @@ class Tva_Rate_MTable extends Manage_Table_SQL
|
|||
{
|
||||
$this->set_error("tva_both_side", _("Choix incorrect"));
|
||||
}
|
||||
|
||||
$flag = true;
|
||||
if ( isNumber($this->table->tva_id) == 0 || $this->table->tva_id != round($this->table->tva_id) )
|
||||
{
|
||||
$this->set_error("tva_id",_("Valeur invalide"));
|
||||
$flag=false;
|
||||
}
|
||||
// Check if old tva_id was not overwritting something
|
||||
if ( $this->previous_id != $this->table->tva_id && $cn->get_value("select count(*) from tva_rate where tva_id=$1",[$this->table->tva_id]) > 0)
|
||||
if ( $flag && $this->previous_id != $this->table->tva_id && $cn->get_value("select count(*) from tva_rate where tva_id=$1",[$this->table->tva_id]) > 0)
|
||||
{
|
||||
$this->set_error("tva_id",_("Code TVA déjà utilisé"));
|
||||
}
|
||||
// Check that tva_id is a integer not a float
|
||||
|
||||
if ($this->count_error()!=0)
|
||||
return false;
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue