-
Notifications
You must be signed in to change notification settings - Fork 0
Randomly the order number is skipped and another one is attached #4
Comments
Well that's odd. (The date stuff is done by Craft not the plugin really. And not used really... I've never really looked at it tbh) Is this on a live site? Could be something weird to do with concurrency if you have lots of orders flowing through I suppose. As long as they have different numbers if the timing is quite concurrent it shouldn't prove a big problem I guess? Still.... A skip will occur if an order fails in another onBefore handler, or there's an issue with completing. Because the number has been taken and won't be re-used. That seems reasonable behaviour to me. Anyway late here and I am on phone... Will look properly tomorrow! |
Yes it is on production but there are hardly more than 2 orders per day. Therefore no issue with concurrency. I was also thinking about a technical solution in the plugin. |
Ok, so I am pretty sure this is all to do with an order failing to complete. In a nutshell: User comes along and tries to complete an order - gets an order number Someone else comes along and makes an order and gets The original person comes back and now completes their order -> the plugin now gives them I'd say the simple fix here might be to add a check that there isn't already an order number value on the order. That would at least mean the order started earlier would get the earlier number...but I am not actually sure that is better than a skip and the order completed later getting the later number..indeed, I think I prefer the current behaviour. I am not bothered by the odd skip in numbers personally as long as the numbers are client friendly and increasing as orders are made. What do you think? I'm inclined to leave it as is really. |
Ok I understand. Personally I don't mind skipping numbers either :) but client(s) use the numbers as a reference for financial administration and skipping invoice number(s) is a problem ..
|
I guess I could make it a setting. I like my numbers to reflect the order received, but I can see your client's preference could make sense. Feel free to do a PR (with the default of the setting being the as is behaviour)... Or I can do it sometime soon. |
Yes sure I will. |
Could you create a branch or allow me to create one? I am not able to create one. |
As in, you forked the repo and it wouldn't let you make a branch on your fork? Anyway, I will make a dev branch |
Just came across this issue as we too have a client whose finance department doesn't like missing order numbers in the sequence. Did you guys manage to sort out the new feature to prevent this or is it still work in progress? |
There is a PR here - #5 - just want to confirm it's been properly tested and will then merge and do a release. Feel free to try it out yourself an post feedback on your testing on the PR. |
Sometimes the order number is skipped.
In the attached screenshot order number 20170262 is created before(!) 20170261.
Order number 20170262 should actually be 20170260. Furthermore order number 20170260 is nowhere to find.
Any suggestion where it goes wrong?
The text was updated successfully, but these errors were encountered: