Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts: htdocs/core/class/extrafields.class.php htdocs/fourn/class/fournisseur.commande.class.php
This commit is contained in:
commit
3801dd34cd
@ -5298,6 +5298,7 @@ abstract class CommonObject
|
|||||||
$mandatorypb = false;
|
$mandatorypb = false;
|
||||||
if ($attributeType == 'link' && $this->array_options[$key] == '-1') $mandatorypb = true;
|
if ($attributeType == 'link' && $this->array_options[$key] == '-1') $mandatorypb = true;
|
||||||
if ($this->array_options[$key] === '') $mandatorypb = true;
|
if ($this->array_options[$key] === '') $mandatorypb = true;
|
||||||
|
if ($attributeType == 'sellist' && $this->array_options[$key] == '0') $mandatorypb = true;
|
||||||
if ($mandatorypb)
|
if ($mandatorypb)
|
||||||
{
|
{
|
||||||
dol_syslog("Mandatory extra field ".$key." is empty");
|
dol_syslog("Mandatory extra field ".$key." is empty");
|
||||||
|
|||||||
@ -1998,9 +1998,12 @@ class ExtraFields
|
|||||||
|
|
||||||
if ($this->attributes[$object->table_element]['required'][$key]) // Value is required
|
if ($this->attributes[$object->table_element]['required'][$key]) // Value is required
|
||||||
{
|
{
|
||||||
// Check if empty without using GETPOST, value can be alpha, int, array, etc...
|
// Check if functionally empty without using GETPOST (depending on the type of extrafield, a
|
||||||
if ((!is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] != 'select' && $_POST["options_".$key] != '0')
|
// technically non-empty value may be treated as empty functionally).
|
||||||
|| (!is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] == 'select')
|
// value can be alpha, int, array, etc...
|
||||||
|
if ((!is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] != 'select' && $_POST["options_".$key] != '0')
|
||||||
|
|| (!is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] == 'select')
|
||||||
|
|| (!is_array($_POST["options_".$key]) && isset($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] == 'sellist' && $_POST['options_'.$key] == '0')
|
||||||
|| (is_array($_POST["options_".$key]) && empty($_POST["options_".$key])))
|
|| (is_array($_POST["options_".$key]) && empty($_POST["options_".$key])))
|
||||||
{
|
{
|
||||||
//print 'ccc'.$value.'-'.$this->attributes[$object->table_element]['required'][$key];
|
//print 'ccc'.$value.'-'.$this->attributes[$object->table_element]['required'][$key];
|
||||||
|
|||||||
@ -3132,13 +3132,12 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
}
|
}
|
||||||
|
|
||||||
$ret = $supplierorderdispatch->fetchAll('', '', 0, 0, $filter);
|
$ret = $supplierorderdispatch->fetchAll('', '', 0, 0, $filter);
|
||||||
if ($ret < 0)
|
if ($ret < 0) {
|
||||||
{
|
|
||||||
$this->error = $supplierorderdispatch->error; $this->errors = $supplierorderdispatch->errors;
|
$this->error = $supplierorderdispatch->error; $this->errors = $supplierorderdispatch->errors;
|
||||||
return $ret;
|
return $ret;
|
||||||
} else {
|
} else {
|
||||||
if (is_array($supplierorderdispatch->lines) && count($supplierorderdispatch->lines) > 0)
|
if (is_array($supplierorderdispatch->lines) && count($supplierorderdispatch->lines) > 0) {
|
||||||
{
|
require_once DOL_DOCUMENT_ROOT.'/htdocs/product/class/product.class.php';
|
||||||
$date_liv = dol_now();
|
$date_liv = dol_now();
|
||||||
|
|
||||||
// Build array with quantity deliverd by product
|
// Build array with quantity deliverd by product
|
||||||
@ -3146,13 +3145,17 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$qtydelivered[$line->fk_product] += $line->qty;
|
$qtydelivered[$line->fk_product] += $line->qty;
|
||||||
}
|
}
|
||||||
foreach ($this->lines as $line) {
|
foreach ($this->lines as $line) {
|
||||||
|
// Exclude lines not qualified for shipment, similar code is found into interface_20_modWrokflow for customers
|
||||||
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES) && $line->product_type > 0) continue;
|
||||||
$qtywished[$line->fk_product] += $line->qty;
|
$qtywished[$line->fk_product] += $line->qty;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Compare array
|
//Compare array
|
||||||
$diff_array = array_diff_assoc($qtydelivered, $qtywished); // Warning: $diff_array is done only on common keys.
|
$diff_array = array_diff_assoc($qtydelivered, $qtywished); // Warning: $diff_array is done only on common keys.
|
||||||
$keysinwishednotindelivered = array_diff(array_keys($qtywished), array_keys($qtydelivered)); // To check we also have same number of keys
|
$keysinwishednotindelivered = array_diff(array_keys($qtywished), array_keys($qtydelivered)); // To check we also have same number of keys
|
||||||
$keysindeliverednotinwished = array_diff(array_keys($qtydelivered), array_keys($qtywished)); // To check we also have same number of keys
|
$keysindeliverednotinwished = array_diff(array_keys($qtydelivered), array_keys($qtywished)); // To check we also have same number of keys
|
||||||
/*var_dump(array_keys($qtydelivered));
|
/*var_dump(array_keys($qtydelivered));
|
||||||
|
|
||||||
var_dump(array_keys($qtywished));
|
var_dump(array_keys($qtywished));
|
||||||
var_dump($diff_array);
|
var_dump($diff_array);
|
||||||
var_dump($keysinwishednotindelivered);
|
var_dump($keysinwishednotindelivered);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user