Skip to content

Commit

Permalink
Merge pull request #33089 from Easya-Solutions/qual-shipment-replace-…
Browse files Browse the repository at this point in the history
…warehouse

QUAL use fk_warehouse instead of deprecated entrepot_id in line batch
  • Loading branch information
eldy authored Feb 14, 2025
2 parents 7507e7a + 5d6d077 commit c15a37b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
12 changes: 6 additions & 6 deletions htdocs/expedition/class/expedition.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -612,11 +612,11 @@ public function create_line_batch($line_ext, $array_options = [])
$tab = $line_ext->detail_batch;
// create stockLocation Qty array
foreach ($tab as $detbatch) {
if (!empty($detbatch->entrepot_id)) {
if (empty($stockLocationQty[$detbatch->entrepot_id])) {
$stockLocationQty[$detbatch->entrepot_id] = 0;
if (!empty($detbatch->fk_warehouse)) {
if (empty($stockLocationQty[$detbatch->fk_warehouse])) {
$stockLocationQty[$detbatch->fk_warehouse] = 0;
}
$stockLocationQty[$detbatch->entrepot_id] += $detbatch->qty;
$stockLocationQty[$detbatch->fk_warehouse] += $detbatch->qty;
}
}
// create shipment lines
Expand All @@ -627,7 +627,7 @@ public function create_line_batch($line_ext, $array_options = [])
} else {
// create shipment batch lines for stockLocation
foreach ($tab as $detbatch) {
if ($detbatch->entrepot_id == $stockLocation) {
if ($detbatch->fk_warehouse == $stockLocation) {
if (!($detbatch->create($line_id) > 0)) { // Create an ExpeditionLineBatch
$this->errors = $detbatch->errors;
$error++;
Expand Down Expand Up @@ -1110,7 +1110,7 @@ public function addline_batch($dbatch, $array_options = [])
}
}
if (is_object($linebatch)) {
$line->entrepot_id = $linebatch->entrepot_id;
$line->entrepot_id = $linebatch->fk_warehouse;
}
$line->origin_line_id = $dbatch['ix_l']; // deprecated
$line->fk_elementdet = $dbatch['ix_l'];
Expand Down
2 changes: 1 addition & 1 deletion htdocs/expedition/class/expeditionligne.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ public function update($user = null, $notrigger = 0)
$shipmentLot->batch = $lot->batch;
$shipmentLot->eatby = $lot->eatby;
$shipmentLot->sellby = $lot->sellby;
$shipmentLot->entrepot_id = $this->detail_batch->entrepot_id;
$shipmentLot->fk_warehouse = $this->detail_batch->entrepot_id;
$shipmentLot->qty = $this->detail_batch->qty;
$shipmentLot->fk_origin_stock = (int) $batch_id;
if ($shipmentLot->create($this->id) < 0) {
Expand Down
4 changes: 3 additions & 1 deletion htdocs/expedition/class/expeditionlinebatch.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class ExpeditionLineBatch extends CommonObject
public $dluo_qty;
/**
* @var int
* @deprecated, use fk_warehouse
*/
public $entrepot_id;
/**
Expand Down Expand Up @@ -117,7 +118,8 @@ public function fetchFromStock($id_stockdluo)
$this->sellby = $this->db->jdate($obj->sellby);
$this->eatby = $this->db->jdate($obj->eatby);
$this->batch = $obj->batch;
$this->entrepot_id = $obj->fk_entrepot;
$this->entrepot_id = $obj->fk_entrepot; // deprecated use fk_warehouse
$this->fk_warehouse = $obj->fk_entrepot;
$this->fk_origin_stock = (int) $id_stockdluo;
}
$this->db->free($resql);
Expand Down

0 comments on commit c15a37b

Please sign in to comment.