fix: SABB print for packed items (#44413)

This commit is contained in:
rohitwaghchaure
2024-11-29 15:49:00 +05:30
committed by GitHub
parent d37d7b9811
commit 5266f236b7
2 changed files with 8 additions and 2 deletions

View File

@@ -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"]

View File

@@ -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>"