Offline PoS - Sales Invoices stuck in local system

Also are you able to get paper copies of the pos invoices? If you can, then print them out. If all else fails, make necessary JE be mentally prepared for that! :slight_smile: strong text

355?

Not an option

Besides I need to know what the issue is , it started with 1 out of 6 systems, now 3 of the 6 systems are stuck and no longer sync data to server.

I need to know what the issue is and how to solve it else the client will kick me out , even if I clear the cache and lose this data, no guarantees that it will not happen again.

Regards

@olamide_shodunke

Have fixed this issue and soon we’ll release it, but still not able to replicate the issue related to valuation. It seems that there is no issue of valuation but issue of payment schedule validation.

Ok Rohit

Will update this now and give you feedback

Regards

Hi @rohit_w

I added the lines you added, did bench build and bench migrate

I got the following error on doing bench migrate

Updating DocTypes for frappe : [========================================]

Updating DocTypes for erpnext : [========================================]

Updating DocTypes for printnode_integration: [========================================]

Updating DocTypes for process_manufacturing: [========================================]

Traceback (most recent call last):

File “/usr/lib/python2.7/runpy.py”, line 162, in _run_module_as_main

"__main__", fname, loader, pkg_name)

File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code

exec code in run_globals

File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in

main()

File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main

click.Group(commands=commands)(prog_name='bench')

File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, l ine 716, in call

return self.main(*args, **kwargs)

File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, l ine 696, in main

rv = self.invoke(ctx)

File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, l ine 1060, in invoke

return _process_result(sub_ctx.command.invoke(sub_ctx))

File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, l ine 1060, in invoke

return _process_result(sub_ctx.command.invoke(sub_ctx))

File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, l ine 889, in invoke

return ctx.invoke(self.callback, **ctx.params)

File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, l ine 534, in invoke

return callback(*args, **kwargs)

File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators. py”, line 17, in new_func

return f(get_current_context(), *args, **kwargs)

File “/home/ubuntu/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _ func

ret = f(frappe._dict(ctx.obj), *args, **kwargs)

File “/home/ubuntu/frappe-bench/apps/frappe/frappe/commands/site.py”, line 222, in migr ate

migrate(context.verbose, rebuild_website=rebuild_website)

File “/home/ubuntu/frappe-bench/apps/frappe/frappe/migrate.py”, line 35, in migrate

sync_fixtures()

File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/fixtures.py”, line 24, in sync _fixtures

ignore_links=True, overwrite=True)

File “/home/ubuntu/frappe-bench/apps/frappe/frappe/core/doctype/data_import/data_import .py”, line 53, in import_doc

frappe.modules.import_file.import_file_by_path(f, data_import=True, force=True, pre_p  rocess=pre_process, reset_permissions=True)

File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 58, in import_file_by_path

ignore_version=ignore_version, reset_permissions=reset_permissions)

File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 132, i n import_doc

doc.insert()

File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 218, in ins ert

self.run_before_save_methods()

File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 859, in run _before_save_methods

self.run_method("validate")

File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 755, in run _method

out = Document.hook(fn)(self, *args, **kwargs)

File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 1024, in co mposer

return composed(self, method, *args, **kwargs)

File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 1007, in ru nner

add_to_return_value(self, fn(self, *args, **kwargs))

File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 749, in

fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)

File “/home/ubuntu/frappe-bench/apps/frappe/frappe/custom/doctype/custom_field/custom_f ield.py”, line 44, in validate

check_if_fieldname_conflicts_with_methods(self.dt, self.fieldname)

File “/home/ubuntu/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, li ne 805, in check_if_fieldname_conflicts_with_methods

doc = frappe.get_doc({"doctype": doctype})

File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 638, in get_doc

return frappe.model.document.get_doc(*args, **kwargs)

File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 66, in get_ doc

controller = get_controller(doctype)

File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 36, in get_controller

module = load_doctype_module(doctype, module_name)

File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 185, in load _doctype_module

doctype_python_modules[key] = frappe.get_module(module_name)

File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 704, in get_modul e

return importlib.import_module(modulename)

File “/usr/lib/python2.7/importlib/init.py”, line 37, in import_module

__import__(name)

File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/stock/doctype/stock_entry/stock_en try.py”, line 21, in

from erpnext.controllers.stock_controller import StockController

File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/controllers/stock_controller.py”, line 11, in

from erpnext.controllers.accounts_controller import AccountsController

File "/home/ubuntu/frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py ", line 671

posting_date = self.get("bill_date") or self.get("posting_date") or self.get("transac  tion_date")

                                                                                                 ^

IndentationError: unindent does not match any outer indentation level

Would appreciate greatly pointing out what mistake we made

Indentation error, you have not copied code properly

Successfully updated

But Still the same issue here @rohit_w

See error message from the error log when we try to resubmit offline invoices

Traceback (most recent call last):
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/pos.py”, line 484, in submit_invoice
si_doc.insert()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 218, in insert
self.run_before_save_methods()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 859, in run_before_save_methods
self.run_method(“validate”)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 755, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 1024, in composer
return composed(self, method, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 1007, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 749, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py”, line 58, in validate
super(SalesInvoice, self).validate()
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/controllers/selling_controller.py”, line 37, in validate
super(SellingController, self).validate()
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/controllers/stock_controller.py”, line 17, in validate
super(StockController, self).validate()
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py”, line 53, in validate
self.validate_all_documents_schedule()
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py”, line 80, in validate_all_documents_schedule
self.validate_invoice_documents_schedule()
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py”, line 69, in validate_invoice_documents_schedule
self.validate_payment_schedule_amount()
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py”, line 721, in validate_payment_schedule_amount
total = flt(total, self.precision(“grand_total”))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 323, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 309, in msgprint
_raise_exception()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 282, in _raise_exception
raise raise_exception(encode(msg))
ValidationError: Total Payment Amount in Payment Schedule must be equal to Grand / Rounded Total

Did you reloaded supervisor? reload supervisor and check

Thank you @rohit_w
The ¨ValidationError: Total Payment Amount in Payment Schedule must be equal to Grand / Rounded Total¨ error message is gone and no longer shows up in both the browser window and the error log list

However the second error message “Error: Value missing for Item: Valuation Rate” is still preventing the invoices from syncing to server.

For your information the “Error: Value missing for Item: Valuation Rate” does not show up in the error log list, it only pops up at the browser window when we try to sync offline invoices.

What can we do?

Regards

Is there any code that will make valuation rate optional?

Am just puzzled that the error message is not showing up on the error log list, does this mean that the valuation rate validation is been done on the browser ? not reaching the server?

Can you share the complete traceback of an error or screenshot?

@rohit_w

See below the screenshot

Note that we do not have a traceback as the error only comes up at the browser, it does not show up in the error log of the server.

Thanks @EnSeal

@rohit_w that’s the only message we get at the moment, and it comes up as a prompt when we try to submit the offline invoices

Regards

No pressure @rohit_w

But we are all here just waiting to see the magic you can perform for us, we have run out of ideas.

You seem to be the only hope we have right now.

Like I said…no pressure …lol

1 Like

Yes, that’s it! the logic is also cached in the browser, so changes on the server will not affect old invoices.

This brings me back to my previous issue with this offline pos; I just think its wrong, its just wrong, for many reasons:

  1. Frappe doesnt own this cache and so there’s limited control of it
  2. It puts crucial, very delicate information in a very vulnerable position, a cache that can be cleared by a user, any user, a cashier can clear his/her first 2 or 3 sales between say 8am and 8.15 and there’s nothing you can do about it; you can’t prove he/she cleared the cache, you dont have a record of cache position anywhere; you cant even take the case to any court. Does chrome tell you if someone cleared the cache and who? Do we have web browser accounts? Does erpnext keep a log in the browser that can tell who manipulated the cache? all crucial questions for an erp system; if you had windows server with policies, do they even help you manage a sandbosed environment like a browser?
  3. You have this issue now with @olamide_shodunke this has kept him on the edge for days, a new customer having this issue; in the immediate; its a challenge for his business and on a broader scale; trust for this system reducing. Will this client recommend this system to his pal opening a new shop?

I have been battling numerous issues since last year, all around version 9 and 10; this is an erp system, not a social network, lets leave those brittle technologies out. we need real time, reliable transactions.

I will sing the old song again, if you ever used version 4, 5, 6 (I have over 20 shops on one of these versions); you have zero issues, zero bugs, perfection, that is erpnext at its finest.

Imagine the headache I face with a client doing about 1000 daily invoices every day; I have a nagging call everyday! Same client used v6 for about 9 months with zero bugs; just that the system slowed down when their data grew so large. I updated to version 10 on sunday and reports broke, we reverted and restored our backup.

In all, these clients may not pay much for our attention and headache, most pay us around 1000usd gross and cover that expense within a few days of sales; but we need their good word, trust and recommendation to keep ERPNext on the lead.

People read these forums, let these issues be fixed on time, please.

Is there any way to query invoices in the browser’s cache and edit/update/push/force-sync them? If not then its not good for business; its obvious. I talked about this months ago; that the caching is a weak spot; now we see a very nasty example.

This is our v6 pos, the only thing it doesnt have is split payments like card+cash. I dont know what was so wrong with this that it was discarded, why didnt this just get improved, this you see, just never fails.

This was a v4 store, just updated to v6 yesterday, so this trial balance data is from v4, I havent had 1 complaint, this store has over 6 branches running off a Core i3 desktop with windows 7, across 3 states. everything you see was done in v4 since 2015 until yesterday.

v9/10 don’t have this stability, so something’s not right my people.

Hello @rohit_w

This is now officially a disaster.

The 4th system just starting showing the same valuation error message.

Meaning we have only two systems selling, this is because we have been isolating all systems that show this error message. The invoices do not sync and it is impossible to balance the cashiers at end of day.

Very soon the entire store will be down.

The owner of the store is now looking at me funny, we did come highly recommended.

Any help guys? I need a hail mary pass right now.

@rmehta @Pawan @rohit_w @anybody

I need help

Please @olamide_shodunke can you impress on them to go online? Please, the duplicate sales and auto submission is a lesser issue; although a second phase of issues may further reduce the confidence; but please ask them to switch for now.