Skip to content

Commit

Permalink
Fix lost asset serial numbers in stock entry for shipments
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcameron committed Jul 4, 2022
1 parent 1b043e3 commit d9b6f80
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions client/src/modules/stock/entry/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ function StockEntryController(
isValid : true,
lot : items[index].label,
quantity : item.quantity,
serial_number : items[index].serial_number,
expiration_date : new Date(items[index].expiration_date),
uuid : items[index].uuid,
});
Expand Down Expand Up @@ -776,6 +777,7 @@ function StockEntryController(

const inventory = inventoryStore.get(line.inventory_uuid);
const entryDate = vm.movement.date || Date();

line.code = inventory.code;
line.label = inventory.label;
line.unit_cost = inventory.price;
Expand Down
6 changes: 3 additions & 3 deletions server/controllers/stock/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,10 @@ async function getLotsMovements(depotUuid, params) {

const sql = `
SELECT
BUID(l.uuid) AS uuid, l.label, m.quantity, m.reference, m.description,
BUID(l.uuid) AS uuid, l.label, l.serial_number, l.unit_cost, l.expiration_date,
m.quantity, m.reference, m.description,
d.text AS depot_text, d.min_months_security_stock,
IF(is_exit = 1, "OUT", "IN") AS io, l.unit_cost,
l.expiration_date, BUID(l.inventory_uuid) AS inventory_uuid,
IF(is_exit = 1, "OUT", "IN") AS io, BUID(l.inventory_uuid) AS inventory_uuid,
(SELECT MIN(sm.date) FROM stock_movement sm WHERE sm.lot_uuid = l.uuid) AS entry_date,
i.code, i.text,
BUID(m.depot_uuid) AS depot_uuid, m.is_exit, m.date, BUID(m.document_uuid) AS document_uuid,
Expand Down

0 comments on commit d9b6f80

Please sign in to comment.