Fix scrutinizer bugs

This commit is contained in:
Laurent Destailleur 2017-12-15 22:14:28 +01:00
parent 929893bd49
commit 9cdf322bfb
8 changed files with 13 additions and 9 deletions

View File

@ -41,6 +41,9 @@ if (!$user->rights->banque->lire)
function valeur($sql)
{
global $db;
$valeur = 0;
$resql=$db->query($sql);
if ($resql)
{

View File

@ -60,8 +60,6 @@ class Deplacement extends CommonObject
$this->statuts_short = array(0 => 'Draft', 1 => 'Validated', 2 => 'Refunded');
$this->statuts = array(0 => 'Draft', 1 => 'Validated', 2 => 'Refunded');
return 1;
}
/**

View File

@ -26,8 +26,7 @@ include_once DOL_DOCUMENT_ROOT . '/core/class/stats.class.php';
include_once DOL_DOCUMENT_ROOT . '/compta/deplacement/class/deplacement.class.php';
/**
* \class DeplacementStats
* \brief Classe permettant la gestion des stats des deplacements et notes de frais
* Classe permettant la gestion des stats des deplacements et notes de frais
*/
class DeplacementStats extends Stats
{

View File

@ -4594,7 +4594,8 @@ class Form
}
if (! empty($conf->global->SERVICE_ARE_ECOMMERCE_200238EC)) // If option to have vat for end customer for services is on
{
if (! $societe_vendeuse->isInEEC() && (! is_object($societe_acheteuse) || ($societe_acheteuse->isInEEC() && ! $societe_acheteuse->isACompany())))
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
if (! isInEEC($societe_vendeuse) && (! is_object($societe_acheteuse) || (isInEEC($societe_acheteuse) && ! $societe_acheteuse->isACompany())))
{
// We also add the buyer
if (is_numeric($type))

View File

@ -581,6 +581,8 @@ function getFormeJuridiqueLabel($code)
*/
function isInEEC($object)
{
if (empty($object->country_code)) return false;
// List of all country codes that are in europe for european vat rules
// List found on http://ec.europa.eu/taxation_customs/common/faq/faq_1179_en.htm#9
$country_code_in_EEC=array(

View File

@ -57,6 +57,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
// Event/record is qualified
$qualified = 0;
$amounts = 0;
if ($action==='BILL_VALIDATE' || $action==='BILL_DELETE' || $action === 'BILL_SENTBYMAIL'
|| (in_array($object->element, array('facture','suplier_invoice')) && $action === 'DOC_DOWNLOAD') || (in_array($object->element, array('facture','suplier_invoice')) && $action === 'DOC_PREVIEW')
)

View File

@ -3885,6 +3885,8 @@ function migrate_event_assignement_contact($db,$langs,$conf)
*/
function migrate_reset_blocked_log($db,$langs,$conf)
{
global $user;
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
print '<tr><td colspan="4">';
@ -3945,7 +3947,7 @@ function migrate_reset_blocked_log($db,$langs,$conf)
$object->entity = $obj->entity;
$object->date = dol_now();
$b=new BlockedLog($this->db);
$b=new BlockedLog($db);
$b->setObjectData($object, 'MODULE_SET', 0);
$res = $b->create($user);

View File

@ -50,7 +50,7 @@ class UserGroup extends CommonObject
public $datem; // Modification date of group
public $members=array(); // Array of users
public $nb_rights; // Number of rights granted to the user
public $nb_rights; // Number of rights granted to the user
private $_tab_loaded=array(); // Array of cache of already loaded permissions
@ -66,8 +66,6 @@ class UserGroup extends CommonObject
{
$this->db = $db;
$this->nb_rights = 0;
return 0;
}