';
- $tmp = ''.$langs->trans('NoSituations').'') || (GETPOST('origin') && GETPOST('origin') != 'facture' && GETPOST('origin') != 'commande'))
$tmp .= ' disabled';
$tmp .= '> ';
diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php
index 60ab41d22cb..5b17ef22ddf 100644
--- a/htdocs/core/boxes/box_produits_alerte_stock.php
+++ b/htdocs/core/boxes/box_produits_alerte_stock.php
@@ -88,7 +88,9 @@ class box_produits_alerte_stock extends ModeleBoxes
if (($user->rights->produit->lire || $user->rights->service->lire) && $user->rights->stock->lire)
{
- $sql = "SELECT p.rowid, p.label, p.price, p.ref, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.seuil_stock_alerte, p.entity,";
+ $sql = "SELECT p.rowid, p.label, p.price, p.ref, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.barcode, p.seuil_stock_alerte, p.entity,";
+ $sql .= " p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,";
+ $sql .= " p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export,";
$sql .= " SUM(".$this->db->ifsql("s.reel IS NULL", "0", "s.reel").") as total_stock";
$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as s on p.rowid = s.fk_product";
@@ -103,8 +105,10 @@ class box_produits_alerte_stock extends ModeleBoxes
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
}
- $sql .= " GROUP BY p.rowid, p.ref, p.label, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.seuil_stock_alerte, p.entity";
- $sql .= " HAVING SUM(".$this->db->ifsql("s.reel IS NULL", "0", "s.reel").") < p.seuil_stock_alerte";
+ $sql .= " GROUP BY p.rowid, p.ref, p.label, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.barcode, p.seuil_stock_alerte, p.entity,";
+ $sql .= " p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,";
+ $sql .= " p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export";
+ $sql .= " HAVING SUM(".$this->db->ifsql("s.reel IS NULL", "0", "s.reel").") < p.seuil_stock_alerte";
$sql .= $this->db->order('p.seuil_stock_alerte', 'DESC');
$sql .= $this->db->plimit($max, 0);
@@ -142,6 +146,15 @@ class box_produits_alerte_stock extends ModeleBoxes
$productstatic->type = $objp->fk_product_type;
$productstatic->label = $objp->label;
$productstatic->entity = $objp->entity;
+ $productstatic->barcode = $objp->barcode;
+ $productstatic->status = $objp->tosell;
+ $productstatic->status_buy = $objp->tobuy;
+ $productstatic->accountancy_code_sell = $objp->accountancy_code_sell;
+ $productstatic->accountancy_code_sell_intra = $objp->accountancy_code_sell_intra;
+ $productstatic->accountancy_code_sell_export = $objp->accountancy_code_sell_export;
+ $productstatic->accountancy_code_buy = $objp->accountancy_code_buy;
+ $productstatic->accountancy_code_buy_intra = $objp->accountancy_code_buy_intra;
+ $productstatic->accountancy_code_buy_export = $objp->accountancy_code_buy_export;
$this->info_box_contents[$line][] = array(
'td' => '',
diff --git a/htdocs/core/boxes/box_shipments.php b/htdocs/core/boxes/box_shipments.php
index 278ad974cf5..8908f52640c 100644
--- a/htdocs/core/boxes/box_shipments.php
+++ b/htdocs/core/boxes/box_shipments.php
@@ -133,7 +133,7 @@ class box_shipments extends ModeleBoxes
$societestatic->logo = $objp->logo;
$this->info_box_contents[$line][] = array(
- 'td' => '',
+ 'td' => 'class="nowraponall"',
'text' => $shipmentstatic->getNomUrl(1),
'asis' => 1,
);
@@ -145,7 +145,7 @@ class box_shipments extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
- 'td' => '',
+ 'td' => 'class="nowraponall"',
'text' => $orderstatic->getNomUrl(1),
'asis' => 1,
);
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index e1014509c0a..ed714681b15 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -5799,6 +5799,7 @@ abstract class CommonObject
$computed = $this->fields[$key]['computed'];
$unique = $this->fields[$key]['unique'];
$required = $this->fields[$key]['required'];
+ $autofocusoncreate = $this->fields[$key]['autofocusoncreate'];
$langfile = $this->fields[$key]['langfile'];
$list = $this->fields[$key]['list'];
@@ -5864,16 +5865,16 @@ abstract class CommonObject
{
$tmp = explode(',', $size);
$newsize = $tmp[0];
- $out = '';
+ $out = '';
} elseif (in_array($type, array('real')))
{
- $out = '';
+ $out = '';
} elseif (preg_match('/varchar/', $type))
{
- $out = '';
+ $out = '';
} elseif (in_array($type, array('mail', 'phone', 'url')))
{
- $out = '';
+ $out = '';
} elseif ($type == 'text')
{
if (!preg_match('/search_/', $keyprefix)) // If keyprefix is search_ or search_options_, we must just use a simple text field
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index 4bcbf3e2e99..7973bc5ff16 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -1,9 +1,7 @@
* Copyright (C) 2003 Xavier Dutoit
- * Copyright (C) 2004-2016 Laurent Destailleur
+ * Copyright (C) 2004-2020 Laurent Destailleur
* Copyright (C) 2005-2017 Regis Houssin
* Copyright (C) 2006 Jean Heimburger
*
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index bfccd8e9b03..0dd990f9452 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -3664,27 +3664,27 @@ class Form
$sql .= ' FROM '.MAIN_DB_PREFIX.'facture';
$sql .= ' WHERE entity IN ('.getEntity('invoice').')';
$sql .= ' AND situation_counter>=1';
+ $sql .= ' AND fk_soc = '.(int) $socid;
+ $sql .= ' AND type <> 2';
$sql .= ' ORDER by situation_cycle_ref, situation_counter desc';
$resql = $this->db->query($sql);
+
if ($resql && $this->db->num_rows($resql) > 0) {
// Last seen cycle
$ref = 0;
while ($obj = $this->db->fetch_object($resql)) {
- //Same company ?
- if ($socid == $obj->fk_soc) {
- //Same cycle ?
- if ($obj->situation_cycle_ref != $ref) {
- // Just seen this cycle
- $ref = $obj->situation_cycle_ref;
- //not final ?
- if ($obj->situation_final != 1) {
- //Not prov?
- if (substr($obj->ref, 1, 4) != 'PROV') {
- if ($selected == $obj->rowid) {
- $opt .= '';
- } else {
- $opt .= '';
- }
+ //Same cycle ?
+ if ($obj->situation_cycle_ref != $ref) {
+ // Just seen this cycle
+ $ref = $obj->situation_cycle_ref;
+ //not final ?
+ if ($obj->situation_final != 1) {
+ //Not prov?
+ if (substr($obj->ref, 1, 4) != 'PROV') {
+ if ($selected == $obj->rowid) {
+ $opt .= '';
+ } else {
+ $opt .= '';
}
}
}
diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php
index da41a02491b..a8654f6bfc5 100644
--- a/htdocs/core/class/html.formticket.class.php
+++ b/htdocs/core/class/html.formticket.class.php
@@ -175,7 +175,7 @@ class FormTicket
print '