Skip to content

Commit

Permalink
fix: SABB print for packed items (backport #44413) (#44428)
Browse files Browse the repository at this point in the history
fix: SABB print for packed items (#44413)

(cherry picked from commit 5266f23)

Co-authored-by: rohitwaghchaure <[email protected]>
  • Loading branch information
mergify[bot] and rohitwaghchaure authored Nov 29, 2024
1 parent e607795 commit 0e39aa3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion erpnext/controllers/print_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ def set_print_templates_for_item_table(doc, settings):
"items": {
"qty": "templates/print_formats/includes/item_table_qty.html",
"serial_and_batch_bundle": "templates/print_formats/includes/serial_and_batch_bundle.html",
}
},
"packed_items": {
"serial_and_batch_bundle": "templates/print_formats/includes/serial_and_batch_bundle.html",
},
"supplied_items": {
"serial_and_batch_bundle": "templates/print_formats/includes/serial_and_batch_bundle.html",
},
}

doc.flags.compact_item_fields = ["description", "qty", "rate", "amount"]
Expand Down
2 changes: 1 addition & 1 deletion erpnext/stock/serial_batch_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ def get_serial_or_batch_nos(bundle):
html = "<table class= 'table table-borderless' style='margin-top: 0px;margin-bottom: 0px;'>"
for d in data:
if d.serial_no:
html += f"<tr><td>{d.batch_no}</th><th>{d.serial_no}</th ><th>{abs(d.qty)}</th></tr>"
html += f"<tr><td>{d.batch_no}</td><td>{d.serial_no}</td><td>{abs(d.qty)}</td></tr>"
else:
html += f"<tr><td>{d.batch_no}</td><td>{abs(d.qty)}</td></tr>"

Expand Down

0 comments on commit 0e39aa3

Please sign in to comment.