mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 18:04:46 +00:00
fix: pos settings invoice_fields not fetched at pos setup (#47855)
This commit is contained in:
@@ -160,19 +160,18 @@ erpnext.PointOfSale.Controller = class {
|
|||||||
this.setup_listener_for_pos_closing();
|
this.setup_listener_for_pos_closing();
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch_invoice_fields() {
|
async fetch_invoice_fields() {
|
||||||
const me = this;
|
this.settings.invoice_fields = new Array();
|
||||||
frappe.db.get_doc("POS Settings", undefined).then((doc) => {
|
const pos_settings = await frappe.db.get_doc("POS Settings", undefined);
|
||||||
me.settings.invoice_fields = doc.invoice_fields.map((field) => {
|
pos_settings.invoice_fields.forEach((field) => {
|
||||||
return {
|
this.settings.invoice_fields.push({
|
||||||
fieldname: field.fieldname,
|
fieldname: field.fieldname,
|
||||||
label: field.label,
|
label: field.label,
|
||||||
fieldtype: field.fieldtype,
|
fieldtype: field.fieldtype,
|
||||||
reqd: field.reqd,
|
reqd: field.reqd,
|
||||||
options: field.options,
|
options: field.options,
|
||||||
default_value: field.default_value,
|
default_value: field.default_value,
|
||||||
read_only: field.read_only,
|
read_only: field.read_only,
|
||||||
};
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user