Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
698b13a229
@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) ---Put here your own copyright and developer email---
|
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -17,43 +16,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file product/inventory/card.php
|
* \file htdocs/product/inventory/card.php
|
||||||
* \ingroup inventory
|
* \ingroup inventory
|
||||||
* \brief This file is an example of a php page
|
* \brief Inventory card
|
||||||
* Put here some comments
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1');
|
require '../../main.inc.php';
|
||||||
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1');
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||||
//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
include_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php';
|
||||||
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
|
|
||||||
//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check anti CSRF attack test
|
|
||||||
//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check anti CSRF attack test
|
|
||||||
//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test
|
|
||||||
//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data
|
|
||||||
//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not check anti POST attack test
|
|
||||||
//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu
|
|
||||||
//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php
|
|
||||||
//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not load ajax.lib.php library
|
|
||||||
//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session)
|
|
||||||
|
|
||||||
// Load Dolibarr environment
|
|
||||||
$res=0;
|
|
||||||
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
|
|
||||||
if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php");
|
|
||||||
// Try main.inc.php into web root detected using web root caluclated from SCRIPT_FILENAME
|
|
||||||
$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
|
|
||||||
while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
|
|
||||||
if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php");
|
|
||||||
if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php");
|
|
||||||
// Try main.inc.php using relative path
|
|
||||||
if (! $res && file_exists("../main.inc.php")) $res=@include("../main.inc.php");
|
|
||||||
if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php");
|
|
||||||
if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main.inc.php");
|
|
||||||
if (! $res) die("Include of main fails");
|
|
||||||
|
|
||||||
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
|
|
||||||
dol_include_once('/inventory/class/inventory.class.php');
|
|
||||||
|
|
||||||
// Load traductions files requiredby by page
|
// Load traductions files requiredby by page
|
||||||
$langs->loadLangs(array("inventory","other"));
|
$langs->loadLangs(array("inventory","other"));
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) ---Put here your own copyright and developer email---
|
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -17,45 +16,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file product/inventory/list.php
|
* \file htdocs/product/inventory/list.php
|
||||||
* \ingroup inventory
|
* \ingroup inventory
|
||||||
* \brief List page for monmodule
|
* \brief List page for inventory
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1');
|
require '../../main.inc.php';
|
||||||
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1');
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||||
//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
|
||||||
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
|
|
||||||
//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check anti CSRF attack test
|
|
||||||
//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check anti CSRF attack test
|
|
||||||
//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test
|
|
||||||
//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data
|
|
||||||
//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not check anti POST attack test
|
|
||||||
//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu
|
|
||||||
//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php
|
|
||||||
//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not load ajax.lib.php library
|
|
||||||
//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session)
|
|
||||||
|
|
||||||
|
|
||||||
// Load Dolibarr environment
|
|
||||||
$res=0;
|
|
||||||
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
|
|
||||||
if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php");
|
|
||||||
// Try main.inc.php into web root detected using web root caluclated from SCRIPT_FILENAME
|
|
||||||
$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
|
|
||||||
while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
|
|
||||||
if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php");
|
|
||||||
if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php");
|
|
||||||
// Try main.inc.php using relative path
|
|
||||||
if (! $res && file_exists("../main.inc.php")) $res=@include("../main.inc.php");
|
|
||||||
if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php");
|
|
||||||
if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main.inc.php");
|
|
||||||
if (! $res) die("Include of main fails");
|
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||||
dol_include_once('/inventory/class/inventory.class.php');
|
require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php';
|
||||||
|
|
||||||
// Load traductions files requiredby by page
|
// Load traductions files requiredby by page
|
||||||
$langs->loadLangs(array("inventory","other"));
|
$langs->loadLangs(array("inventory","other"));
|
||||||
@ -177,7 +147,7 @@ if (empty($reshook))
|
|||||||
$permtoread = $user->rights->inventory->read;
|
$permtoread = $user->rights->inventory->read;
|
||||||
$permtodelete = $user->rights->inventory->delete;
|
$permtodelete = $user->rights->inventory->delete;
|
||||||
$uploaddir = $conf->inventory->dir_output;
|
$uploaddir = $conf->inventory->dir_output;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
//include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; // TODO to fix for product module
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -357,17 +357,17 @@ if ($usevirtualstock)
|
|||||||
|
|
||||||
if ($salert == 'on') // Option to see when stock is lower than alert
|
if ($salert == 'on') // Option to see when stock is lower than alert
|
||||||
{
|
{
|
||||||
$sql.= ' AND ('.$sqlalertstock.' > 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')';
|
$sql.= ' AND ('.$sqlalertstock.' >= 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')';
|
||||||
$sql.= ' - ('.$sqlCommandesCli.' - '.$sqlExpeditionsCli.') + ('.$sqlCommandesFourn.' - '.$sqlReceptionFourn.')))';
|
$sql.= ' - ('.$sqlCommandesCli.' - '.$sqlExpeditionsCli.') + ('.$sqlCommandesFourn.' - '.$sqlReceptionFourn.')))';
|
||||||
$alertchecked = 'checked';
|
$alertchecked = 'checked';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$sql.= ' HAVING (('.$sqldesiredtock.' > 0 AND ('.$sqldesiredtock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')))';
|
$sql.= ' HAVING (('.$sqldesiredtock.' >= 0 AND ('.$sqldesiredtock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')))';
|
||||||
$sql.= ' OR ('.$sqlalertstock.' > 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").'))))';
|
$sql.= ' OR ('.$sqlalertstock.' >= 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").'))))';
|
||||||
|
|
||||||
if ($salert == 'on') // Option to see when stock is lower than alert
|
if ($salert == 'on') // Option to see when stock is lower than alert
|
||||||
{
|
{
|
||||||
$sql.= ' AND ('.$sqlalertstock.' > 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')))';
|
$sql.= ' AND ('.$sqlalertstock.' >= 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')))';
|
||||||
$alertchecked = 'checked';
|
$alertchecked = 'checked';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user