forked from Wavyzz/dolibarr
Fix clone fourn order and invoice lines special code
This commit is contained in:
@@ -1236,6 +1236,9 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
// insert products details into database
|
// insert products details into database
|
||||||
for ($i=0;$i<$num;$i++)
|
for ($i=0;$i<$num;$i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$this->special_code = $this->lines[$i]->special_code; // TODO : remove this in 9.0 and add special_code param to addline()
|
||||||
|
|
||||||
$result = $this->addline( // This include test on qty if option SUPPLIER_ORDER_WITH_NOPRICEDEFINED is not set
|
$result = $this->addline( // This include test on qty if option SUPPLIER_ORDER_WITH_NOPRICEDEFINED is not set
|
||||||
$this->lines[$i]->desc,
|
$this->lines[$i]->desc,
|
||||||
$this->lines[$i]->subprice,
|
$this->lines[$i]->subprice,
|
||||||
|
|||||||
@@ -357,8 +357,8 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
dol_syslog("There is ".count($this->lines)." lines that are invoice lines objects");
|
dol_syslog("There is ".count($this->lines)." lines that are invoice lines objects");
|
||||||
foreach ($this->lines as $i => $val)
|
foreach ($this->lines as $i => $val)
|
||||||
{
|
{
|
||||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn)';
|
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn, special_code)';
|
||||||
$sql .= ' VALUES ('.$this->id.')';
|
$sql .= ' VALUES ('.$this->id.','.intval($this->lines[$i]->special_code).')';
|
||||||
|
|
||||||
$resql_insert=$this->db->query($sql);
|
$resql_insert=$this->db->query($sql);
|
||||||
if ($resql_insert)
|
if ($resql_insert)
|
||||||
@@ -398,8 +398,8 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
//if (! is_object($line)) $line=json_decode(json_encode($line), false); // convert recursively array into object.
|
//if (! is_object($line)) $line=json_decode(json_encode($line), false); // convert recursively array into object.
|
||||||
if (! is_object($line)) $line = (object) $line;
|
if (! is_object($line)) $line = (object) $line;
|
||||||
|
|
||||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn)';
|
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn, special_code)';
|
||||||
$sql .= ' VALUES ('.$this->id.')';
|
$sql .= ' VALUES ('.$this->id.','.intval($this->lines[$i]->special_code).')';
|
||||||
|
|
||||||
$resql_insert=$this->db->query($sql);
|
$resql_insert=$this->db->query($sql);
|
||||||
if ($resql_insert)
|
if ($resql_insert)
|
||||||
|
|||||||
Reference in New Issue
Block a user