ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Offline POS Print format NOT Working in Online mode

customization
pos_point_of_sale
print_format
erpnextversion9

#1

After enabling online pos, I was not able to use offline pos print format which is of type ‘Js’ (Print Format Type) in online mode. Nothing is being displayed when i try to print from online pos.

Tried to debug at code level in pos and found two different js files for online (point_of_sale.js) and offline (pos.js) mode. Further digging deeper at (pos_profile.js) and encounter below code which i assume makes Js format not available for online mode.

Please correct me if i am wrong.

frm.set_query("online_print_format", function() {
			return {
				filters: [
					['Print Format', 'doc_type', '=', 'Sales Invoice'],
					['Print Format', 'print_format_type', '!=', 'Js'],
				]
			};
		});

		frm.set_query("print_format", function() {
			return { filters: { doc_type: "Sales Invoice", print_format_type: "Js"} };
		});

Also, i saw two different ways of rendering print format.

"Offline Mode"
    this.page.set_secondary_action(__("Print"), function () {
    				var html = frappe.render(me.print_template_data, me.frm.doc)
    				me.print_document(html)
    			})

"Online Mode"
    this.page.set_secondary_action(__("Print"), () => {
        			if (this.pos_profile && this.pos_profile.print_format_for_online) {
        				this.frm.meta.default_print_format = this.pos_profile.print_format_for_online;
        			}
        			this.frm.print_preview.printit(true);
        		});

Curious to know how online mode is rendering print format?

So, the question is how could we use offline POS Print format (Type - Js) for online mode?


#2

Hi @jparikh

Why would you need the Print Format for Offline POS in Online POS?

They each have a separate Print Format so you can customize as needed and point to the desired print format via POS Profile settings

Regards


#3

Hi @mwai

My POS profile settings only show one Print Format option depending on the mode I have set in the POS Profile settings. When I’m in offline mode and my internet connection is good, the POS automatically switches to online mode however, at this point I can’t print my POS receipts/invoices. I have to manually go back to the POS settings and change it to online mode before I’m able to print the receipt/invoice. What am I missing and how do I get around this problem?