') != -1) {
try {
item_data.description = $(item_data.description).text();
} catch (error) {
- item_data.description = item_data.description.replace(/
/g, ' ').replace(/<\/div>/g, ' ').replace(/ +/g, ' ');
+ item_data.description = item_data.description
+ .replace(/
/g, ' ')
+ .replace(/<\/div>/g, ' ')
+ .replace(/ +/g, ' ');
}
}
item_data.description = frappe.ellipsis(item_data.description, 45);
diff --git a/posnext/public/js/pos_item_selector.js b/posnext/public/js/pos_item_selector.js
index 743f029..7a1a71e 100644
--- a/posnext/public/js/pos_item_selector.js
+++ b/posnext/public/js/pos_item_selector.js
@@ -30,6 +30,7 @@ posnext.PointOfSale.ItemSelector = class {
this.show_only_card_view = settings.custom_show_only_card_view
this.custom_edit_rate = settings.custom_edit_rate_and_uom
this.custom_show_incoming_rate = settings.custom_show_incoming_rate && settings.custom_edit_rate_and_uom;
+ this.custom_show_item_discription = settings.custom_show_item_discription;
// this.custom_edit_uom = settings.custom_edit_uom
this.inti_component();
}
@@ -304,7 +305,7 @@ posnext.PointOfSale.ItemSelector = class {
const item_selector = `.cart-item-wrapper[data-row-name="${escape(item_code)}"]`;
return this.$cart_items_wrapper.find(item_selector);
}
- async render_cart_item(item_data) {
+ render_cart_item(item_data) {
const me = this;
const currency = me.events.get_frm().currency || me.currency;
this.$cart_items_wrapper.append(
@@ -329,7 +330,7 @@ posnext.PointOfSale.ItemSelector = class {
${item_data.item_name}
- ${await get_description_html(item_data)}
+ ${get_description_html(item_data)}
${get_item_code()}
${get_rate_discount_html()}`
@@ -430,18 +431,9 @@ posnext.PointOfSale.ItemSelector = class {
}
}
- async function get_description_html(item_data) {
- var posname = me.pos_profile
- console.log(me.pos_profile)
- const response = await frappe.call({
- method: 'frappe.client.get_value',
- args: {
- doctype: 'POS Profile',
- filters: { name: posname },
- fieldname: 'custom_show_item_discription'
- }
- });
- if (item_data.description && response.message.custom_show_item_discription==1) {
+ function get_description_html(item_data) {
+
+ if (me.custom_show_item_discription) {
if (item_data.description.indexOf('
') != -1) {
try {
item_data.description = $(item_data.description).text();