Merge remote-tracking branch 'upstream/develop' into Squiz.Scope.MethodScope.Missing
This commit is contained in:
commit
be8db31388
@ -312,6 +312,57 @@ class FactureRec extends CommonInvoice
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update a line to invoice_rec.
|
||||
*
|
||||
* @param User $user User
|
||||
* @param int $notrigger No trigger
|
||||
* @return int <0 if KO, Id of line if OK
|
||||
*/
|
||||
function update(User $user, $notrigger = 0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_rec SET";
|
||||
$sql.= " fk_soc = ".$this->fk_soc;
|
||||
// TODO Add missing fields
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||
{
|
||||
$result=$this->insertExtraFields();
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error && ! $notrigger)
|
||||
{
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('BILLREC_UPDATE', $user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load object and lines
|
||||
*
|
||||
@ -1873,7 +1924,7 @@ class FactureLigneRec extends CommonInvoiceLine
|
||||
if (! $error && ! $notrigger)
|
||||
{
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINEBILL_REC_UPDATE', $user);
|
||||
$result=$this->call_trigger('LINEBILLREC_UPDATE', $user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->db->rollback();
|
||||
|
||||
@ -28,7 +28,7 @@ namespace test\unit;
|
||||
* Class BillOfMaterialsTest
|
||||
* @package Testbillofmaterials
|
||||
*/
|
||||
class BillOfMaterialsTest extends \PHPUnit_Framework_TestCase
|
||||
class BOMTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Global test setup
|
||||
Loading…
Reference in New Issue
Block a user