Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts: htdocs/expedition/class/expedition.class.php htdocs/fourn/class/fournisseur.commande.class.php htdocs/fourn/class/fournisseur.facture.class.php
This commit is contained in:
commit
e7a4f04da4
@ -9,7 +9,7 @@
|
|||||||
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2014-2017 Francis Appels <francis.appels@yahoo.com>
|
* Copyright (C) 2014-2017 Francis Appels <francis.appels@yahoo.com>
|
||||||
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||||
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2016-2021 Ferran Marcet <fmarcet@2byte.es>
|
||||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||||
* Copyright (C) 2020 Lenin Rivas <lenin@leninrivas.com>
|
* Copyright (C) 2020 Lenin Rivas <lenin@leninrivas.com>
|
||||||
@ -366,50 +366,40 @@ class Expedition extends CommonObject
|
|||||||
{
|
{
|
||||||
// Insert of lines
|
// Insert of lines
|
||||||
$num = count($this->lines);
|
$num = count($this->lines);
|
||||||
for ($i = 0; $i < $num; $i++)
|
for ($i = 0; $i < $num; $i++) {
|
||||||
{
|
if (!isset($this->lines[$i]->detail_batch)) { // no batch management
|
||||||
if (!isset($this->lines[$i]->detail_batch))
|
if ($this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty, $this->lines[$i]->rang, $this->lines[$i]->array_options) <= 0) {
|
||||||
{ // no batch management
|
|
||||||
if (!$this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty, $this->lines[$i]->rang, $this->lines[$i]->array_options) > 0)
|
|
||||||
{
|
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else { // with batch management
|
} else { // with batch management
|
||||||
if (!$this->create_line_batch($this->lines[$i], $this->lines[$i]->array_options) > 0)
|
if ($this->create_line_batch($this->lines[$i], $this->lines[$i]->array_options) <= 0) {
|
||||||
{
|
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error && $this->id && $this->origin_id)
|
if (!$error && $this->id && $this->origin_id) {
|
||||||
{
|
|
||||||
$ret = $this->add_object_linked();
|
$ret = $this->add_object_linked();
|
||||||
if (!$ret)
|
if (!$ret) {
|
||||||
{
|
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (!$error)
|
if (!$error) {
|
||||||
{
|
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0) {
|
||||||
{
|
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error && !$notrigger)
|
if (!$error && !$notrigger) {
|
||||||
{
|
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result = $this->call_trigger('SHIPPING_CREATE', $user);
|
$result = $this->call_trigger('SHIPPING_CREATE', $user);
|
||||||
if ($result < 0) { $error++; }
|
if ($result < 0) { $error++; }
|
||||||
// End call triggers
|
// End call triggers
|
||||||
|
|
||||||
if (!$error)
|
if (!$error) {
|
||||||
{
|
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return $this->id;
|
return $this->id;
|
||||||
} else {
|
} else {
|
||||||
@ -423,7 +413,6 @@ class Expedition extends CommonObject
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$error++;
|
$error++;
|
||||||
$this->error = $this->db->lasterror()." - sql=$sql";
|
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2018-2021 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -2822,11 +2822,11 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
if ($obj->fk_user_approve) $this->user_approve_id = $obj->fk_user_approve;
|
if ($obj->fk_user_approve) $this->user_approve_id = $obj->fk_user_approve;
|
||||||
if ($obj->fk_user_approve2) $this->user_approve_id2 = $obj->fk_user_approve2;
|
if ($obj->fk_user_approve2) $this->user_approve_id2 = $obj->fk_user_approve2;
|
||||||
|
|
||||||
$this->date_creation = $this->db->idate($obj->datec);
|
$this->date_creation = $this->db->jdate($obj->datec);
|
||||||
$this->date_modification = $this->db->idate($obj->datem);
|
$this->date_modification = $this->db->jdate($obj->datem);
|
||||||
$this->date_approve = $this->db->idate($obj->datea);
|
$this->date_approve = $this->db->jdate($obj->datea);
|
||||||
$this->date_approve2 = $this->db->idate($obj->datea2);
|
$this->date_approve2 = $this->db->jdate($obj->datea2);
|
||||||
$this->date_validation = $this->db->idate($obj->date_validation);
|
$this->date_validation = $this->db->jdate($obj->date_validation);
|
||||||
}
|
}
|
||||||
$this->db->free($result);
|
$this->db->free($result);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014-2016 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2014-2016 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
|
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
|
||||||
* Copyright (C) 2015-2019 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2015-2021 Ferran Marcet <fmarcet@2byte.es>
|
||||||
* Copyright (C) 2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||||
@ -2078,6 +2078,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
if ($this->db->num_rows($result))
|
if ($this->db->num_rows($result))
|
||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
|
|
||||||
$this->id = $obj->rowid;
|
$this->id = $obj->rowid;
|
||||||
if ($obj->fk_user_author)
|
if ($obj->fk_user_author)
|
||||||
{
|
{
|
||||||
@ -2097,8 +2098,8 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$muser->fetch($obj->fk_user_modif);
|
$muser->fetch($obj->fk_user_modif);
|
||||||
$this->user_modification = $muser;
|
$this->user_modification = $muser;
|
||||||
}
|
}
|
||||||
$this->date_creation = $this->db->idate($obj->datec);
|
$this->date_creation = $this->db->jdate($obj->datec);
|
||||||
$this->date_modification = $this->db->idate($obj->datem);
|
$this->date_modification = $this->db->jdate($obj->datem);
|
||||||
//$this->date_validation = $obj->datev; // This field is not available. Should be store into log table and using this function should be replaced with showing content of log (like for supplier orders)
|
//$this->date_validation = $obj->datev; // This field is not available. Should be store into log table and using this function should be replaced with showing content of log (like for supplier orders)
|
||||||
}
|
}
|
||||||
$this->db->free($result);
|
$this->db->free($result);
|
||||||
|
|||||||
@ -295,6 +295,7 @@ if (empty($reshook))
|
|||||||
$search_town = "";
|
$search_town = "";
|
||||||
$search_zip = "";
|
$search_zip = "";
|
||||||
$search_state = "";
|
$search_state = "";
|
||||||
|
$search_region = "";
|
||||||
$search_country = '';
|
$search_country = '';
|
||||||
$search_email = '';
|
$search_email = '';
|
||||||
$search_phone = '';
|
$search_phone = '';
|
||||||
@ -566,6 +567,7 @@ if ($search_fax != '') $param .= "&search_fax=".urlencode($search_fax);
|
|||||||
if ($search_email != '') $param .= "&search_email=".urlencode($search_email);
|
if ($search_email != '') $param .= "&search_email=".urlencode($search_email);
|
||||||
if ($search_url != '') $param .= "&search_url=".urlencode($search_url);
|
if ($search_url != '') $param .= "&search_url=".urlencode($search_url);
|
||||||
if ($search_state != '') $param .= "&search_state=".urlencode($search_state);
|
if ($search_state != '') $param .= "&search_state=".urlencode($search_state);
|
||||||
|
if ($search_region != '') $param .= "&search_region=".urlencode($search_region);
|
||||||
if ($search_country != '') $param .= "&search_country=".urlencode($search_country);
|
if ($search_country != '') $param .= "&search_country=".urlencode($search_country);
|
||||||
if ($search_customer_code != '') $param .= "&search_customer_code=".urlencode($search_customer_code);
|
if ($search_customer_code != '') $param .= "&search_customer_code=".urlencode($search_customer_code);
|
||||||
if ($search_supplier_code != '') $param .= "&search_supplier_code=".urlencode($search_supplier_code);
|
if ($search_supplier_code != '') $param .= "&search_supplier_code=".urlencode($search_supplier_code);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user