FIX product_type 9
This commit is contained in:
parent
7884216197
commit
7017b37354
@ -992,7 +992,7 @@ class FactureRec extends CommonInvoice
|
|||||||
if ($this->db->query($sql)) {
|
if ($this->db->query($sql)) {
|
||||||
$lineId = $this->db->last_insert_id(MAIN_DB_PREFIX."facturedet_rec");
|
$lineId = $this->db->last_insert_id(MAIN_DB_PREFIX."facturedet_rec");
|
||||||
$this->id = $facid;
|
$this->id = $facid;
|
||||||
$this->update_price();
|
$this->update_price(1);
|
||||||
return $lineId;
|
return $lineId;
|
||||||
} else {
|
} else {
|
||||||
$this->error = $this->db->lasterror();
|
$this->error = $this->db->lasterror();
|
||||||
@ -1166,7 +1166,7 @@ class FactureRec extends CommonInvoice
|
|||||||
dol_syslog(get_class($this)."::updateline", LOG_DEBUG);
|
dol_syslog(get_class($this)."::updateline", LOG_DEBUG);
|
||||||
if ($this->db->query($sql)) {
|
if ($this->db->query($sql)) {
|
||||||
$this->id = $facid;
|
$this->id = $facid;
|
||||||
$this->update_price();
|
$this->update_price(1);
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
$this->error = $this->db->lasterror();
|
$this->error = $this->db->lasterror();
|
||||||
|
|||||||
@ -634,7 +634,7 @@ class Delivery extends CommonObject
|
|||||||
$sql .= " WHERE rowid = ".((int) $lineid);
|
$sql .= " WHERE rowid = ".((int) $lineid);
|
||||||
|
|
||||||
if ($this->db->query($sql)) {
|
if ($this->db->query($sql)) {
|
||||||
$this->update_price();
|
$this->update_price(1);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -359,7 +359,7 @@ class ExpenseReport extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$result = $this->update_price();
|
$result = $this->update_price(1);
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
if (!$notrigger) {
|
if (!$notrigger) {
|
||||||
// Call trigger
|
// Call trigger
|
||||||
@ -1841,7 +1841,7 @@ class ExpenseReport extends CommonObject
|
|||||||
|
|
||||||
$result = $this->line->insert(0, true);
|
$result = $this->line->insert(0, true);
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
$result = $this->update_price(); // This method is designed to add line from user input so total calculation must be done using 'auto' mode.
|
$result = $this->update_price(1); // This method is designed to add line from user input so total calculation must be done using 'auto' mode.
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return $this->line->id;
|
return $this->line->id;
|
||||||
@ -2180,7 +2180,7 @@ class ExpenseReport extends CommonObject
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->update_price();
|
$this->update_price(1);
|
||||||
|
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
|
|
||||||
@ -2747,7 +2747,7 @@ class ExpenseReportLine
|
|||||||
if (!$fromaddline) {
|
if (!$fromaddline) {
|
||||||
$tmpparent = new ExpenseReport($this->db);
|
$tmpparent = new ExpenseReport($this->db);
|
||||||
$tmpparent->fetch($this->fk_expensereport);
|
$tmpparent->fetch($this->fk_expensereport);
|
||||||
$result = $tmpparent->update_price();
|
$result = $tmpparent->update_price(1);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
$this->error = $tmpparent->error;
|
$this->error = $tmpparent->error;
|
||||||
@ -2874,7 +2874,7 @@ class ExpenseReportLine
|
|||||||
$tmpparent = new ExpenseReport($this->db);
|
$tmpparent = new ExpenseReport($this->db);
|
||||||
$result = $tmpparent->fetch($this->fk_expensereport);
|
$result = $tmpparent->fetch($this->fk_expensereport);
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
$result = $tmpparent->update_price();
|
$result = $tmpparent->update_price(1);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
$this->error = $tmpparent->error;
|
$this->error = $tmpparent->error;
|
||||||
|
|||||||
@ -2067,7 +2067,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($line->delete($notrigger) > 0) {
|
if ($line->delete($notrigger) > 0) {
|
||||||
$this->update_price();
|
$this->update_price(1);
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
$this->error = $line->error;
|
$this->error = $line->error;
|
||||||
@ -2564,7 +2564,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$sql .= ", ".$comclient->lines[$i]->qty.", ".$comclient->lines[$i]->tva_tx.", ".$comclient->lines[$i]->localtax1_tx.", ".$comclient->lines[$i]->localtax2_tx.", ".$comclient->lines[$i]->remise_percent;
|
$sql .= ", ".$comclient->lines[$i]->qty.", ".$comclient->lines[$i]->tva_tx.", ".$comclient->lines[$i]->localtax1_tx.", ".$comclient->lines[$i]->localtax2_tx.", ".$comclient->lines[$i]->remise_percent;
|
||||||
$sql .= ", '".price2num($comclient->lines[$i]->subprice)."','0', '".$this->db->escape($ref)."');";
|
$sql .= ", '".price2num($comclient->lines[$i]->subprice)."','0', '".$this->db->escape($ref)."');";
|
||||||
if ($this->db->query($sql)) {
|
if ($this->db->query($sql)) {
|
||||||
$this->update_price();
|
$this->update_price(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2817,7 +2817,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
|
|
||||||
// Mise a jour info denormalisees au niveau facture
|
// Mise a jour info denormalisees au niveau facture
|
||||||
if ($result >= 0) {
|
if ($result >= 0) {
|
||||||
$this->update_price('', 'auto');
|
$this->update_price('1', 'auto');
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return $result;
|
return $result;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -590,7 +590,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update total price
|
// Update total price
|
||||||
$result = $this->update_price();
|
$result = $this->update_price(1);
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
// Actions on extra fields
|
// Actions on extra fields
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
@ -2192,7 +2192,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$this->errors[] = $line->error;
|
$this->errors[] = $line->error;
|
||||||
} else {
|
} else {
|
||||||
// Update total price into invoice record
|
// Update total price into invoice record
|
||||||
$res = $this->update_price('', 'auto', 0, $this->thirdparty);
|
$res = $this->update_price('1', 'auto', 0, $this->thirdparty);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
@ -2239,7 +2239,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -3;
|
return -3;
|
||||||
} else {
|
} else {
|
||||||
$res = $this->update_price();
|
$res = $this->update_price(1);
|
||||||
|
|
||||||
if ($res > 0) {
|
if ($res > 0) {
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user