Skip to content

Commit

Permalink
FIX deletion on draft is allowed if we are allwoed to create
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Oct 29, 2018
1 parent d02fccd commit 0266db7
Show file tree
Hide file tree
Showing 3 changed files with 265 additions and 264 deletions.
10 changes: 5 additions & 5 deletions htdocs/compta/facture/card.php
Expand Up @@ -92,11 +92,6 @@
$hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0));
$hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0));

// Security check
$fieldid = (! empty($ref) ? 'facnumber' : 'rowid');
if ($user->societe_id) $socid = $user->societe_id;
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid);

// Nombre de ligne pour choix de produit/service predefinis
$NBLINES = 4;

Expand All @@ -117,6 +112,11 @@
$permissiondellink=$user->rights->facture->creer; // Used by the include of actions_dellink.inc.php
$permissiontoedit = $user->rights->facture->creer; // Used by the include of actions_lineupdonw.inc.php

// Security check
$fieldid = (! empty($ref) ? 'facnumber' : 'rowid');
if ($user->societe_id) $socid = $user->societe_id;
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, null, (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0));


/*
* Actions
Expand Down

0 comments on commit 0266db7

Please sign in to comment.