Author Topic: Order editing conflicts (multiple users)  (Read 1022 times)

EvanGR

  • Jr. Member
  • **
  • Posts: 429
Order editing conflicts (multiple users)
« on: March 22, 2021, 10:45:24 am »
Hello,

We have 3 employees handling the orders, and we want to prevent an order from being edited by two people at once (accidentally). Is there a provision for that?

(Joomla usually has a lock mechanism to prevent that scenario)

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1127
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: Order editing conflicts (multiple users)
« Reply #1 on: March 22, 2021, 12:25:22 pm »
Of course,
you have to create new user group and setup ACL for app VirtueMart:

administrator/index.php?option=com_config&view=component&component=com_virtuemart

Order access
Orders edit
Orders delete
Order status change
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds from products, orders and database table
Virtuemart Email Manager - customs email templates

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10137
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Order editing conflicts (multiple users)
« Reply #2 on: March 22, 2021, 14:40:48 pm »
Evan means if two admin have the same rights .. and no .. you can test this by opening a product edit in two separate browsers with 2 separate users .. both can edit..

the locked_on etc columns are there but are unused for this purpose
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1127
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: Order editing conflicts (multiple users)
« Reply #3 on: March 22, 2021, 15:07:47 pm »
To GJC:
aha. Thanks for explanation

then if virtuemart don't use the same preventing system as joomla for editing articles, modules... you have to add by self develop.
If the collumn in DB now exist (and not used in this time), it should not be so difficult to implement.
Or you can add for these table for orders new collumn and all function in model order or view.html.php have to change.
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds from products, orders and database table
Virtuemart Email Manager - customs email templates

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3479
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Order editing conflicts (multiple users)
« Reply #4 on: March 23, 2021, 07:02:15 am »
This is not an Easy task. You have users that are updating the database att the same time. Checking in and out the order database during editing would interfere with normal order update from customers
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

EvanGR

  • Jr. Member
  • **
  • Posts: 429
Re: Order editing conflicts (multiple users)
« Reply #5 on: March 23, 2021, 08:36:24 am »
In our experience, customers contact us directly when they want to change or cancel an order. But that's just us.

A proposal on how I think it could work:

1) In the default new order state, the order is available for editing but only by 1 person on the backend (enforced by the familiar lock mechanism).
OR... at least, show a notice that another user X has opened this order for editing at Y date/time.
So that employees can coordinate.

2) When the order status is changed to "Processing" (or equivalent), the customer can no longer edit their order. (Perhaps a "request cancellation" feature would be useful, but this should not change the order state directly)

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3479
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Order editing conflicts (multiple users)
« Reply #6 on: March 23, 2021, 08:57:55 am »
You are missing my point.

If You put an lock on the database files related to the order management. You will also put a lock on product related files. This will stop new order from be registered if they are using any of the related database items. The amount of concurrent users will elevate the risk of conflicts. But it is enough for one customer to order one item that is on a locked order.

You can minimize the risk with transaction management where you encapsulate an update to make sure nothing interferes during read and write, but I do not see any easy way to make the conflicts zero. They will happen with unknown sideeffects.

The lock that is done for Joomla articles does work because front end users does not usually update the database files, content is mostly read.

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3450
  • VirtueMart Version: 3.8.9
Re: Order editing conflicts (multiple users)
« Reply #7 on: March 23, 2021, 10:52:04 am »
EvanGR

Quote
In our experience, customers contact us directly when they want to change or cancel an order. But that's just us.

As can be seen from the answers below - this is not catered for.

Note - below here there is no solution, just observation.

May I suggest that you look at your business processes in the first instance - because I am struggling to envisage a scenario where a customer calls regarding their order and 2 people work on that in parallel.

That is not to say that it is not possible (of course it is!)

I could easily see how one person is working an order in detail view and another updates a load of statuses in list view and that "load" includes the order being worked on - That would be "interesting" .

It would also be a challenge to ensure that "if the locking of orders ever happened"  how the message was reflected to the user doing the status update - because (in my experience) users are really good at ignoring messages!!!
Regards
A

Joomla 3.9.26
php 7.4

EvanGR

  • Jr. Member
  • **
  • Posts: 429
Re: Order editing conflicts (multiple users)
« Reply #8 on: March 23, 2021, 11:30:59 am »
By the way, just to make sure we are talking about the same thing....

I am not talking about database table locking.

I am only talking about marking an order as being already edited by a user (backend).

It should only take 2 DB columns to implement this: the last edit timestamp and the userid.
No hard locks or anything else.

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3479
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Order editing conflicts (multiple users)
« Reply #9 on: March 23, 2021, 11:43:12 am »
Not easy to tell from Your posts what you want, this is in my eyes a 180 turn.

Last edited and edited by is already in the databse table. Override and edit Your BE view to show edited by.


Jörgen
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3450
  • VirtueMart Version: 3.8.9
Re: Order editing conflicts (multiple users)
« Reply #10 on: March 23, 2021, 12:01:53 pm »
EvanGR

Quote
I am only talking about marking an order as being already edited by a user (backend).

It should only take 2 DB columns to implement this: the last edit timestamp and the userid.
No hard locks or anything else.

Yes understood - The "checked out" stuff similar to joomla

Quote
It should only take 2 DB columns to implement this

The option to update this data on edit
The option to remove this data on closed /save
Modification to the order list display "being touched" status
The modification to the order edit display to show "being touched" status

This is likely to be a pain when a user opens an order - then just goes to another page without closing it "properly"
Functions to "clear this status on orders" that are definitely not being touched or open in edit

It is never a "It should only take" - so I am unsure who will take this forward and do the work for it.


This is a very specific request as it only works for an edit function - not for changing the status of an order in admin list that is being edited (which seems to me the most likely scenario)
Regards
A

Joomla 3.9.26
php 7.4

EvanGR

  • Jr. Member
  • **
  • Posts: 429
Re: Order editing conflicts (multiple users)
« Reply #11 on: March 23, 2021, 12:37:31 pm »
Thanks for the replies. Apologies if I am not 100% clear, English is a second language to me.

AH, thanks, that was exactly my thinking. Including the problems you pointed out.

Reminding the original problem:
Sometimes two employees open and process the same order at the same time. Because there is no indication that order is currently being processed by anyone else.

I would imagine this would be a common issue for any company that has 2+ employees working on the VM backend.

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3479
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Order editing conflicts (multiple users)
« Reply #12 on: March 23, 2021, 13:44:05 pm »
My personal guess is that this is not unique to VM. This is a common approach in many database systems around the world. Checking in and out views is not easy to handle. One of my early bosses called this kind of updating the "optimist method", last to save wins the edit, when two or more users are editing the same data. Not exclusive to VM in any way.

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3450
  • VirtueMart Version: 3.8.9
Re: Order editing conflicts (multiple users)
« Reply #13 on: March 23, 2021, 15:02:48 pm »
Quote
I would imagine this would be a common issue for any company that has 2+ employees working on the VM backend.

For more than 9 years we have had more than 4 employees working on VM admin orders - but have yet experience a " double update" problem - so maybe it is a business process issue that can be solved by changing the business process?
Regards
A

Joomla 3.9.26
php 7.4

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1127
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: Order editing conflicts (multiple users)
« Reply #14 on: March 23, 2021, 15:25:52 pm »
heretical idea:

when it comes to jooma articles, Virtuemart orders should not be a problem.

But the right comment - is it even needed and will it be burned out financially?
Our one customer has 8 e-shops and the orders are always edited in the administration by one person so that there is no confusion.
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds from products, orders and database table
Virtuemart Email Manager - customs email templates