Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions erpnext/controllers/accounts_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ def get_print_settings(self):
if taxes_field and taxes_field.fieldtype == "Table":
print_setting_fields += ["print_taxes_with_zero_amount"]

if self.docstatus == 1 and self.doctype in ["Purchase Receipt", "Stock Entry", "Delivery Note"]:
print_setting_fields += ["print_batch_no_barcodes", "print_serial_no_barcodes"]

return print_setting_fields

@property
Expand Down
15 changes: 15 additions & 0 deletions erpnext/controllers/print_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,21 @@ def set_print_templates_for_item_table(doc, settings):
] = "templates/print_formats/includes/item_table_description.html"
doc.flags.format_columns = format_columns

elif (settings.print_batch_no_barcodes and settings.print_serial_no_barcodes):
doc.print_templates = {
"items": "templates/print_formats/includes/serial_and_batch_no_barcodes.html"
}

elif settings.print_batch_no_barcodes:
doc.print_templates = {
"items": "templates/print_formats/includes/batch_no_barcodes.html"
}

elif settings.print_serial_no_barcodes:
doc.print_templates = {
"items": "templates/print_formats/includes/serial_no_barcodes.html"
}


def set_print_templates_for_taxes(doc, settings):
doc.flags.show_inclusive_tax_in_print = doc.is_inclusive_tax()
Expand Down
14 changes: 14 additions & 0 deletions erpnext/setup/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,20 @@ def create_print_setting_custom_fields():
"default": "0",
"insert_after": "allow_print_for_cancelled",
},
{
"label": _("Print Batch no barcodes"),
"fieldname": "print_batch_no_barcodes",
"fieldtype": "Check",
"default": "0",
"insert_after": "print_taxes_with_zero_amount",
},
{
"label": _("Print Serial no barcodes"),
"fieldname": "print_serial_no_barcodes",
"fieldtype": "Check",
"default": "0",
"insert_after": "print_batch_no_barcodes",
}
]
}
)
Expand Down
70 changes: 69 additions & 1 deletion erpnext/stock/doctype/delivery_note/delivery_note.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@
"letter_head",
"print_without_amount",
"group_same_items",
"print_serial_or_batch_number_for_barcode",
"print_item_name_for_barcode",
"print_item_cost_for_barcode",
"print_font_for_barcode",
"print_font_size_for_barcode",
"print_height_for_barcode",
"print_width_for_barcode",
"print_barcode_color",
"column_break_88",
"select_print_heading",
"language",
Expand Down Expand Up @@ -1427,13 +1435,73 @@
"label": "Item Wise Tax Details",
"no_copy": 1,
"options": "Item Wise Tax Detail"
},
{
"allow_on_submit": 1,
"default": "1",
"fieldname": "print_serial_or_batch_number_for_barcode",
"fieldtype": "Check",
"label": "Print serial or batch number for barcode"
},
{
"allow_on_submit": 1,
"default": "0",
"fieldname": "print_item_name_for_barcode",
"fieldtype": "Check",
"label": "Print item name for barcode"
},
{
"allow_on_submit": 1,
"default": "0",
"fieldname": "print_item_cost_for_barcode",
"fieldtype": "Check",
"label": "Print item cost for barcode"
},
{
"allow_on_submit": 1,
"default": "Helvetica",
"fieldname": "print_font_for_barcode",
"fieldtype": "Select",
"label": "Print font for barcode",
"options": "Helvetica\nArial\nVerdana\nsans-serif\nTahoma\nTimes\nConsolas"
},
{
"allow_on_submit": 1,
"default": "12",
"fieldname": "print_font_size_for_barcode",
"fieldtype": "Int",
"label": "Print font size for barcode",
"non_negative": 1
},
{
"allow_on_submit": 1,
"default": "40",
"fieldname": "print_height_for_barcode",
"fieldtype": "Int",
"label": "Print height for barcode",
"non_negative": 1
},
{
"allow_on_submit": 1,
"default": "2",
"fieldname": "print_width_for_barcode",
"fieldtype": "Int",
"label": "Print width for barcode",
"non_negative": 1
},
{
"allow_on_submit": 1,
"default": "#000000",
"fieldname": "print_barcode_color",
"fieldtype": "Color",
"label": "Print color for barcode"
}
],
"icon": "fa fa-truck",
"idx": 146,
"is_submittable": 1,
"links": [],
"modified": "2025-08-04 19:20:47.724218",
"modified": "2025-11-26 18:18:05.926334",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note",
Expand Down
8 changes: 8 additions & 0 deletions erpnext/stock/doctype/delivery_note/delivery_note.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ class DeliveryNote(SellingController):
posting_time: DF.Time
price_list_currency: DF.Link
pricing_rules: DF.Table[PricingRuleDetail]
print_barcode_color: DF.Color | None
print_font_for_barcode: DF.Literal["Helvetica", "Arial", "Verdana", "sans-serif", "Tahoma", "Times", "Consolas"]
print_font_size_for_barcode: DF.Int
print_height_for_barcode: DF.Int
print_item_cost_for_barcode: DF.Check
print_item_name_for_barcode: DF.Check
print_serial_or_batch_number_for_barcode: DF.Check
print_width_for_barcode: DF.Int
print_without_amount: DF.Check
project: DF.Link | None
represents_company: DF.Link | None
Expand Down
72 changes: 70 additions & 2 deletions erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@
"printing_settings",
"letter_head",
"group_same_items",
"print_serial_or_batch_number_for_barcode",
"print_item_name_for_barcode",
"print_item_cost_for_barcode",
"print_font_for_barcode",
"print_font_size_for_barcode",
"print_height_for_barcode",
"print_width_for_barcode",
"print_barcode_color",
"column_break_97",
"select_print_heading",
"language",
Expand Down Expand Up @@ -1302,14 +1310,75 @@
"label": "Item Wise Tax Details",
"no_copy": 1,
"options": "Item Wise Tax Detail"
},
{
"allow_on_submit": 1,
"default": "0",
"fieldname": "print_item_name_for_barcode",
"fieldtype": "Check",
"label": "Print item name for barcode"
},
{
"allow_on_submit": 1,
"default": "0",
"fieldname": "print_item_cost_for_barcode",
"fieldtype": "Check",
"label": "Print item cost for barcode"
},
{
"allow_on_submit": 1,
"default": "2",
"fieldname": "print_width_for_barcode",
"fieldtype": "Int",
"label": "Print width for barcode",
"non_negative": 1
},
{
"allow_on_submit": 1,
"default": "40",
"fieldname": "print_height_for_barcode",
"fieldtype": "Int",
"label": "Print height for barcode",
"non_negative": 1
},
{
"allow_on_submit": 1,
"default": "Helvetica",
"fieldname": "print_font_for_barcode",
"fieldtype": "Select",
"label": "Print font for barcode",
"options": "Helvetica\nArial\nVerdana\nsans-serif\nTahoma\nTimes\nConsolas"
},
{
"allow_on_submit": 1,
"default": "1",
"fieldname": "print_serial_or_batch_number_for_barcode",
"fieldtype": "Check",
"label": "Print serial or batch number for barcode"
},
{
"allow_on_submit": 1,
"default": "#000000",
"fieldname": "print_barcode_color",
"fieldtype": "Color",
"label": "Print color for barcode"
},
{
"allow_on_submit": 1,
"default": "12",
"fieldname": "print_font_size_for_barcode",
"fieldtype": "Int",
"label": "Print font size for barcode",
"non_negative": 1,
"options": "Helvetica"
}
],
"grid_page_length": 50,
"icon": "fa fa-truck",
"idx": 261,
"is_submittable": 1,
"links": [],
"modified": "2025-11-12 19:53:48.173096",
"modified": "2025-11-26 18:17:30.100779",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt",
Expand Down Expand Up @@ -1380,4 +1449,3 @@
"title_field": "title",
"track_changes": 1
}

8 changes: 8 additions & 0 deletions erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ class PurchaseReceipt(BuyingController):
posting_time: DF.Time
price_list_currency: DF.Link | None
pricing_rules: DF.Table[PricingRuleDetail]
print_barcode_color: DF.Color | None
print_font_for_barcode: DF.Literal["Helvetica", "Arial", "Verdana", "sans-serif", "Tahoma", "Times", "Consolas"]
print_font_size_for_barcode: DF.Int
print_height_for_barcode: DF.Int
print_item_cost_for_barcode: DF.Check
print_item_name_for_barcode: DF.Check
print_serial_or_batch_number_for_barcode: DF.Check
print_width_for_barcode: DF.Int
project: DF.Link | None
range: DF.Data | None
rejected_warehouse: DF.Link | None
Expand Down
70 changes: 69 additions & 1 deletion erpnext/stock/doctype/stock_entry/stock_entry.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@
"other_info_tab",
"printing_settings",
"select_print_heading",
"print_serial_or_batch_number_for_barcode",
"print_item_name_for_barcode",
"print_item_cost_for_barcode",
"print_font_for_barcode",
"print_font_size_for_barcode",
"print_height_for_barcode",
"print_width_for_barcode",
"print_barcode_color",
"print_settings_col_break",
"letter_head",
"more_info",
Expand Down Expand Up @@ -717,6 +725,66 @@
"label": "Subcontracting Inward Order",
"options": "Subcontracting Inward Order",
"read_only": 1
},
{
"allow_on_submit": 1,
"default": "1",
"fieldname": "print_serial_or_batch_number_for_barcode",
"fieldtype": "Check",
"label": "Print serial or batch number for barcode"
},
{
"allow_on_submit": 1,
"default": "0",
"fieldname": "print_item_name_for_barcode",
"fieldtype": "Check",
"label": "Print item name for barcode"
},
{
"default": "0",
"fieldname": "print_item_cost_for_barcode",
"fieldtype": "Check",
"label": "Print item cost for barcode",
"read_only": 1
},
{
"allow_on_submit": 1,
"default": "Helvetica",
"fieldname": "print_font_for_barcode",
"fieldtype": "Select",
"label": "Print font for barcode",
"options": "Helvetica\nArial\nVerdana\nsans-serif\nTahoma\nTimes\nConsolas"
},
{
"allow_on_submit": 1,
"default": "12",
"fieldname": "print_font_size_for_barcode",
"fieldtype": "Int",
"label": "Print font size for barcode",
"non_negative": 1
},
{
"allow_on_submit": 1,
"default": "40",
"fieldname": "print_height_for_barcode",
"fieldtype": "Int",
"label": "Print height for barcode",
"non_negative": 1
},
{
"allow_on_submit": 1,
"default": "2",
"fieldname": "print_width_for_barcode",
"fieldtype": "Int",
"label": "Print width for barcode",
"non_negative": 1
},
{
"allow_on_submit": 1,
"default": "#000000",
"fieldname": "print_barcode_color",
"fieldtype": "Color",
"label": "Print color for barcode"
}
],
"grid_page_length": 50,
Expand All @@ -725,7 +793,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2025-10-13 15:09:23.905118",
"modified": "2025-11-26 18:18:35.153837",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Entry",
Expand Down
8 changes: 8 additions & 0 deletions erpnext/stock/doctype/stock_entry/stock_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ class StockEntry(StockController, SubcontractingInwardController):
pick_list: DF.Link | None
posting_date: DF.Date | None
posting_time: DF.Time | None
print_barcode_color: DF.Color | None
print_font_for_barcode: DF.Literal["Helvetica", "Arial", "Verdana", "sans-serif", "Tahoma", "Times", "Consolas"]
print_font_size_for_barcode: DF.Int
print_height_for_barcode: DF.Int
print_item_cost_for_barcode: DF.Check
print_item_name_for_barcode: DF.Check
print_serial_or_batch_number_for_barcode: DF.Check
print_width_for_barcode: DF.Int
process_loss_percentage: DF.Percent
process_loss_qty: DF.Float
project: DF.Link | None
Expand Down
Loading