- Posts: 165
- Thank you received: 3
Hikaserial Importer is allowing duplicate serials
- jschroeder
-
Topic Author
- Offline
-- HikaSerial version -- : 1.10.0
-- Joomla version -- : 3.4.5
Hikashop importer allows duplicate serial numbers. When I import a set of serial numbers into a pack in hikaserial it allows me to import the same set of serial numbers 2 times causing duplicate serial numbers. This cannot happen for the company we are doing this for because they will have different people importing the csv and we cannot rely on them to know if they have already uploaded the csv already.
For example with the set of data below. If I import this csv in 2 times then the hikaserial importer imports the serial data twice and then we have duplicate serial numbers. I do realize I can use the serial_id column, but that is not a viable option for the company we are doing this for. It is for a very large company and the upload has to be full proof . I need the hikashop importer to check the serial_data column when the csv is uploaded and if it sees that the serial already exists in the serial_data column that it will not import that line in, in the csv or allow that duplicate serial number to be imported.?
How would I go about getting this to work? I do not think the importer currently has an option for this. However, this particular company pays for each serial number they use and each serial is attached to a specific dollar amount so there absolutely cannot be duplicate serial numbers. If duplicate serials accidentally happened they would be overselling their serials and then when a customer would come in their gift certificate would not work which would be very bad.
I cannot be the only one that needs this, I cannot see how any company would want duplicate serial numbers allowed in the database. What I would see making the most sense is having an option in the back end of the hikaserial import that says "do not allow duplicate serials when importing" or something like that, that would allow for this functionality.
This is a pretty urgent thing any help would be greatly appreciated.
Please Log in or Create an account to join the conversation.
That's right, there is currently no check made during the import in order to avoid the serial duplication.
But that is something which can be added.
With a little modification of the structure, the import could check the "serial data" before the insertion (only when there is no "serial_id") and exclude the serial which already exist in the database.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
After a deeper analyze ; HikaSerial could have such kind of option to avoid serial duplication during import.
It can't be the default value because having identical serials is authorized and can be useful for some specific cases.
Now ; that's also right that some case need checks to avoid duplication.
But ; in order to know more about the specifications ; When it checks if the serial already exists, does HikaSerial have to check only in the same pack or in all packs ?
You import sample only concern one single pack but it could also list other packs.
Depending if your using several packs or not, if the duplication can be authorized or not.. The algorithm will change a lot !
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
- jschroeder
-
Topic Author
- Offline
- Posts: 165
- Thank you received: 3
I would think that would be the case though with anyone using serial numbers. The pack should be irrelevant because you only want someone using a serial number 1 time regardless of the pack it is under.
I would think it would just need to check the serial_data column and look to see if the serial already exists and if it does not import it into any pack but maybe it is more complicated than that?
Please Log in or Create an account to join the conversation.
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
- jschroeder
-
Topic Author
- Offline
- Posts: 165
- Thank you received: 3
Please Log in or Create an account to join the conversation.
With the issue reported on another thread ; I was working on a new release.
So it was a good opportunity to include directly that feature into HikaSerial than just giving you the files to modify.
www.hikashop.com/forum/16-serial-bug-rep...-problem.html#223094
After that, I'm really fan of recommandation by word of mouth but HikaSerial is also listed on the Joomla extension directory and, for a partially unknown reason, just have 2 reviews.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
- Posts: 32
- Thank you received: 0
Let's say that there is 3 unique serials and 3 duplicated.
So HikaSerial imports the 3 unique serials and 1 from the duplicated ones. I have to import manually every duplicated serial.
Help Please!
Please Log in or Create an account to join the conversation.
- jschroeder
-
Topic Author
- Offline
- Posts: 165
- Thank you received: 3
Please Log in or Create an account to join the conversation.
The serial import default behavior hasn't changed.
By default the setting "check duplicate serials" is "no" ; to continue to not check the serial duplication.
If you ask HikaSerial to check for duplicates, it will do so ; except if you specify the "serial_id" because it means that you are updating serials (and you know exactly what you do).
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
- Posts: 32
- Thank you received: 0
I tried what you said, to add ,serial_id in the top and to assing a number to each of the serials in order not to have conflicts. It didn't work. The "Check duplicate serials" button is set to NO and still receiving a DUPLICATE_SERIAL_IN_CONTENT error for each repeated serial.
All this is delaying my work
Please Log in or Create an account to join the conversation.
Okay.
In the file "administrator/components/com_hikaserial/helpers/import.php" you will find the block
I'll also update the HikaSerial package.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
- Posts: 32
- Thank you received: 0
Please Log in or Create an account to join the conversation.
Ah yes, there is still the merge on the serial data.
You need to replace
I'll arrange a little bit more the code, process some tests and I'll update the HikaSerial package. But that patch would fix your issue.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
- Posts: 32
- Thank you received: 0
Please Log in or Create an account to join the conversation.