Skip to content

Commit 610a952

Browse files
authored
feat(track-and-trace): adds serial number listing to stock entry… (#60)
feat(track-and-trace): adds serial number listing to stock entry node
2 parents ca7a4e3 + 03b7f64 commit 610a952

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

bloomstack_core/bloomstack_core/page/track_and_trace/modules/stock_entry.js

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,29 @@ bloomstack.track_and_trace.modules.add("Stock Entry Detail", {
3030
let entry = data.data;
3131
data.title = `${entry.item_code}: ${entry.item_name}`;
3232

33+
if ( data.data.serial_no ) {
34+
let serials = data.data.serial_no.split(/\\n+|,/);
35+
if ( serials.length === 1 ) {
36+
if ( serials[0] === data.search_dn ) {
37+
data.data.serial_no = data.search_dn;
38+
}
39+
} else {
40+
data.data.serial_no = "MULTIPLE";
41+
}
42+
43+
if ( serials.length > 0 ) {
44+
for(let serial of serials) {
45+
data.children.push({
46+
query: true,
47+
search_dt: data.search_dt,
48+
search_dn: data.search_dn,
49+
dt: "Serial No",
50+
dn: serial
51+
})
52+
}
53+
}
54+
}
55+
3356
if ( data.data.batch_no ) {
3457
// preemptively adds a child node to be queried when this node is
3558
// expanded by the user.
@@ -42,12 +65,6 @@ bloomstack.track_and_trace.modules.add("Stock Entry Detail", {
4265
})
4366
}
4467

45-
if ( data.data.serial_no ) {
46-
// serial_no holds a comma separated list of links.
47-
// one of these should always be the dn of this node root
48-
data.data.serial_no = data.search_dn;
49-
}
50-
5168
// remove source warehouse from fields if not present
5269
if ( entry.s_warehouse ) {
5370
// we'll pepper in additional icon for input for UX

bloomstack_core/public/css/track_and_trace.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11

2+
#track-and-trace .intro {
3+
padding: 1rem 2rem;
4+
}
5+
26
#track-and-trace .results {
37
padding: 5px 18px;
48
}

0 commit comments

Comments
 (0)