Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2017-04-07 11:03:44 +02:00
commit 5ab8704aee
2 changed files with 27 additions and 4 deletions

View File

@ -92,7 +92,7 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
$newdiscount2->fk_facture=$discount->fk_facture;
$newdiscount1->fk_facture_line=$discount->fk_facture_line;
$newdiscount2->fk_facture_line=$discount->fk_facture_line;
if ($discount->description == '(CREDIT_NOTE)')
if ($discount->description == '(CREDIT_NOTE)' || $discount->description == '(DEPOSIT)')
{
$newdiscount1->description=$discount->description;
$newdiscount2->description=$discount->description;

View File

@ -130,7 +130,9 @@ class CompanyBankAccount extends Account
*/
function update(User $user = null, $notrigger = 0)
{
global $conf;
global $conf;
$error = 0;
if (! $this->id)
{
@ -167,12 +169,33 @@ class CompanyBankAccount extends Account
$result = $this->db->query($sql);
if ($result)
{
return 1;
if (! $notrigger)
{
// Call trigger
$result=$this->call_trigger('COMPANY_RIB_MODIFY',$user);
if ($result < 0) $error++;
// End call triggers
if(! $error )
{
return 1;
}
else
{
return -1;
}
}
else
{
return 1;
}
}
else
{
dol_print_error($this->db);
return 0;
return -1;
}
}