Skip to content

Commit

Permalink
Merge pull request #45143 from frappe/mergify/bp/version-15-hotfix/pr…
Browse files Browse the repository at this point in the history
…-45048

fix: serial and batch no. buttons on pos (backport #45048)
  • Loading branch information
rohitwaghchaure authored Jan 7, 2025
2 parents cac3524 + 54e3a74 commit e36bd5f
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions erpnext/selling/page/point_of_sale/pos_item_details.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,21 @@ erpnext.PointOfSale.ItemDetails = class {

make_auto_serial_selection_btn(item) {
if (item.has_serial_no || item.has_batch_no) {
const label = item.has_serial_no ? __("Select Serial No") : __("Select Batch No");
this.$form_container.append(
`<div class="btn btn-sm btn-secondary auto-fetch-btn">${label}</div>`
);
if (item.has_serial_no && item.has_batch_no) {
this.$form_container.append(
`<div class="btn btn-sm btn-secondary auto-fetch-btn" style="margin-top: 6px">${__(
"Select Serial No / Batch No"
)}</div>`
);
} else {
const classname = item.has_serial_no ? ".serial_no-control" : ".batch_no-control";
const label = item.has_serial_no ? __("Select Serial No") : __("Select Batch No");
this.$form_container
.find(classname)
.append(
`<div class="btn btn-sm btn-secondary auto-fetch-btn" style="margin-top: 6px">${label}</div>`
);
}
this.$form_container.find(".serial_no-control").find("textarea").css("height", "6rem");
}
}
Expand Down

0 comments on commit e36bd5f

Please sign in to comment.