- Add missing triggers in interface_90
This commit is contained in:
Cedric 2014-06-24 11:49:53 +02:00
parent 0c382ef97e
commit e21e4dbf11
4 changed files with 58 additions and 4 deletions

View File

@ -39,6 +39,9 @@ Fix: [ bug #1455 ] outstanding amount
Fix: [ bug #1425 ] LINEBILL_SUPPLIER_DELETE failure trigger leads to an endless loop
Fix: [ bug #1460 ] Several supplier order triggers do not show error messages
Fix: [ bug #1461 ] LINEORDER_SUPPLIER_CREATE does not intercept supplier order line insertion
Fix: [ bug #1484 ] BILL_SUPPLIER_PAYED trigger action does not intercept failure under some circumstances
Fix: [ bug #1482 ] Several supplier invoice triggers do not show trigger error messages
Fix: [ bug #1486 ] LINEBILL_SUPPLIER_CREATE and LINEBILL_SUPPLIER_UPDATE triggers do not intercept trigger action
***** ChangeLog for 3.5.3 compared to 3.5.2 *****
Fix: Error on field accountancy code for export profile of invoices.

View File

@ -431,6 +431,28 @@ class InterfaceDemo
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
//Supplier Bill
elseif ($action == 'BILL_SUPPLIER_CREATE')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'BILL_SUPPLIER_DELETE')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'BILL_SUPPLIER_PAYED')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'BILL_SUPPLIER_UNPAYED')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'BILL_SUPPLIER_VALIDATE')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'LINEBILL_SUPPLIER_CREATE')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
@ -443,7 +465,7 @@ class InterfaceDemo
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
// Payments
elseif ($action == 'PAYMENT_CUSTOMER_CREATE')
{

View File

@ -651,7 +651,10 @@ class FactureFournisseur extends CommonInvoice
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('BILL_SUPPLIER_DELETE',$this,$user,$langs,$conf);
if ($result < 0) {
$error++; $this->errors=$interface->errors;
$error++;
$this->errors=$interface->errors;
$this->db->rollback();
return -1;
}
// Fin appel triggers
}
@ -1103,7 +1106,13 @@ class FactureFournisseur extends CommonInvoice
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('LINEBILL_SUPPLIER_CREATE',$this,$user,$langs,$conf);
if ($result < 0) { $error++; $this->errors=$interface->errors; }
if ($result < 0)
{
$error++;
$this->errors=$interface->errors;
$this->db->rollback();
return -1;
}
// Fin appel triggers
}
@ -1193,6 +1202,8 @@ class FactureFournisseur extends CommonInvoice
$product_type = $type;
}
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det SET";
$sql.= " description ='".$this->db->escape($desc)."'";
$sql.= ", pu_ht = ".price2num($pu_ht);
@ -1228,17 +1239,26 @@ class FactureFournisseur extends CommonInvoice
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('LINEBILL_SUPPLIER_UPDATE',$this,$user,$langs,$conf);
if ($result < 0) { $error++; $this->errors=$interface->errors; }
if ($result < 0)
{
$error++;
$this->errors=$interface->errors;
$this->db->rollback();
return -1;
}
// Fin appel triggers
}
// Update total price into invoice record
$result=$this->update_price();
$this->db->commit();
return $result;
}
else
{
$this->db->rollback();
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::updateline error=".$this->error, LOG_ERR);
return -1;

View File

@ -188,6 +188,10 @@ elseif ($action == 'confirm_paid' && $confirm == 'yes' && $user->rights->fournis
{
$object->fetch($id);
$result=$object->set_paid($user);
if ($result<0)
{
setEventMessage($object->error,'errors');
}
}
// Set supplier ref
@ -524,6 +528,10 @@ elseif ($action == 'update_line' && $user->rights->fournisseur->facture->creer)
{
unset($_POST['label']);
}
else
{
setEventMessage($object->error,'errors');
}
}
}
@ -1074,6 +1082,7 @@ if ($action == 'create')
print_fiche_titre($langs->trans('NewBill'));
dol_htmloutput_mesg($mesg);
dol_htmloutput_events();
$societe='';
if ($_GET['socid'])