Fix set origin.
This commit is contained in:
parent
791a7206ee
commit
eb73da5abc
@ -382,7 +382,9 @@ class Mos extends DolibarrApi
|
|||||||
if (!$error && $value["fk_warehouse"] > 0) {
|
if (!$error && $value["fk_warehouse"] > 0) {
|
||||||
// Record stock movement
|
// Record stock movement
|
||||||
$id_product_batch = 0;
|
$id_product_batch = 0;
|
||||||
$stockmove->origin = $this->mo;
|
|
||||||
|
$stockmove->setOrigin($this->mo->element, $this->mo->id);
|
||||||
|
|
||||||
if ($qtytoprocess >= 0) {
|
if ($qtytoprocess >= 0) {
|
||||||
$moline = new MoLine($this->db);
|
$moline = new MoLine($this->db);
|
||||||
$moline->fk_mo = $this->mo->id;
|
$moline->fk_mo = $this->mo->id;
|
||||||
|
|||||||
@ -211,7 +211,8 @@ if (empty($reshook)) {
|
|||||||
if (!$error && GETPOST('idwarehouse-'.$line->id.'-'.$i) > 0) {
|
if (!$error && GETPOST('idwarehouse-'.$line->id.'-'.$i) > 0) {
|
||||||
// Record stock movement
|
// Record stock movement
|
||||||
$id_product_batch = 0;
|
$id_product_batch = 0;
|
||||||
$stockmove->origin = $object;
|
$stockmove->setOrigin($object->element, $object->id);
|
||||||
|
|
||||||
if ($qtytoprocess >= 0) {
|
if ($qtytoprocess >= 0) {
|
||||||
$idstockmove = $stockmove->livraison($user, $line->fk_product, GETPOST('idwarehouse-'.$line->id.'-'.$i), $qtytoprocess, 0, $labelmovement, dol_now(), '', '', GETPOST('batch-'.$line->id.'-'.$i), $id_product_batch, $codemovement);
|
$idstockmove = $stockmove->livraison($user, $line->fk_product, GETPOST('idwarehouse-'.$line->id.'-'.$i), $qtytoprocess, 0, $labelmovement, dol_now(), '', '', GETPOST('batch-'.$line->id.'-'.$i), $id_product_batch, $codemovement);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -109,7 +109,7 @@ if ($action == 'cancel_record' && $permissiontoadd) {
|
|||||||
|
|
||||||
if ($action == 'update' && !empty($user->rights->stock->mouvement->creer)) {
|
if ($action == 'update' && !empty($user->rights->stock->mouvement->creer)) {
|
||||||
$stockmovment = new MouvementStock($db);
|
$stockmovment = new MouvementStock($db);
|
||||||
$stockmovment->origin = $object;
|
$stockmovment->setOrigin($object->element, $object->id);
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
@ -117,6 +117,7 @@ if ($action == 'update' && !empty($user->rights->stock->mouvement->creer)) {
|
|||||||
$sql .= ' id.fk_product, id.batch, id.qty_stock, id.qty_view, id.qty_regulated';
|
$sql .= ' id.fk_product, id.batch, id.qty_stock, id.qty_view, id.qty_regulated';
|
||||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'inventorydet as id';
|
$sql .= ' FROM '.MAIN_DB_PREFIX.'inventorydet as id';
|
||||||
$sql .= ' WHERE id.fk_inventory = '.((int) $object->id);
|
$sql .= ' WHERE id.fk_inventory = '.((int) $object->id);
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user