Pass user to the delete function
This commit is contained in:
parent
531ebc4c48
commit
c5961d8386
@ -480,7 +480,7 @@ class FactureRec extends CommonInvoice
|
||||
* @param int $idwarehouse Id warehouse to use for stock change.
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function delete($user, $notrigger=0, $idwarehouse=-1)
|
||||
function delete(User $user, $notrigger=0, $idwarehouse=-1)
|
||||
{
|
||||
$rowid=$this->id;
|
||||
|
||||
@ -1361,7 +1361,9 @@ class FactureLigneRec extends CommonInvoiceLine
|
||||
/**
|
||||
* Delete line in database
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user Object user
|
||||
* @param int $notrigger Disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function delete(User $user, $notrigger = false)
|
||||
{
|
||||
|
||||
@ -300,7 +300,7 @@ if (empty($reshook))
|
||||
// Delete
|
||||
if ($action == 'confirm_deleteinvoice' && $confirm == 'yes' && $user->rights->facture->supprimer)
|
||||
{
|
||||
$object->delete();
|
||||
$object->delete($user);
|
||||
header("Location: " . $_SERVER['PHP_SELF'] );
|
||||
exit;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user