*
* 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
@@ -54,11 +55,11 @@ $day = GETPOST('day', 'int');
$month = GETPOST('month', 'int');
$year = GETPOST('year', 'int');
-$search_ref = GETPOST("search_ref", "alpha");
-$search_account = GETPOST("search_account", "int");
-$search_paymenttype = GETPOST("search_paymenttype");
-$search_amount = GETPOST("search_amount", 'alpha'); // alpha because we must be able to search on "< x"
-$search_company = GETPOST("search_company", 'alpha');
+$search_ref = GETPOST('search_ref', 'alpha');
+$search_account = GETPOST('search_account', 'int');
+$search_paymenttype = GETPOST('search_paymenttype');
+$search_amount = GETPOST('search_amount', 'alpha'); // alpha because we must be able to search on "< x"
+$search_company = GETPOST('search_company', 'alpha');
$search_payment_num = GETPOST('search_payment_num', 'alpha');
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
@@ -773,10 +774,13 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
}
}
- // Save Button
+ // Save + Cancel Buttons
if ($action != 'add_paiement') {
print '
'.$langs->trans("ClosePaidInvoicesAutomatically");
- print '
';
+ print '
';
+ print '
';
+ print '
';
+ print '
';
}
// Form to confirm payment
diff --git a/htdocs/includes/OAuth/OAuth2/Service/WordPress.php b/htdocs/includes/OAuth/OAuth2/Service/WordPress.php
index 4d6d81e086d..79a13d00e2d 100755
--- a/htdocs/includes/OAuth/OAuth2/Service/WordPress.php
+++ b/htdocs/includes/OAuth/OAuth2/Service/WordPress.php
@@ -11,17 +11,28 @@ use OAuth\Common\Http\Exception\TokenResponseException;
use OAuth\OAuth2\Service\Exception\InvalidAccessTypeException;
use OAuth\Common\Http\Uri\Uri;
+/**
+ * Class For WordPress OAuth
+ */
class WordPress extends AbstractService
{
+ /**
+ * @var string
+ */
protected $accessType = 'online';
- public function __construct(
- CredentialsInterface $credentials,
- ClientInterface $httpClient,
- TokenStorageInterface $storage,
- $scopes = array(),
- UriInterface $baseApiUri = null
- ) {
+ /**
+ * Construct
+ *
+ * @param CredentialsInterface $credentials credentials
+ * @param ClientInterface $httpClient httpClient
+ * @param TokenStorageInterface $storage storage
+ * @param $scopes scope
+ * @param UriInterface|null $baseApiUri baseApiUri
+ * @throws Exception\InvalidScopeException
+ */
+ public function __construct(CredentialsInterface $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, $scopes = array(), UriInterface $baseApiUri = null)
+ {
parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri, true);
if (null === $baseApiUri) {
@@ -41,7 +52,7 @@ class WordPress extends AbstractService
}*/
/**
- * {@inheritdoc}
+ * @return Uri
*/
public function getAuthorizationEndpoint()
{
@@ -49,7 +60,7 @@ class WordPress extends AbstractService
}
/**
- * {@inheritdoc}
+ * @return Uri
*/
public function getAccessTokenEndpoint()
{
@@ -57,7 +68,7 @@ class WordPress extends AbstractService
}
/**
- * {@inheritdoc}
+ * @return int
*/
protected function getAuthorizationMethod()
{
@@ -66,7 +77,9 @@ class WordPress extends AbstractService
}
/**
- * {@inheritdoc}
+ * @param $responseBody responseBody
+ * @return StdOAuth2Token
+ * @throws TokenResponseException
*/
protected function parseAccessTokenResponse($responseBody)
{
diff --git a/htdocs/install/check.php b/htdocs/install/check.php
index d3c5cba1290..f260be4f9fb 100644
--- a/htdocs/install/check.php
+++ b/htdocs/install/check.php
@@ -420,29 +420,26 @@ if (!file_exists($conffile)) {
if (GETPOST('allowupgrade')) {
$allowupgrade = true;
}
- $migrationscript = array(
- array('from'=>'3.0.0', 'to'=>'3.1.0'),
- array('from'=>'3.1.0', 'to'=>'3.2.0'),
- array('from'=>'3.2.0', 'to'=>'3.3.0'),
- array('from'=>'3.3.0', 'to'=>'3.4.0'),
- array('from'=>'3.4.0', 'to'=>'3.5.0'),
- array('from'=>'3.5.0', 'to'=>'3.6.0'),
- array('from'=>'3.6.0', 'to'=>'3.7.0'),
- array('from'=>'3.7.0', 'to'=>'3.8.0'),
- array('from'=>'3.8.0', 'to'=>'3.9.0'),
- array('from'=>'3.9.0', 'to'=>'4.0.0'),
- array('from'=>'4.0.0', 'to'=>'5.0.0'),
- array('from'=>'5.0.0', 'to'=>'6.0.0'),
- array('from'=>'6.0.0', 'to'=>'7.0.0'),
- array('from'=>'7.0.0', 'to'=>'8.0.0'),
- array('from'=>'8.0.0', 'to'=>'9.0.0'),
- array('from'=>'9.0.0', 'to'=>'10.0.0'),
- array('from'=>'10.0.0', 'to'=>'11.0.0'),
- array('from'=>'11.0.0', 'to'=>'12.0.0'),
- array('from'=>'12.0.0', 'to'=>'13.0.0'),
- array('from'=>'13.0.0', 'to'=>'14.0.0'),
- array('from'=>'14.0.0', 'to'=>'15.0.0'),
- );
+
+ $dir = DOL_DOCUMENT_ROOT."/install/mysql/migration/"; // We use mysql migration scripts whatever is database driver
+ dolibarr_install_syslog("Scan sql files for migration files in ".$dir);
+
+ // Get files list of migration file x.y.z-a.b.c.sql into /install/mysql/migration
+ $migrationscript = array();
+ $handle = opendir($dir);
+ if (is_resource($handle)) {
+ while (($file = readdir($handle)) !== false) {
+ $reg = array();
+ if (preg_match('/^(\d+\.\d+\.\d+)-(\d+\.\d+\.\d+)\.sql$/i', $file, $reg)) {
+ if (!empty($reg[2]) && version_compare(DOL_VERSION, $reg[2])) {
+ $migrationscript[] = array('from' => $reg[1], 'to' => $reg[2]);
+ }
+ }
+ }
+ $migrationscript = dol_sort_array($migrationscript, 'from', 'asc', 1);
+ } else {
+ print ''.$langs->trans("ErrorCanNotReadDir", $dir).'
';
+ }
$count = 0;
foreach ($migrationscript as $migarray) {
diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql
index 0f223d520e5..4ee300998ea 100644
--- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql
+++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql
@@ -39,3 +39,5 @@ UPDATE llx_rights_def SET perms = 'writeall' WHERE perms = 'writeall_advance' AN
-- v16
+-- Missing in v14 or lower
+ALTER TABLE llx_projet_task_time ADD COLUMN fk_product integer NULL;
diff --git a/htdocs/install/mysql/tables/llx_projet_task_time.sql b/htdocs/install/mysql/tables/llx_projet_task_time.sql
index 786d8907588..63eadb1177f 100644
--- a/htdocs/install/mysql/tables/llx_projet_task_time.sql
+++ b/htdocs/install/mysql/tables/llx_projet_task_time.sql
@@ -24,6 +24,7 @@ create table llx_projet_task_time
task_datehour datetime, -- day + hour
task_date_withhour integer DEFAULT 0, -- 0 by default, 1 if date was entered with start hour
task_duration double,
+ fk_product integer NULL,
fk_user integer,
thm double(24,8),
invoice_id integer DEFAULT NULL, -- If we need to invoice each line of timespent, we can save invoice id here
diff --git a/htdocs/intracommreport/card.php b/htdocs/intracommreport/card.php
index 4dfc3250014..c769b89f9b8 100644
--- a/htdocs/intracommreport/card.php
+++ b/htdocs/intracommreport/card.php
@@ -13,7 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
+ * along with this program. If not, see .
*/
/**
@@ -21,6 +21,18 @@
* \ingroup Intracomm report
* \brief Page to manage intracomm report export
*/
+
+
+/** Terms
+ *
+ * DEB = Declaration d'Exchanges de Biens (FR) = Declaration of Exchange of Goods (EN)
+ * DES = Déclaration Européenne de Services (FR) = European Declaration of Services (EN)
+ *
+ * INTRACOMM: Douanes françaises (FR) = french customs (EN) - https://www.douane.gouv.fr/professionnels/commerce-international/import-export
+ *
+ */
+
+
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
@@ -29,7 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/intracommreport/class/intracommreport.class.php
$langs->loadLangs(array("intracommreport"));
$action = GETPOST('action');
-$exporttype = GETPOSTISSET('exporttype') ? GETPOST('exporttype', 'alphanohtml') : 'deb'; // DEB ou DES
+$exporttype = GETPOSTISSET('exporttype') ? GETPOST('exporttype', 'alphanohtml') : 'deb'; // DEB or DES
$year = GETPOSTINT('year');
$month = GETPOSTINT('month');
$label = (string) GETPOST('label', 'alphanohtml');
diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php
index 2e7b4186a87..29db4bcb669 100644
--- a/htdocs/mrp/class/mo.class.php
+++ b/htdocs/mrp/class/mo.class.php
@@ -1300,6 +1300,17 @@ class Mo extends CommonObject
{
global $langs, $hookmanager, $conf, $form;
+ $langs->load('stocks');
+ $text_stock_options = $langs->trans("RealStockDesc").'
';
+ $text_stock_options .= $langs->trans("RealStockWillAutomaticallyWhen").'
';
+ $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE) ? '- '.$langs->trans("DeStockOnShipment").'
' : '');
+ $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) ? '- '.$langs->trans("DeStockOnValidateOrder").'
' : '');
+ $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_BILL) ? '- '.$langs->trans("DeStockOnBill").'
' : '');
+ $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) ? '- '.$langs->trans("ReStockOnBill").'
' : '');
+ $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) ? '- '.$langs->trans("ReStockOnValidateOrder").'
' : '');
+ $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) ? '- '.$langs->trans("ReStockOnDispatchOrder").'
' : '');
+ $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE) ? '- '.$langs->trans("StockOnReception").'
' : '');
+
print '';
print '| '.$langs->trans('Ref').' | ';
print ''.$langs->trans('Qty');
@@ -1309,6 +1320,8 @@ class Mo extends CommonObject
print ' ('.$langs->trans("ForAQuantityToConsumeOf", $this->bom->qty).')';
}
print ' | ';
+ print ''.$form->textwithpicto($langs->trans("PhysicalStock"), $text_stock_options, 1).' | ';
+ print ''.$form->textwithpicto($langs->trans("VirtualStock"), $langs->trans("VirtualStockDesc")).' | ';
print ''.$langs->trans('QtyFrozen').' | ';
print ''.$langs->trans('DisableStockChange').' | ';
//print ''.$langs->trans('Efficiency').' | ';
@@ -1358,6 +1371,7 @@ class Mo extends CommonObject
if (!empty($line->fk_product)) {
$productstatic = new Product($this->db);
$productstatic->fetch($line->fk_product);
+ $productstatic->load_virtual_stock();
$this->tpl['label'] .= $productstatic->getNomUrl(1);
//$this->tpl['label'].= ' - '.$productstatic->label;
} else {
@@ -1370,6 +1384,9 @@ class Mo extends CommonObject
$this->tpl['qty_bom'] = $this->bom->qty;
}
+ $this->tpl['stock'] = $productstatic->stock_reel;
+ $this->tpl['seuil_stock_alerte'] = $productstatic->seuil_stock_alerte;
+ $this->tpl['virtual_stock'] = $productstatic->stock_theorique;
$this->tpl['qty'] = $line->qty;
$this->tpl['qty_frozen'] = $line->qty_frozen;
$this->tpl['disable_stock_change'] = $line->disable_stock_change;
diff --git a/htdocs/mrp/tpl/originproductline.tpl.php b/htdocs/mrp/tpl/originproductline.tpl.php
index 478c6504979..ba1d7fccd86 100644
--- a/htdocs/mrp/tpl/originproductline.tpl.php
+++ b/htdocs/mrp/tpl/originproductline.tpl.php
@@ -39,6 +39,16 @@ $qtytoconsumeforline = price2num($qtytoconsumeforline, 'MS');
print '
';
print '| '.$this->tpl['label'].' | ';
print ''.$this->tpl['qty'].(($this->tpl['efficiency'] > 0 && $this->tpl['efficiency'] < 1) ? ' / '.$form->textwithpicto($this->tpl['efficiency'], $langs->trans("ValueOfMeansLoss")).' = '.$qtytoconsumeforline : '').' | ';
+print ''.(empty($this->tpl['stock']) ? 0 : price2num($this->tpl['stock'], 'MS'));
+if ($this->tpl['seuil_stock_alerte'] != '' && ($this->tpl['stock'] < $this->tpl['seuil_stock_alerte'])) {
+ print ' '.img_warning($langs->trans("StockLowerThanLimit", $this->tpl['seuil_stock_alerte']));
+}
+print ' | ';
+print ''.((empty($this->tpl['virtual_stock']) ? 0 : price2num($this->tpl['virtual_stock'], 'MS')));
+if ($this->tpl['seuil_stock_alerte'] != '' && ($this->tpl['virtual_stock'] < $this->tpl['seuil_stock_alerte'])) {
+ print ' '.img_warning($langs->trans("StockLowerThanLimit", $this->tpl['seuil_stock_alerte']));
+}
+print ' | ';
print ''.($this->tpl['qty_frozen'] ? yn($this->tpl['qty_frozen']) : '').' | ';
print ''.($this->tpl['disable_stock_change'] ? yn($this->tpl['disable_stock_change']) : '').' | ';
//print ''.$this->tpl['efficiency'].' | ';