mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 16:04:46 +00:00
style: linting issue fixed
This commit is contained in:
@@ -5,9 +5,10 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
|||||||
this.show_dialog = show_dialog;
|
this.show_dialog = show_dialog;
|
||||||
// frm, item, warehouse_details, has_batch, oldest
|
// frm, item, warehouse_details, has_batch, oldest
|
||||||
let d = this.item;
|
let d = this.item;
|
||||||
if(d && d.has_batch_no && (!d.batch_no || this.show_dialog)) {
|
if (d && d.has_batch_no && (!d.batch_no || this.show_dialog)) {
|
||||||
this.has_batch = 1;
|
this.has_batch = 1;
|
||||||
this.setup();
|
this.setup();
|
||||||
|
// !(this.show_dialog == false) ensures that show_dialog is implictly true, even when undefined
|
||||||
} else if(d && d.has_serial_no && !(this.show_dialog == false)) {
|
} else if(d && d.has_serial_no && !(this.show_dialog == false)) {
|
||||||
this.has_batch = 0;
|
this.has_batch = 0;
|
||||||
this.setup();
|
this.setup();
|
||||||
@@ -66,14 +67,14 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
|||||||
{
|
{
|
||||||
fieldname: 'qty',
|
fieldname: 'qty',
|
||||||
fieldtype:'Float',
|
fieldtype:'Float',
|
||||||
read_only: me.has_batch ? 1 : 0,
|
read_only: me.has_batch,
|
||||||
label: __(me.has_batch ? 'Total Qty' : 'Qty'),
|
label: __(me.has_batch ? 'Total Qty' : 'Qty'),
|
||||||
default: 0
|
default: 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldname: 'auto_fetch_button',
|
fieldname: 'auto_fetch_button',
|
||||||
fieldtype:'Button',
|
fieldtype:'Button',
|
||||||
hidden: me.has_batch ? 1 : 0,
|
hidden: me.has_batch,
|
||||||
label: __('Fetch based on FIFO'),
|
label: __('Fetch based on FIFO'),
|
||||||
click: () => {
|
click: () => {
|
||||||
let qty = this.dialog.fields_dict.qty.get_value();
|
let qty = this.dialog.fields_dict.qty.get_value();
|
||||||
@@ -89,7 +90,7 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
|||||||
numbers.then((data) => {
|
numbers.then((data) => {
|
||||||
let auto_fetched_serial_numbers = data.message;
|
let auto_fetched_serial_numbers = data.message;
|
||||||
let records_length = auto_fetched_serial_numbers.length;
|
let records_length = auto_fetched_serial_numbers.length;
|
||||||
if(records_length < qty) {
|
if (records_length < qty) {
|
||||||
frappe.msgprint(`Fetched only ${records_length} serial numbers.`);
|
frappe.msgprint(`Fetched only ${records_length} serial numbers.`);
|
||||||
}
|
}
|
||||||
let serial_no_list_field = this.dialog.fields_dict.serial_no;
|
let serial_no_list_field = this.dialog.fields_dict.serial_no;
|
||||||
@@ -100,7 +101,7 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
if(this.has_batch) {
|
if (this.has_batch) {
|
||||||
title = __("Select Batch Numbers");
|
title = __("Select Batch Numbers");
|
||||||
fields = fields.concat(this.get_batch_fields());
|
fields = fields.concat(this.get_batch_fields());
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user