Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
0cdfd6800a
@ -5058,7 +5058,8 @@ abstract class CommonObject
|
|||||||
$type = 'varchar'; // convert varchar(xx) int varchar
|
$type = 'varchar'; // convert varchar(xx) int varchar
|
||||||
$size = $reg[1];
|
$size = $reg[1];
|
||||||
}
|
}
|
||||||
elseif (preg_match('/varchar/', $type)) $type = 'varchar'; // convert varchar(xx) int varchar
|
elseif (preg_match('/varchar/', $type)) $type = 'varchar'; // convert varchar(xx) into varchar
|
||||||
|
elseif (preg_match('/double/', $type)) $type = 'double'; // convert double(xx) into double
|
||||||
if (is_array($val['arrayofkeyval'])) $type='select';
|
if (is_array($val['arrayofkeyval'])) $type='select';
|
||||||
if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) $type='link';
|
if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) $type='link';
|
||||||
|
|
||||||
@ -5132,7 +5133,6 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//var_dump($showsize.' '.$size);
|
//var_dump($showsize.' '.$size);
|
||||||
|
|
||||||
if (in_array($type,array('date','datetime')))
|
if (in_array($type,array('date','datetime')))
|
||||||
{
|
{
|
||||||
$tmp=explode(',',$size);
|
$tmp=explode(',',$size);
|
||||||
|
|||||||
@ -1552,7 +1552,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
|||||||
$out.=getTitleFieldOfList($langs->trans("Label"), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
|
$out.=getTitleFieldOfList($langs->trans("Label"), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
|
||||||
$out.=getTitleFieldOfList($langs->trans("Date"), 0, $_SERVER["PHP_SELF"], 'a.datep,a.id', '', $param, 'align="center"', $sortfield, $sortorder);
|
$out.=getTitleFieldOfList($langs->trans("Date"), 0, $_SERVER["PHP_SELF"], 'a.datep,a.id', '', $param, 'align="center"', $sortfield, $sortorder);
|
||||||
$out.=getTitleFieldOfList('');
|
$out.=getTitleFieldOfList('');
|
||||||
$out.=getTitleFieldOfList('');
|
$out.=getTitleFieldOfList($langs->trans("ActionOnContact"), 0, $_SERVER["PHP_SELF"], 'a.fk_contact', '', $param, '', $sortfield, $sortorder);
|
||||||
$out.=getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], 'a.percent', '', $param, 'align="center"', $sortfield, $sortorder);
|
$out.=getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], 'a.percent', '', $param, 'align="center"', $sortfield, $sortorder);
|
||||||
$out.=getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'maxwidthsearch ');
|
$out.=getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||||
$out.='</tr>';
|
$out.='</tr>';
|
||||||
@ -1700,7 +1700,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
|||||||
$out.='</td>';
|
$out.='</td>';
|
||||||
|
|
||||||
// Contact pour cette action
|
// Contact pour cette action
|
||||||
if (! empty($objcon->id) && isset($histo[$key]['contact_id']) && $histo[$key]['contact_id'] > 0)
|
if (empty($objcon->id) && isset($histo[$key]['contact_id']) && $histo[$key]['contact_id'] > 0)
|
||||||
{
|
{
|
||||||
$contactstatic->lastname=$histo[$key]['lastname'];
|
$contactstatic->lastname=$histo[$key]['lastname'];
|
||||||
$contactstatic->firstname=$histo[$key]['firstname'];
|
$contactstatic->firstname=$histo[$key]['firstname'];
|
||||||
|
|||||||
@ -1062,8 +1062,6 @@ if (empty($reshook))
|
|||||||
$fk_parent_line = 0;
|
$fk_parent_line = 0;
|
||||||
$num = count($lines);
|
$num = count($lines);
|
||||||
|
|
||||||
$productsupplier = new ProductFournisseur($db);
|
|
||||||
|
|
||||||
for($i = 0; $i < $num; $i ++)
|
for($i = 0; $i < $num; $i ++)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -1071,7 +1069,7 @@ if (empty($reshook))
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
$label = (! empty($lines[$i]->label) ? $lines[$i]->label : '');
|
$label = (! empty($lines[$i]->label) ? $lines[$i]->label : '');
|
||||||
$desc = (! empty($lines[$i]->desc) ? $lines[$i]->desc : $lines[$i]->libelle);
|
$desc = (! empty($lines[$i]->desc) ? $lines[$i]->desc : $lines[$i]->product_desc);
|
||||||
$product_type = (! empty($lines[$i]->product_type) ? $lines[$i]->product_type : 0);
|
$product_type = (! empty($lines[$i]->product_type) ? $lines[$i]->product_type : 0);
|
||||||
|
|
||||||
// Reset fk_parent_line for no child products and special product
|
// Reset fk_parent_line for no child products and special product
|
||||||
@ -1087,43 +1085,57 @@ if (empty($reshook))
|
|||||||
$array_option = $lines[$i]->array_options;
|
$array_option = $lines[$i]->array_options;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $productsupplier->find_min_price_product_fournisseur($lines[$i]->fk_product, $lines[$i]->qty, $srcobject->socid);
|
$ref_supplier = '';
|
||||||
if ($result>=0)
|
$product_fourn_price_id = 0;
|
||||||
|
if ($origin == "commande")
|
||||||
{
|
{
|
||||||
$tva_tx = $lines[$i]->tva_tx;
|
$productsupplier = new ProductFournisseur($db);
|
||||||
|
$result = $productsupplier->find_min_price_product_fournisseur($lines[$i]->fk_product, $lines[$i]->qty, $srcobject->socid);
|
||||||
if ($origin=="commande")
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$soc=new societe($db);
|
$ref_supplier = $productsupplier->ref_supplier;
|
||||||
$soc->fetch($socid);
|
$product_fourn_price_id = $productsupplier->product_fourn_price_id
|
||||||
$tva_tx=get_default_tva($soc, $mysoc, $lines[$i]->fk_product, $productsupplier->product_fourn_price_id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $object->addline(
|
|
||||||
$desc,
|
|
||||||
$lines[$i]->subprice,
|
|
||||||
$lines[$i]->qty,
|
|
||||||
$tva_tx,
|
|
||||||
$lines[$i]->localtax1_tx,
|
|
||||||
$lines[$i]->localtax2_tx,
|
|
||||||
$lines[$i]->fk_product > 0 ? $lines[$i]->fk_product : 0,
|
|
||||||
$productsupplier->product_fourn_price_id,
|
|
||||||
$productsupplier->ref_supplier,
|
|
||||||
$lines[$i]->remise_percent,
|
|
||||||
'HT',
|
|
||||||
0,
|
|
||||||
$lines[$i]->product_type,
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
array(),
|
|
||||||
$lines[$i]->fk_unit,
|
|
||||||
0,
|
|
||||||
$element,
|
|
||||||
!empty($lines[$i]->id) ? $lines[$i]->id : $lines[$i]->rowid
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$ref_supplier = $lines[$i]->ref_fourn;
|
||||||
|
$product_fourn_price_id = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$tva_tx = $lines[$i]->tva_tx;
|
||||||
|
|
||||||
|
if ($origin=="commande")
|
||||||
|
{
|
||||||
|
$soc=new societe($db);
|
||||||
|
$soc->fetch($socid);
|
||||||
|
$tva_tx=get_default_tva($soc, $mysoc, $lines[$i]->fk_product, $product_fourn_price_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $object->addline(
|
||||||
|
$desc,
|
||||||
|
$lines[$i]->subprice,
|
||||||
|
$lines[$i]->qty,
|
||||||
|
$tva_tx,
|
||||||
|
$lines[$i]->localtax1_tx,
|
||||||
|
$lines[$i]->localtax2_tx,
|
||||||
|
$lines[$i]->fk_product > 0 ? $lines[$i]->fk_product : 0,
|
||||||
|
$product_fourn_price_id,
|
||||||
|
$ref_supplier,
|
||||||
|
$lines[$i]->remise_percent,
|
||||||
|
'HT',
|
||||||
|
0,
|
||||||
|
$lines[$i]->product_type,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
array(),
|
||||||
|
$lines[$i]->fk_unit,
|
||||||
|
0,
|
||||||
|
$element,
|
||||||
|
!empty($lines[$i]->id) ? $lines[$i]->id : $lines[$i]->rowid
|
||||||
|
);
|
||||||
|
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
|
|||||||
@ -340,7 +340,7 @@ class Products extends DolibarrApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
throw new RestException(503, 'Error when retrieve category list : '.$categories->error);
|
throw new RestException(503, 'Error when retrieve category list : '.array_merge(array($categories->error), $categories->errors));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
@ -374,7 +374,7 @@ class Products extends DolibarrApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
throw new RestException(503, 'Error when retrieve prices list : '.$categories->error);
|
throw new RestException(503, 'Error when retrieve prices list : '.array_merge(array($this->product->error), $this->product->errors));
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
@ -416,7 +416,7 @@ class Products extends DolibarrApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
throw new RestException(503, 'Error when retrieve prices list : '.$categories->error);
|
throw new RestException(503, 'Error when retrieve prices list : '.array_merge(array($this->product->error), $this->product->errors));
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new RestException(501, 'Feature not yet available');
|
throw new RestException(501, 'Feature not yet available');
|
||||||
@ -451,7 +451,7 @@ class Products extends DolibarrApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
throw new RestException(503, 'Error when retrieve prices list : '.$categories->error);
|
throw new RestException(503, 'Error when retrieve prices list : '.array_merge(array($this->product->error), $this->product->errors));
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user