diff --git a/product/ERP5TioSafe/Conduit/ERP5NodeConduit.py b/product/ERP5TioSafe/Conduit/ERP5NodeConduit.py new file mode 100644 index 0000000000000000000000000000000000000000..8c773bdd7ea39205b612e446ddd4b43554cd66d8 --- /dev/null +++ b/product/ERP5TioSafe/Conduit/ERP5NodeConduit.py @@ -0,0 +1,442 @@ +############################################################################## +# +# Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved. +# Herve Poulain <herve@nexedi.com> +# Aurelien Calonne <aurel@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +from Products.ERP5TioSafe.Conduit.TioSafeBaseConduit import TioSafeBaseConduit, \ + ADDRESS_TAG_LIST +from DateTime import DateTime +from lxml import etree +from zLOG import LOG, INFO, ERROR +from base64 import b16encode + +DEBUG=True + +class ERP5NodeConduit(TioSafeBaseConduit): + """ + This is the conduit use to synchonize ERP5 Persons + """ + + def __init__(self): + self.xml_object_tag = 'node' + + def afterNewObject(self, object): + """ Realise actions after new object creation. """ + object.validate() + object.updateLocalRolesOnSecurityGroups() + + def _setRelation(self, document, previous_value, organisation_gid, domain, xml): + """ Retrieve the organisation from its gid and do the link """ + + # first check if there is any conflict + synchronization_list = self.getSynchronizationObjectListForType(domain, 'Organisation', 'publication') + if previous_value is not None and xml is not None: + current_relation = document.getCareerSubordinationValue() + for synchronization in synchronization_list: + current_value = synchronization.getGidFromObject(current_relation) + if current_value: + break + if current_value not in [organisation_gid, previous_value]: + return [self._generateConflict(document.getPhysicalPath(), 'relation', xml, current_value, organisation_gid),] + + # now set the value + if organisation_gid is None: + document.setCareerSubordinationValue(None) + else: + for synchronization in synchronization_list: + link_object = synchronization.getObjectFromGid(b16encode(organisation_gid)) + if link_object is not None: + break + if link_object is not None: + document.setCareerSubordinationValue(link_object) + else: + raise ValueError, "Impossible to find organisation %s in %s" %(organisation_gid, synchronization_list) + return [] + + def _createContent(self, xml=None, object=None, object_id=None, sub_object=None, + reset_local_roles=0, reset_workflow=0, simulate=0, **kw): + """ This is the method calling to create an object. """ + if DEBUG: + LOG("ERP5NodeContuide._createContent", INFO, "xml = %s" %(etree.tostring(xml, pretty_print=True),)) + if object_id is not None: + sub_object = None + if sub_object is None: # If so, it doesn't exist + sub_object, reset_local_roles, reset_workflow = self.constructContent( + object, + object_id, + self.getObjectType(xml), + ) + + # if exist namespace retrieve only the tag + index = 0 + if xml.nsmap not in [None, {}]: + index = -1 + + default_address_created = False + # browse the xml + phone_list = [] + cellphone = None + fax_list = [] + relation = None + category_list = [] + role_list =[] + relation_data_dict = {} + address_tag_mapping = {"street" : "street_address", + "zip" : "zip_code", + "country" : "region",} + for node in xml.getchildren(): + # works on tags, no on comments + if type(node.tag) is not str: + continue + tag = node.tag.split('}')[index] + + # specific for phone + if tag == "phone": + phone_list.append(node.text) + elif tag == "cellphone": + cellphone = node.text + elif tag == "fax": + fax_list.append(node.text) + elif tag == "relation": + relation = node.text + elif tag == "category": + if node.text.startswith('role'): + role_list.append(node.text[len("role/"):]) + else: + category_list.append(node.text) + elif tag == 'address': + # Build dict of address properties + address_data_dict = {} + for element in node.getchildren(): + if type(element.tag) is not str: + continue + element_tag = element.tag.split('}')[index] + address_data_dict[address_tag_mapping.get(element_tag, element_tag)] = element.text + # Create the address once we are sure it is well defined + if len(address_data_dict): + # Define address id + if not default_address_created: + address_id = "default_address" + default_address_created = True + else: + address_id = None + # Create the address object + address = sub_object.newContent(portal_type='Address', **address_data_dict) + # Rename to default if necessary + if address_id is not None: + sub_object.activate(activity="SQLQueue", + after_method_id="immediateReindexObject", + priority=5 + ).manage_renameObject(address.getId(), address_id) + + # Set telephone + default_phone_set = False + if cellphone is not None: + sub_object.edit(mobile_telephone_text=cellphone) + + for phone in phone_list: + if not default_phone_set: + sub_object.edit(default_telephone_text=phone) + default_phone_set = True + else: + # Create new subobject + sub_object.newContent(portal_type="Telephone", + telephone_number=phone) + # Set fax + default_fax_set = False + for fax in fax_list: + if not default_fax_set: + sub_object.edit(default_fax_text=fax) + default_fax_set = True + continue + # Create new subobject + sub_object.newContent(portal_type="Fax", + telephone_number=fax) + + # Link to organisation + if relation is not None: + self._setRelation(sub_object, None, relation, kw.get('domain'), None) + + # Set category + if len(category_list): + sub_object.setCategoryList(category_list) + + if len(role_list): + if sub_object.getPortalType() == "Person": + sub_object.edit(career_role_list=role_list) + elif sub_object.getPortalType() == "Organisation": + sub_object.edit(role_list=role_list) + + # build the content of the node + self.newObject( + object=sub_object, + xml=xml, + simulate=simulate, + reset_local_roles=reset_local_roles, + reset_workflow=reset_workflow, + ) + return sub_object + + + def _deleteContent(self, object=None, object_id=None): + """ We do not delete nodes """ + if object[object_id].getValidationState() == "validated": + object[object_id].invalidate() + + def editDocument(self, object=None, **kw): + """ This editDocument method allows to set attributes of the object. """ + if DEBUG: + LOG("ERP5NodeConduit.editDocument", INFO, "object = %s with %s" %(object, kw)) + if kw.get('address_mapping') is None: + mapping = { + 'title': 'title', + 'firstname': 'first_name', + 'lastname': 'last_name', + 'email': 'default_email_text', + 'birthday': 'start_date', + 'description': 'description', + 'phone' : 'default_telephone_text', + 'cellphone' : 'mobile_telephone_text', + 'fax' : 'default_fax_text', + } + else: + mapping = { + 'street': 'street_address', + 'zip': 'zip_code', + 'city': 'city', + 'country': 'region', + } + # translate kw with the good PropertySheet + property = {} + for k, v in kw.items(): + k = mapping.get(k, k) + property[k] = v + object._edit(**property) + + def checkAddressConflict(self, document, tag, xml, previous_value, new_value): + """ + """ + xpath_expression = xml.get('select') + try: + # work on the case: "/node/address[x]" + address_index = int(xpath_expression.split('address[')[-1].split(']')[0]) + except ValueError: + # Work on the case: "/node/address" + address_index = 1 + + if address_index == 1: + address = document.getDefaultAddressValue() + else: + # the XUPDATE begin by one, so one is default_address and the + # first python index list is zero, so x-2 + address_index -= 2 + # address list of the person without default_address + address_list = document.searchFolder( + portal_type='Address', + sort_on=(['id', 'ASC'],), + where_expression='id != "default_address"', + ) + try: + address = address_list[address_index].getObject() + except IndexError: + return [self._generateConflict(document.getPhysicalPath(), tag, xml, None, new_value),] + + # getter used to retrieve the current values and to check conflicts + getter_value_dict = { + 'street': address.getStreetAddress(), + 'zip': address.getZipCode(), + 'city': address.getCity(), + 'country': address.getRegion(), + } + + # create and fill a conflict when the integration site value, the erp5 + # value and the previous value are differents + current_value = getter_value_dict[tag] + if current_value not in [new_value, previous_value]: + return [self._generateConflict(document.getPhysicalPath(), tag, xml, current_value, new_value),] + else: + keyword = {'address_mapping': True, tag: new_value} + self.editDocument(object=address, **keyword) + return [] + + + def _updateXupdateUpdate(self, document=None, xml=None, previous_xml=None, **kw): + """ + This method is called in updateNode and allows to work on the update of + elements. + """ + if DEBUG: + LOG("ERP5NodeConduit._updateXupdateUpdate", INFO, "xml = %s" %(etree.tostring(xml, pretty_print=1),)) + xpath_expression = xml.get('select') + tag = xpath_expression.split('/')[-1] + new_value = xml.text + keyword = {} + + # retrieve the previous xml etree through xpath + selected_previous_xml = previous_xml.xpath(xpath_expression) + try: + previous_value = selected_previous_xml[0].text + except IndexError: + previous_value = None + + # check if it'a work on person or on address + if tag in ADDRESS_TAG_LIST: + return self.checkAddressConflict(document, tag, xml, previous_value, new_value) + else: + return self.checkConflict(tag, document, previous_value, new_value, kw.get('domain'), xml) + + return [] + + def _updateXupdateDel(self, document=None, xml=None, previous_xml=None, **kw): + """ This method is called in updateNode and allows to remove elements. """ + if DEBUG: + LOG("ERP5NodeConduit._updateXupdateDel", INFO, "xml = %s" %(etree.tostring(xml, pretty_print=1),)) + conflict_list = [] + tag = xml.get('select').split('/')[-1] + # this variable is used to retrieve the id of address and to not remove the + # orginal tag (address, street, zip, city or country) + keyword = {} + + # retrieve the previous xml etree through xpath + xpath_expression = xml.get('select') + selected_previous_xml = previous_xml.xpath(xpath_expression) + try: + previous_value = selected_previous_xml[0].text + except IndexError: + previous_value = None + + # specific work for address and address elements + address_tag = tag.split('[')[0] + if address_tag == "address": + try: + # work on the case: "/node/address[x]" + address_index = int(tag.split('[')[-1].split(']')[0]) + except ValueError: + # Work on the case: "/node/address" + address_index = 1 + + if address_index == 1: + address = document.getDefaultAddressValue() + else: + # the XUPDATE begin by one, so one is default_address and the + # first python index list is zero, so x-2 + address_index -= 2 + # address list of the person without default_address + address_list = document.searchFolder( + portal_type='Address', + sort_on=(['id', 'ASC'], ), + where_expression='id != "default_address"', + ) + try: + document.manage_delObjects(address_list[address_index].getId(),) + except IndexError: + conflict_list.append(self._generateConflict(document.getPhysicalPath(), tag, xml, None, None)) + return conflict_list + + elif address_tag in ADDRESS_TAG_LIST: + return self.checkAddressConflict(document, address_tag, xml, previous_value, None) + else: + return self.checkConflict(tag, document, previous_value, None, kw.get('domain'), xml) + + return conflict_list + + def _updateXupdateInsertOrAdd(self, document=None, xml=None, previous_xml=None, **kw): + """ This method is called in updateNode and allows to add elements. """ + if DEBUG: + LOG("ERP5NodeConduit._updateXupdateInsertOrAdd", INFO, "xml = %s" %(etree.tostring(xml, pretty_print=1),)) + conflict_list = [] + keyword = {} + default_address_created = False + previous_value = "" + + for subnode in xml.getchildren(): + tag = subnode.attrib['name'] + new_value = subnode.text + if tag == 'address': + address = document.newContent(portal_type='Address', ) + keyword['address_mapping'] = True + for subsubnode in subnode.getchildren(): + keyword[subsubnode.tag] = subsubnode.text + self.editDocument(object=address, **keyword) + if getattr(document, "default_address", None) is None and not default_address_created: + # This will become the default address + default_address_created = True + document.activate(activity="SQLQueue", + after_method_id="immediateReindexObject", + priority=5 + ).manage_renameObject(address.getId(), "default_address") + elif tag in ADDRESS_TAG_LIST: + return self.checkAddressConflict(document, tag, xml, previous_value, new_value) + else: + return self.checkConflict(tag, document, previous_value, new_value, kw.get('domain'), xml) + + return conflict_list + + + + def checkConflict(self, tag, document, previous_value, new_value, domain, xml): + """ + Check conflict for each tag + """ + if tag == "relation": + return self._setRelation(document, previous_value, new_value, domain, xml) + else: + if tag == "phone": + current_value = document.get('default_telephone', None) and \ + document.default_telephone.getTelephoneNumber("") + elif tag == "cellphone": + current_value = document.get('mobile_telephone', None) and \ + document.mobile_telephone.getTelephoneNumber("") + elif tag == "fax": + current_value = document.get('default_fax', None) and \ + document.default_fax.getTelephoneNumber("") + elif tag == "birthday": + current_value = str(document.getStartDate("")) + else: + current_value = getattr(document, tag) + + if current_value not in [new_value, previous_value, None]: + LOG("ERP5NodeConduit.checkConflict", ERROR, "Generating a conflict for tag %s, current is %s, previous is %s, new is %s" %(tag, current_value, new_value, previous_value)) + return [self._generateConflict(document.getPhysicalPath(), tag, xml, current_value, new_value),] + else: + if new_value is None: + # We are deleting some properties + if tag == "fax": + document.manage_delObjects("default_fax") + elif tag == "phone": + document.manage_delObjects("default_telephone") + elif tag == "cellphone": + document.manage_delObjects("mobile_telephone") + else: + kw = {tag : new_value} + self.editDocument(object=document, **kw) + else: + if tag == 'birthday': + new_value = DateTime(new_value) + kw = {tag : new_value} + self.editDocument(object=document, **kw) + return [] diff --git a/product/ERP5TioSafe/Conduit/ERP5ResourceConduit.py b/product/ERP5TioSafe/Conduit/ERP5ResourceConduit.py new file mode 100644 index 0000000000000000000000000000000000000000..cab5491879fc4036ecfb7479271230da8cb9037a --- /dev/null +++ b/product/ERP5TioSafe/Conduit/ERP5ResourceConduit.py @@ -0,0 +1,464 @@ +############################################################################## +# +# Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved. +# Hervé Poulain <herve@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +from Products.CMFCore.WorkflowCore import WorkflowException +from Products.ERP5SyncML.Document.Conflict import Conflict +from Products.ERP5TioSafe.Conduit.TioSafeBaseConduit import TioSafeBaseConduit +from lxml import etree +parser = etree.XMLParser(remove_blank_text=True) +from zLOG import LOG + +class ERP5ResourceConduit(TioSafeBaseConduit): + """ + This is the conduit use to synchonize ERP5 Products + """ + def __init__(self): + # Define the object_tag element to add object + self.xml_object_tag = 'resource' + self.system_pref = None + + + def _createContent(self, xml=None, object=None, object_id=None, + sub_object=None, reset_local_roles=0, reset_workflow=0, simulate=0, + **kw): + """ + This is the method calling to create an object + """ + if object_id is not None: + if sub_object is None: + sub_object = object._getOb(object_id, None) + if sub_object is None: # If so, it does not exist + portal_type = '' + portal_type = self.getObjectType(xml) + # Create a product object + sub_object, reset_local_roles, reset_workflow = self.constructContent( + object, + object_id, + portal_type, + ) + # The initialization here is used to define our own base category, we + # don't want to use the default base categories + sub_object.edit( + variation_base_category_list = [], + optional_variation_base_category_list = [], + individual_variation_base_category = [], + ) + # if exist namespace retrieve only the tag + index = 0 + if xml.nsmap not in [None, {}]: + index = -1 + + # Set the use value + sub_object.setUse('sale') + portal = object.getPortalObject() + # Browse the list to work on categories + for node in xml.getchildren(): + + # Only works on right tags, and no on the comments, ... + if type(node.tag) is not str: + continue + # Build the split list of the tag + split_tag = node.tag.split('}') + # Build the tag (without is Namespace) + tag = node.tag.split('}')[index] + # Treat sub-element + if tag == 'category': + category_xml_value = node.text.encode('utf-8') + category_split_list = category_xml_value.split('/') + base_category = category_split_list[0] + shared_variation = True + try: + # Try to access the category + category = portal.portal_categories.restrictedTraverse(category_xml_value) + except KeyError: + # This is an individual variation + shared_variation = False + + if shared_variation: + if base_category not in sub_object._baseGetVariationBaseCategoryList(): + base_category_list = sub_object._baseGetVariationBaseCategoryList() + base_category_list.append(base_category) + sub_object.setVariationBaseCategoryList(base_category_list) + self.updateSystemPreference(portal, base_category) + + variation_list = sub_object.getVariationCategoryList() + if category_xml_value not in variation_list: + variation_list.append(category_xml_value) + sub_object.setVariationCategoryList(variation_list) + else: + if base_category not in sub_object.getIndividualVariationBaseCategoryList(): + base_category_list = sub_object.getIndividualVariationBaseCategoryList() + base_category_list.append(base_category) + sub_object.setIndividualVariationBaseCategoryList(base_category_list) + self.updateSystemPreference(portal, base_category, True) + + variation_category = "/".join(category_split_list[1:]) + sub_object.newContent( + portal_type='Product Individual Variation', + title=variation_category, + variation_base_category=base_category, + ) + + self.newObject( + object=sub_object, + xml=xml, + simulate=simulate, + reset_local_roles=reset_local_roles, + reset_workflow=reset_workflow, + ) + + + # add to sale supply + sync_name = self.getIntegrationSite(kw['domain']).getTitle() + ss = self.getSaleSupply(sync_name, portal) + if len(ss.searchFolder(resource_title=sub_object.getTitle())) == 0: + ss.newContent(resource_value=sub_object) + + return sub_object + + def getSaleSupply(self, name, portal): + """ + Retrieve the sale supply for the given synchronization + If not exist, create it + """ + if getattr(self, 'sale_supply', None) is None: + ss_list = portal.sale_supply_module.searchFolder(title=name, + validation_state='validated') + if len(ss_list) > 1: + raise ValueError, "Too many sale supplies, does not know which to choose" + if len(ss_list) == 0: + # Create a new one + ss = portal.sale_supply_module.newContent(title=name) + ss.validate() + else: + ss = ss_list[0].getObject() + self.sale_supply = ss + return self.sale_supply + + def updateSystemPreference(self, portal, base_category, individual=False): + """ Update the system preference according to categories set on products + so that UI is well configured in the end """ + if not self.system_pref: + pref_list = portal.portal_preferences.searchFolder(portal_type="System Preference", + validation_state="enabled") + if len(pref_list) > 1: + raise ValueError, "Too many system preferences, does not know which to choose" + elif len(pref_list) == 0: + pref = portal.portal_preferences.newContent(portal_type="System Preference", + title="default system preference for TioSafe", + priority=1) + pref.enable() + else: + pref = pref_list[0].getObject() + self.system_pref = pref + + if individual: + cat_list = self.system_pref.getPreferredProductIndividualVariationBaseCategoryList() + if base_category not in cat_list: + cat_list.append(base_category) + self.system_pref.edit(preferred_product_individual_variation_base_category_list = cat_list) + else: + cat_list = self.system_pref.getPreferredProductVariationBaseCategoryList() + if base_category not in cat_list: + cat_list.append(base_category) + self.system_pref.edit(preferred_product_variation_base_category_list = cat_list) + + def afterNewObject(self, object): + object.validate() + object.updateLocalRolesOnSecurityGroups() + + + def _deleteContent(self, object=None, object_id=None): + """ Move the product into "invalidated" state. """ + document = object.product_module._getOb(object_id) + # dict which provides the list of transition to move into invalidated state + states_list_dict = { + 'draft': ['validated_action', 'invalidate_action', ], + 'validated': ['invalidate_action', ], + } + # move into the "invalidated" state + current_state = document.getValidationState() + if current_state in states_list_dict: + for action in states_list_dict[current_state]: + try: + document.portal_workflow.doActionFor(document, action) + except WorkflowException: + if current_state == 'draft': + document.activate().validate() + document.activate().invalidate() + + + def editDocument(self, object=None, **kw): + """ + This is the editDocument method inherit of ERP5Conduit. This method + is used to save the information of a Product. + """ + # Map the XML tags to the PropertySheet + mapping = { + 'title': 'title', + 'reference': 'reference', + 'ean13': 'ean13_code', + 'description': 'description', + } + # Translate kw with the PropertySheet + property = {} + for k, v in kw.items(): + k = mapping.get(k, k) + property[k] = v + object._edit(**property) + + + def _updateXupdateUpdate(self, document=None, xml=None, previous_xml=None, **kw): + """ + This method is called in updateNode and allows to work on the update of + elements. + """ + conflict_list = [] + xpath_expression = xml.get('select') + tag = xpath_expression.split('/')[-1] + new_value = xml.text + keyword = {} + + # retrieve the previous xml etree through xpath + previous_xml = previous_xml.xpath(xpath_expression) + try: + previous_value = previous_xml[0].text + except IndexError: + raise IndexError, 'Too little or too many value, only one is required for %s' % ( + previous_xml, + ) + + if isinstance(previous_value, unicode): + previous_value = previous_value.encode('utf-8') + + if isinstance(new_value, unicode): + new_value = new_value.encode('utf-8') + + # check if it'a work on product or on categories + if tag.split('[')[0] == 'category': + # init base category, variation and boolean which check update + base_category, variation = new_value.split('/', 1) + old_base_category, old_variation = previous_value.split('/', 1) + # retrieve the base_categories and the variations + base_category_list = document.getVariationBaseCategoryList() + variation_list = document.getVariationCategoryList() + + # about shared and individual variations, it's necessary to check the + # mapping existency + shared_variation = True + try: + # Try to access the category + category = document.getPortalObject().portal_categories.restrictedTraverse(new_value) + except KeyError: + # This is an individual variation + shared_variation = False + + # the mapping of an element must only be defined one time + individual_variation = document.searchFolder( + portal_type='Product Individual Variation', + title=old_variation, + base_category=old_base_category, + ) + # If this is badly defined, fix the objects + if len(individual_variation) > 1: + id_to_remove = [] + for individual in individual_variation[1:]: + id_to_remove.append(individual.getId()) + document.manage_delObjects(id_to_remove) + if len(individual_variation) and previous_value in variation_list: + for individual in individual_variation: + id_to_remove.append(individual.getId()) + document.manage_delObjects(id_to_remove) + + # Update variation + if not shared_variation: + # work on the cases : + # new = individual variation + # old = individual variation -> update + # old = shared variation -> remoce shared and add individual + + # Fist check individual base + if base_category not in document.getIndividualVariationBaseCategoryList(): + base_category_list = document.getIndividualVariationBaseCategoryList() + base_category_list.append(base_category) + document.setIndividualVariationBaseCategoryList(base_category_list) + self.updateSystemPreference(document.getPortalObject(), base_category, True) + + # Then update or add variation + if len(individual_variation): + individual_variation = individual_variation[0].getObject() + individual_variation.setTitle(variation) + individual_variation.setVariationBaseCategory(base_category) + else: + # create the individual variation + document.newContent( + portal_type='Product Individual Variation', + title=variation, + base_category=base_category, + ) + else: + # work on the cases : + # new = shared variation + # old = individual variation -> remove individual and add shared + # old = shared variation -> update shared + if len(individual_variation): + # remove individual if previous was that + document.manage_delObjects([individual_variation[0].getId(), ]) + else: + # remove the shared from the list if it's a shared + variation_list.remove(previous_value) + + # set the base category and the variations + if base_category not in document._baseGetVariationBaseCategoryList(): + base_category_list = document._baseGetVariationBaseCategoryList() + base_category_list.append(base_category) + document.setVariationBaseCategoryList(base_category_list) + self.updateSystemPreference(document.getPortalObject(), base_category) + + if new_value not in variation_list: + variation_list.append(new_value) + document.setVariationCategoryList(variation_list) + else: + # getter used to retrieve the current values and to check conflicts + getter_value_dict = { + 'title': document.getTitle(), + 'reference': document.getReference(), + 'ean13': document.getEan13Code(), + 'description': document.getDescription(), + } + + # create and fill a conflict when the integration site value, the erp5 + # value and the previous value are differents + current_value = getter_value_dict[tag] + if isinstance(current_value, float): + current_value = '%.6f' % current_value + if isinstance(current_value, unicode): + current_value = current_value.encode('utf-8') + if current_value not in [new_value, previous_value]: + conflict = Conflict( + object_path=document.getPhysicalPath(), + keyword=tag, + ) + conflict.setXupdate(etree.tostring(xml, encoding='utf-8')) + conflict.setLocalValue(current_value) + conflict.setRemoteValue(new_value) + conflict_list.append(conflict) + else: + keyword[tag] = new_value + self.editDocument(object=document, **keyword) + + return conflict_list + + + def _updateXupdateDel(self, document=None, xml=None, previous_xml=None, **kw): + """ This method is called in updateNode and allows to remove elements. """ + conflict_list = [] + tag = xml.get('select').split('/')[-1] + keyword = {} + + if tag.split('[')[0] == 'category': + # retrieve the previous xml etree through xpath + previous_xml = previous_xml.xpath(tag) + try: + previous_value = previous_xml[0].text + except IndexError: + raise IndexError, 'Too little or too many value, only one is required for %s' % ( + previous_xml + ) + + # boolean which check update + updated = False + # check first in shared variations + shared_variation_list = document.getVariationCategoryList() + if previous_value in shared_variation_list: + updated = True + shared_variation_list.remove(previous_value) + document.setVariationCategoryList(shared_variation_list) + # if no update has occured, check in individual variations + if not updated: + individual_variation = document.portal_catalog( + portal_type='Product Individual Variation', + title=previous_value.split('/', 1)[-1], + parent_uid=document.getUid(), + ) + if len(individual_variation) == 1: + individual_variation = individual_variation[0].getObject() + document.manage_delObjects([individual_variation.getId(), ]) + else: + keyword[tag] = None + self.editDocument(object=document, **keyword) + return conflict_list + + + def _updateXupdateInsertOrAdd(self, document=None, xml=None, previous_xml=None, **kw): + """ This method is called in updateNode and allows to add elements. """ + conflict_list = [] + keyword = {} + + # browse subnode of the insert and check what will be create + for subnode in xml.getchildren(): + new_tag = subnode.attrib['name'] + new_value = subnode.text + if new_tag == 'category': + # init base category, variation and boolean which check update + base_category, variation = new_value.split('/', 1) + updated = False + + # check first in shared variations + shared_variation_list = document.getVariationCategoryList() + if new_value not in shared_variation_list: + # set variation if it's an existing shared variation, else + # it's an individual + base_category_object = document.portal_categories[base_category] + if getattr(base_category_object, variation, None) is not None: + updated = True + shared_variation_list.append(new_value) + document.setVariationCategoryList(shared_variation_list) + # if no update has occured, check in individual variations + if not updated and \ + new_value not in document.getVariationCategoryList(): + # individual variation list filtered on base_category + individual_variation = [individual + for individual in document.contentValues( + portal_type='Product Individual Variation', + ) + if individual.getTitle() == variation and \ + individual.getVariationBaseCategoryList() == \ + [base_category, ] + ] + if not individual_variation: # empty list + new_variation = document.newContent( + portal_type='Product Individual Variation', + title=variation, + ) + new_variation.setVariationBaseCategoryList([base_category, ]) + else: + keyword[new_tag] = new_value + self.editDocument(object=document, **keyword) + return conflict_list + diff --git a/product/ERP5TioSafe/Conduit/ERP5TransactionConduit.py b/product/ERP5TioSafe/Conduit/ERP5TransactionConduit.py new file mode 100644 index 0000000000000000000000000000000000000000..49e2ee47135c833fea4bb783f8b19f9836aa0a89 --- /dev/null +++ b/product/ERP5TioSafe/Conduit/ERP5TransactionConduit.py @@ -0,0 +1,366 @@ +############################################################################## +# +# Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved. +# Hervé Poulain <herve@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +from Products.ERP5TioSafe.Conduit.TioSafeBaseConduit import TioSafeBaseConduit +from Products.ERP5SyncML.SyncMLConstant import XUPDATE_INSERT_OR_ADD_LIST +from base64 import b16encode +from zLOG import LOG +from copy import deepcopy + +class ERP5TransactionConduit(TioSafeBaseConduit): + """ + This is the conduit use to synchonize tiosafe sale orders and ERP5 + """ + def __init__(self): + # Define the object_tag element to add object + self.xml_object_tag = 'transaction' + + + def updateNode(self, xml=None, object=None, previous_xml=None, force=0, + simulate=0, **kw): + raise Exception('updateNode: Impossible to update transaction') + + + def deleteNode(self, xml=None, object=None, previous_xml=None, force=0, + simulate=0, **kw): + raise Exception('deleteNode: Impossible to delete transaction') + + + def _createContent(self, xml=None, object=None, object_id=None, sub_object=None, + reset_local_roles=0, reset_workflow=0, simulate=0, **kw): + """ + This is the method calling to create an object + """ + if object_id is None: + object_id = self.getAttribute(xml, 'id') + if object_id is not None: + if sub_object is None: + try: + sub_object = object._getOb(object_id) + except (AttributeError, KeyError, TypeError): + sub_object = None + if sub_object is None: # If so, it doesn't exist + portal_type = '' + if xml.xpath('local-name()') == self.xml_object_tag: + portal_type = self.getObjectType(xml) + elif xml.xpath('name()') in XUPDATE_INSERT_OR_ADD_LIST: # Deprecated ??? + portal_type = self.getXupdateContentType(xml) # Deprecated ??? + sub_object, reset_local_roles, reset_workflow = self.constructContent( + object, + object_id, + portal_type, + ) + + # Define the trade condition by using the one defined on IS + integration_site = self.getIntegrationSite(kw.get('domain')) + if portal_type == "Sale Order": + sub_object.setSpecialise(integration_site.getSourceTrade()) + sub_object.SaleOrder_applySaleTradeCondition() + # Mapping between tag and element + node_dict = { + 'arrow': self.visitArrow, + 'movement': self.visitMovement, + } + # if exist namespace retrieve only the tag + index = 0 + if xml.nsmap not in [None, {}]: + index = -1 + + # Browse the list of arrows and movements + for node in xml.getchildren(): + # Only works on right tags, and no on the comments, ... + if type(node.tag) is not str: + continue + # Build the slipt list of a tag to test + split_tag = node.tag.split('}') + # Build the tag (without is Namespace) + tag = node.tag.split('}')[index] + # Treat sub-element + if len(node.getchildren()): + if tag in node_dict: + node_dict[tag](document=sub_object, xml=node, **kw) + else: + raise ValueError, "This is an unknown sub-element %s on %s" %(tag, sub_object.getPath()) + if tag == 'currency': + link_object = object.portal_catalog.getResultValue( + portal_type='Currency', + reference=node.text.encode('utf-8'), + ) + sub_object.setPriceCurrencyValue(link_object) + elif tag in ['start_date', 'stop_date']: + if not node.text: + node.text = None + elif tag == "payment_mode": + sub_object.setPaymentConditionPaymentMode(node.text) + + # Build the content of new Sale Order + self.newObject( + object=sub_object, + xml=xml, + simulate=simulate, + reset_local_roles=reset_local_roles, + reset_workflow=reset_workflow, + ) + return sub_object + + + def afterNewObject(self, object): + """ Confirm the sale order and, add the grants on this one. """ + if object.getPortalType() in ['Sale Order',]: + object.confirm() + object.updateLocalRolesOnSecurityGroups() + + + def visitArrow(self, document=None, xml=None, **kw): + """ Manage the addition of sources and destination in the Sale Orders. """ + # if exist namespace retrieve only the tag + index = 0 + if xml.nsmap not in [None, {}]: + index = -1 + + # retrieve the integration site + domain = kw.get('domain') + integration_site = self.getIntegrationSite(domain +) + # use the setters of source and destination in terms of the category + sync_object_list = self.getSynchronizationObjectListForType(kw.get('domain'), 'Person', 'publication') + \ + self.getSynchronizationObjectListForType(kw.get('domain'), 'Organisation', 'publication') + category = xml.get('type') + if category != "": + if category == 'Ownership': + arrow_dict = { + 'source': { + 'synchronization': sync_object_list, + 'setter': document.setSourceSectionValue}, + 'destination': { + 'synchronization': sync_object_list, + 'setter': document.setDestinationSectionValue}, + } + elif category == 'Payment': + arrow_dict = { + 'source': { + 'synchronization': sync_object_list, + 'setter': document.setSourcePaymentValue}, + 'destination': { + 'synchronization': sync_object_list, + 'setter': document.setDestinationPaymentValue}, + } + elif category == 'Administration': + arrow_dict = { + 'source': { + 'synchronization': sync_object_list, + 'setter': document.setSourceAdministrationValue}, + 'destination': { + 'synchronization': sync_object_list, + 'setter': document.setDestinationAdministrationValue}, + } + elif category == 'Decision': + arrow_dict = { + 'source': { + 'synchronization': sync_object_list, + 'setter': document.setSourceDecisionValue}, + 'destination': { + 'synchronization': sync_object_list, + 'setter': document.setDestinationDecisionValue}, + } + else: + raise Exception('visitArrow: Unexpected Category %s' %(category)) + else: + arrow_dict = { + 'source': { + 'synchronization': sync_object_list, + 'setter': document.setSourceValue}, + 'destination': { + 'synchronization': sync_object_list, + 'setter': document.setDestinationValue}, + } + + # browse the xml and save the source and destination in the sale order + integration_site = self.getIntegrationSite(kw.get('domain')) + default_source = integration_site.getSourceAdministrationValue() + default_org_gid = " %s %s" %(default_source.getTitle(), default_source.getDefaultEmailText()) + + for subnode in xml.getchildren(): + # only works on tags, no on the comments or other kind of tag + if type(subnode.tag) is not str: + continue + tag = subnode.tag.split('}')[index] + + if tag in arrow_dict: + # retrieve the corresponding + synchronization_list = arrow_dict[tag]['synchronization'] + link_object = None + link_gid = subnode.text.encode('utf-8') + for synchronization in synchronization_list: + # encode to the output type + if getattr(synchronization, 'getObjectFromGid', None) is not None: + link_object = synchronization.getObjectFromGid(b16encode(link_gid)) + #LOG("trying to get %s from %s, got %s" %(link_gid, synchronization.getPath(), link_object), 300, "This is for category type %s" %(category)) + if link_object is not None: + break + + # default organisation + # XXX-Aurel : must be changed on default organisation defined well + if link_object is None and link_gid == default_org_gid: + link_object = default_source + + # unknown person if the link object is none + if link_object is None: + link_object = document.person_module['404'] + + # set person to the sale order + arrow_dict[tag]['setter'](link_object) + + + def visitMovement(self, document=None, xml=None, **kw): + """ Manage the addition of the Sale Order Line. """ + + # dictionary of the value of a movement + movement_dict_value = {'category': []} + + # marker for checking property existency + MARKER = object() + + # if exist namespace retrieve only the tag + index = 0 + if xml.nsmap not in [None, {}]: + index = -1 + + # browse the xml and save the sale order line values + for subnode in xml.getchildren(): + # only works on tags, no on the comments or other kind of tag + if type(subnode.tag) is not str: + continue + tag = subnode.tag.split('}')[index] + if tag == 'resource': + synchronization_list = self.getSynchronizationObjectListForType(kw.get('domain'), 'Product', 'publication') + # encode to the output type + link_gid = subnode.text #.encode('utf-8') + # FIXME: Work on specific GID, what about this ??? + integration_site = self.getIntegrationSite(kw.get('domain')) + if link_gid == ' Service Discount': + link_object = integration_site.getSourceCarrierValue() + elif link_gid == ' Service Delivery': + link_object = integration_site.getDestinationCarrierValue() + else: + for synchronization in synchronization_list: + link_object = synchronization.getObjectFromGid(b16encode(link_gid)) + if link_object is not None: + break + # in the worse case save the line with the unknown product + if link_object is None: + link_object = document.product_module['404'] + # set the resource in the dict + movement_dict_value[tag] = link_object + elif tag == "VAT": + vat_category = document.portal_categories.base_amount.trade.base.taxable['vat'] + vat = vat_category[subnode.text] + movement_dict_value['vat'] = vat + elif tag == 'category': + # set categories in the list + if subnode.text is not None: + movement_dict_value[tag].append(subnode.text) + else: + # set line values in the dict + if subnode.text is not None: + movement_dict_value[tag] = subnode.text#.encode('utf-8') + + if 'quantity' not in movement_dict_value: + return + + # no variations will be use for the unknown product + if document.product_module.get('404', None) and movement_dict_value['resource'] == document.product_module['404']: + movement_dict_value['category'] = [] + + # Create the new Sale Order Line + sale_order_line = document.newContent(portal_type='Sale Order Line') + + # define the setters of the sale order line + mapping_of_setter = { + 'title': sale_order_line.setTitle, + 'reference': sale_order_line.setReference, + 'resource': sale_order_line.setResourceValue, + 'description': sale_order_line.setDescription, + 'vat': sale_order_line.setBaseContributionValue, + 'quantity': sale_order_line.setQuantity, + 'price': sale_order_line.setPrice, + } + + # second, specific work on sale order line or on cell + if len(movement_dict_value['category']): + # set the resource on the sale order line + mapping_of_setter['resource'](movement_dict_value['resource']) + # work on variations + variation_category_list = list(set( + deepcopy(movement_dict_value['category']) + )) + #variation_category_list.sort() # XXX: The set remove the order + sale_order_line.setVariationCategoryList(variation_category_list) + variation_category_list = sale_order_line.getVariationCategoryList() + # create the cell or raise if it's not possible + cell = sale_order_line.newCell( + base_id='movement', + portal_type='Sale Order Cell', + *variation_category_list + ) + + # set values on the cell + cell.setCategoryList(variation_category_list) + cell.setMembershipCriterionCategoryList(variation_category_list) + cell.setMembershipCriterionBaseCategoryList( + sale_order_line.getVariationBaseCategoryList(), + ) + cell.setMappedValuePropertyList(['price', 'quantity']) + mapping_of_setter['quantity'] = cell.setQuantity + mapping_of_setter['price'] = cell.setPrice + + # set on the sale order line or on cell the values + for key in movement_dict_value: + if key in mapping_of_setter: + mapping_of_setter[key](movement_dict_value[key]) + + + def editDocument(self, object=None, **kw): + """ + This is the default editDocument method. This method + can easily be overwritten. + """ + # Mapping of the PropertySheet + mapping = { + 'title': 'title', + 'start_date': 'start_date', + 'stop_date': 'stop_date', + 'reference': 'reference', + 'causality': 'comment', + } + property = {} + # Translate kw with the good PropertySheet + for k, v in kw.items(): + k = mapping.get(k, k) + property[k] = v + object._edit(**property) diff --git a/product/ERP5TioSafe/Conduit/TioSafeBaseConduit.py b/product/ERP5TioSafe/Conduit/TioSafeBaseConduit.py new file mode 100644 index 0000000000000000000000000000000000000000..7ae570ab3738c94ca4b155f944f3c300198e5621 --- /dev/null +++ b/product/ERP5TioSafe/Conduit/TioSafeBaseConduit.py @@ -0,0 +1,256 @@ +############################################################################## +# +# Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved. +# Aurelien Calonne <aurel@nexedi.com> +# Hervé Poulain <herve@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +from Products.ERP5SyncML.SyncMLConstant import XUPDATE_INSERT_OR_ADD_LIST, \ + XUPDATE_DEL, XUPDATE_UPDATE +from Products.ERP5Type.XMLExportImport import MARSHALLER_NAMESPACE_URI +from zLOG import LOG, INFO, WARNING +from Products.ERP5SyncML.Conduit.ERP5Conduit import ERP5Conduit +from lxml import etree +from copy import deepcopy +from Products.ERP5SyncML.Document.Conflict import Conflict +parser = etree.XMLParser(remove_blank_text=True) + +XUPDATE_INSERT_LIST = ('xupdate:insert-after', 'xupdate:insert-before') + +ADDRESS_TAG_LIST = ('street', 'zip', 'city', 'country') + +class TioSafeBaseConduit(ERP5Conduit): + """ + This class provides some tools used by different TioSafe Conduits. + """ + + def _generateConflict(self, path, tag, xml, current_value, new_value): + """ + Generate the conflict object + """ + conflict = Conflict( + object_path=path, + keyword=tag, + ) + conflict.setXupdate(etree.tostring(xml, encoding='utf-8')) + conflict.setLocalValue(current_value) + conflict.setRemoteValue(new_value) + return conflict + + def addNode(self, xml=None, object=None, sub_object=None, reset=None, + simulate=None, **kw): + """ + A node is added + + xml : the xml wich contains what we want to add + + object : from where we want to add something + + previous_xml : the previous xml of the object, if any + + force : apply updates even if there's a conflict + + This fucntion returns conflict_list, wich is of the form, + [conflict1,conflict2,...] where conclict1 is of the form : + [object.getPath(),keyword,local_and_actual_value,subscriber_value] + """ + conflict_list = [] + xml = self.convertToXml(xml) + LOG('TioSafeBaseConduit.addNode', INFO, 'object path:%r' %(object.getPath(),)) + LOG('TioSafeBaseConduit.addNode', INFO, '\n%s' % etree.tostring(xml, pretty_print=True)) + if xml is None: + return {'conflict_list': conflict_list, 'object': sub_object} + # In the case where this new node is a object to add + xpath_expression = xml.get('select') + if xml.xpath('name()') in XUPDATE_INSERT_OR_ADD_LIST and\ + MARSHALLER_NAMESPACE_URI not in xml.nsmap.values(): + # change the context according select expression + get_target_parent = xml.xpath('name()') in XUPDATE_INSERT_LIST + context = self.getContextFromXpath(object, xpath_expression, + get_target_parent=get_target_parent) + for element in xml.findall('{%s}element' % xml.nsmap['xupdate']): + xml = self.getElementFromXupdate(element) + conflict_list += self.addNode(xml=xml, object=context, **kw)\ + ['conflict_list'] + elif xml.xpath('local-name()') == self.xml_object_tag: + sub_object = self._createContent(xml=xml, + object=object, + sub_object=sub_object, + reset=reset, + simulate=simulate, + **kw) + else: + conflict_list += self.updateNode(xml=xml, object=object, reset=reset, + simulate=simulate, **kw) + # We must returns the object created + return {'conflict_list':conflict_list, 'object': sub_object} + + def replaceIdFromXML(self, xml, attribute_name, new_id, as_string=True): + """ + return a xml with id replace by a new id + """ + if isinstance(xml, str): + xml = etree.XML(xml, parser=parser) + else: + xml = deepcopy(xml) + if as_string: + return etree.tostring(xml) + return xml + + def applyXupdate(self, object=None, xupdate=None, previous_xml=None, **kw): + """ Parse the xupdate and then it will call the conduit. """ + conflict_list = [] + if isinstance(xupdate, (str, unicode)): + xupdate = etree.XML(xupdate, parser=parser) + if kw.get('conduit', None) is not None: + for subnode in xupdate: + conflict_list += self.updateNode( + xml=self.getContextFromXpath(subnode, subnode.get('select')), + object=object, + previous_xml=previous_xml, + **kw + ) + return conflict_list + + def getIntegrationSite(self, sync_object): + """ + Return the integration site based on the link with the pub/sub + """ + if getattr(self, 'integration_site', None) is None: + related_object_list = [x.getObject() for x in sync_object.Base_getRelatedObjectList()] + if len(related_object_list) != 1: + raise ValueError, "Impossible to find related object to %s : %s" %(sync_object.getPath(), related_object_list) + integration_site = related_object_list[0].getParentValue() + if integration_site.getPortalType() != "Integration Site": + raise ValueError, "Did not get an Integration Site object instead %s : %s" %(integration_site.getPortalType(), + integration_site.getPath()) + self.integration_site = integration_site + return self.integration_site + + def getSynchronizationObjectListForType(self, sync_object, object_type, synchronization_type): + """ + This method provides a Publication or Subscription base on the relation + set in integration site + """ + site = self.getIntegrationSite(sync_object) + module_id = "%s_module" %(object_type.lower()) + module_list = [] + for module in site.contentValues(portal_type="Integration Module"): + if module_id in module.getId(): + module_list.append(module) + + result_list = [] + for module in module_list: + if synchronization_type == "publication": + result_list.append(module.getSourceSectionValue()) + elif synchronization_type == "subscription": + result_list.append(module.getDestinationSectionValue()) + else: + raise ValueError, 'Unknown type %s' %(synchronization_type,) + + return result_list + + def updateNode(self, xml=None, object=None, previous_xml=None, force=False, + simulate=False, reset=False, xpath_expression=None, **kw): + """ + This method browse the xml which allows to update data and update the + correpsonging object. + """ + conflict_list = [] + if simulate: + return conflict_list + if xml is None: + return {'conflict_list': conflict_list, 'object': object} + xml = self.convertToXml(xml) + # we have an xupdate xml + if xml.xpath('name()') == 'xupdate:modifications': + conflict_list += self.applyXupdate( + object=object, + xupdate=xml, + conduit=self, + previous_xml=previous_xml, + force=force, + simulate=simulate, + reset=reset, + **kw + ) + # we may have only the part of an xupdate + else: + # previous_xml is required as an etree type + if type(previous_xml) == str: + previous_xml = etree.XML(previous_xml, parser=parser) + + if self.isProperty(xml): + xpath = xml.xpath('name()') + # XUPDATE_UPDATE -> update data or sub-object + if xpath in XUPDATE_UPDATE: + conflict_list += self._updateXupdateUpdate( + document=object, + xml=xml, + previous_xml=previous_xml, + **kw + ) + # XUPDATE_DEL -> delete data or sub-object + elif xpath in XUPDATE_DEL: + conflict_list += self._updateXupdateDel( + document=object, + xml=xml, + previous_xml=previous_xml, + **kw + ) + # XUPDATE_INSERT_OR_ADD_LIST -> add data or sub-object + elif xpath in XUPDATE_INSERT_OR_ADD_LIST: + conflict_list += self._updateXupdateInsertOrAdd( + document=object, + xml=xml, + previous_xml=previous_xml, + **kw + ) + return conflict_list + + def _updateXupdateUpdate(self, document=None, xml=None, previous_xml=None, **kw): + """ + This method is called in updateNode and allows to work on the update of + elements. + """ + return [] + + def _updateXupdateDel(self, document=None, xml=None, previous_xml=None, **kw): + """ This method is called in updateNode and allows to remove elements. """ + return [] + + def _updateXupdateInsertOrAdd(self, document=None, xml=None, previous_xml=None, **kw): + """ This method is called in updateNode and allows to add elements. """ + return [] + + def getObjectType(self, xml): + """ Return the portal type from the xml. """ + try: + return xml.attrib['type'].split('/')[-1] + except KeyError: + LOG("TioSafeBaseConduit.getObjectType", WARNING, "No type attribute for the xml : %s" % ( + etree.tostring(xml,pretty_print=True),)) + return + diff --git a/product/ERP5TioSafe/Conduit/TioSafeNodeConduit.py b/product/ERP5TioSafe/Conduit/TioSafeNodeConduit.py new file mode 100644 index 0000000000000000000000000000000000000000..743692155a5796b9a273a61eec3d6dc5b73d136c --- /dev/null +++ b/product/ERP5TioSafe/Conduit/TioSafeNodeConduit.py @@ -0,0 +1,375 @@ +############################################################################## +# +# Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved. +# Hervé Poulain <herve@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +from Products.ERP5TioSafe.Conduit.TioSafeBaseConduit import TioSafeBaseConduit +from Products.ERP5SyncML.Document.Conflict import Conflict +from lxml import etree + +class TioSafeNodeConduit(TioSafeBaseConduit): + """ + This is the conduit use to synchonize TioSafe Persons + """ + def __init__(self): + self.xml_object_tag = 'node' + + + def _createContent(self, xml=None, object=None, object_id=None, sub_object=None, + reset_local_roles=0, reset_workflow=0, simulate=0, **kw): + # if exist namespace retrieve only the tag + index = 0 + if xml.nsmap not in [None, {}]: + index = -1 + # this dict contains the element to set to the person + keyword = {} + address_list = [] + # browse the xml + for node in xml: + # works on tags, no on comments + if type(node.tag) is not str: + continue + # Retrieve the tag + tag = node.tag.split('}')[index] + if tag == 'address': + # add the address + address_keyword = {} + for subnode in node.getchildren(): + # through the mapping retrieve the country + if subnode.tag.split('{')[index] == 'country': + mapping = object.getMappingFromCategory('region/%s' % subnode.text) + country = mapping.split('/', 1)[-1] + address_keyword[subnode.tag.split('{')[index]] = country + else: + address_keyword[subnode.tag.split('{')[index]] = subnode.text + address_list.append(address_keyword) + else: + # XXX-AUREL : it might be necessary to use .encode('utf-8') here + keyword[tag] = node.text + + # Create person once all xml has bee browsed + object.person_module.createPerson(**keyword) + # XXX-AUREL : following call must be changed + new_id = object.IntegrationSite_lastID(type='Person')[0].getId() + + # Then create addresses + for address_keyword in address_list: + object.person_module.createPersonAddress(person_id=str(new_id), **address_keyword) + + return object.person_module(person_id=new_id)[0] + + + def _deleteContent(self, object=None, object_id=None): + """ We do not delete nodes """ + pass + + + def _updateXupdateUpdate(self, document=None, xml=None, previous_xml=None, **kw): + """ + This method is called in updateNode and allows to work on the update of + elements. + """ + conflict_list = [] + xpath_expression = xml.get('select') + tag = xpath_expression.split('/')[-1] + value = xml.text + + # retrieve the previous xml etree through xpath + previous_xml = previous_xml.xpath(xpath_expression) + try: + previous_value = previous_xml[0].text + except IndexError: + raise IndexError, 'Too little or too many value, only one is required for %s' % ( + previous_xml + ) + + # check if it'a work on person or on address + if tag in ['street', 'zip', 'city', 'country']: + try: + # work on the case: "/node/address[x]" + address_index = \ + int(xpath_expression.split('address[')[-1].split(']')[0]) - 1 + except ValueError: + # Work on the case: "/node/address" + address_index = 0 + + # build the address list + address_list = document.context.person_module.getPersonAddressList( + person_id=document.getId(), + ) + # FIXME: Is the sort can be removed ??? + # Build a list of tuple which contains : + # - first, the title build to realise the sort + # - the second element is the brain itself + sorted_address_list = [ + (' '.join([address.street, + address.zip, + address.city, + address.country]), + address) + for address in address_list] + sorted_address_list.sort() + address_list = [t[1] for t in sorted_address_list] + + try: + address = address_list[address_index] + except IndexError: + # create and fill a conflict when the integration site value, the erp5 + # value and the previous value are differents + conflict = Conflict( + object_path=document.getPhysicalPath(), + keyword=tag, + ) + conflict.setXupdate(etree.tostring(xml, encoding='utf-8')) + conflict.setLocalValue(None) + conflict.setRemoteValue(value) + conflict_list.append(conflict) + return conflict_list + + current_value = getattr(address, tag, None) + if current_value not in [value, previous_value]: + # create and fill a conflict when the integration site value, the erp5 + # value and the previous value are differents + conflict = Conflict( + object_path=document.getPhysicalPath(), + keyword=tag, + ) + conflict.setXupdate(etree.tostring(xml, encoding='utf-8')) + conflict.setLocalValue(current_value) + conflict.setRemoteValue(value) + conflict_list.append(conflict) + else: + # set the keyword dict which defines what will be updated + keyword = { + 'address_id': address.getId(), + 'person_id': document.getId(), + } + if tag == 'country': + # through the mapping retrieve the country + mapping = document.context.getMappingFromCategory('region/%s' % value) + value = mapping.split('/', 1)[-1] + keyword[tag] = value + document.context.person_module.updatePersonAddress(**keyword) + else: + # getter used to retrieve the current values and to check conflicts + property_list = ['birthday', ] + getter_value_dict = dict([ + (prop, getattr(document, prop)) + for prop in property_list + if getattr(document, prop, None) is not None + ]) + + # create and fill a conflict when the integration site value, the erp5 + # value and the previous value are differents + current_value = getter_value_dict[tag] + if current_value not in [value, previous_value]: + conflict = Conflict( + object_path=document.getPhysicalPath(), + keyword=tag, + ) + conflict.setXupdate(etree.tostring(xml, encoding='utf-8')) + conflict.setLocalValue(current_value) + conflict.setRemoteValue(value) + conflict_list.append(conflict) + else: + # XXX: when the DateTime format will be required to sync date + # - 1 - retrieve the format through the integration site + # - 2 - through using of DateTime build the date and render it +# if tag == 'birthday': +# integration_site = self.getIntegrationSite(kw.get('domain')) +# date_format = integration_site.getDateFormat() +# # build the required format +# format = dict_format[date_format] -> render "%Y/%m/%d", ... +# value = DateTime(value).strftime(format) + keyword = {'person_id': document.getId(), tag: value, } + document.context.person_module.updatePerson(**keyword) + + new_document = document.context.person_module[document.getId()] + document.updateProperties(new_document) + return conflict_list + + + def _updateXupdateDel(self, document=None, xml=None, previous_xml=None, **kw): + """ This method is called in updateNode and allows to remove elements. """ + conflict_list = [] + tag = xml.get('select').split('/')[-1] + # this variable is used to retrieve the id of address and to not remove the + # orginal tag (address, street, zip, city or country) + tag_for_id = tag + + # specific work for address and address elements + if tag.split('[')[0] in ['address', 'street', 'zip', 'city', 'country']: + # work on the good part of the xml to retrieve the address id + if tag_for_id.split('[')[0] != 'address': + tag_for_id = xml.get('select') + + try: + # work on the case: "/node/address[x]" + address_index = int(tag_for_id.split('[')[-1].split(']')[0]) - 1 + except ValueError: + # Work on the case: "/node/address" + address_index = 0 + + # build the address list + address_list = document.context.person_module.getPersonAddressList( + person_id=document.getId(), + ) + # FIXME: Is the sort can be removed ??? + # Build a list of tuple which contains : + # - first, the title build to realise the sort + # - the second element is the brain itself + sorted_address_list = [ + (' '.join([ + getattr(address, i, '') + for i in ['street', 'zip', 'city','country']] + ), address) + for address in address_list + ] + sorted_address_list.sort() + address_list = [t[1] for t in sorted_address_list] + + try: + address = address_list[address_index] + except IndexError: + # create and fill a conflict when the integration site value, the erp5 + # value and the previous value are differents + conflict = Conflict( + object_path=document.getPhysicalPath(), + keyword=tag, + ) + conflict.setXupdate(etree.tostring(xml, encoding='utf-8')) + conflict.setLocalValue(None) + conflict_list.append(conflict) + return conflict_list + + # remove the corresponding address or the element of the address + keyword = {'person_id': document.getId(), 'address_id': address.getId()} + if tag.split('[')[0] == 'address': + document.context.person_module.deletePersonAddress(**keyword) + else: + # set the keyword dict which defines what will be updated + keyword[tag] = 'NULL' + document.context.person_module.updatePersonAddress(**keyword) + else: + keyword = {'person_id': document.getId(), tag: 'NULL', } + document.context.person_module.updatePerson(**keyword) + + # it always return conflict_list but it's empty + new_document = document.context.person_module[document.getId()] + document.updateProperties(new_document) + return conflict_list + + + def _updateXupdateInsertOrAdd(self, document=None, xml=None, previous_xml=None, **kw): + """ This method is called in updateNode and allows to add elements. """ + conflict_list = [] + + for subnode in xml.getchildren(): + tag = subnode.attrib['name'] + value = subnode.text + + if tag == 'address': + keyword = {'person_id': document.getId(), } + for subsubnode in subnode.getchildren(): + if subsubnode.tag == 'country': + # through the mapping retrieve the country + keyword[subsubnode.tag] = document.context.getMappingFromCategory( + 'region/%s' % subsubnode.text, + ).split('/', 1)[-1] + else: + keyword[subsubnode.tag] = subsubnode.text + document.context.person_module.createPersonAddress(**keyword) + elif tag in ['street', 'zip', 'city', 'country']: + try: + # work on the case: "/node/address[x]" + address_index = int(xml.get('select').split('address[')[-1].split(']')[0]) - 1 + except ValueError: + # Work on the case: "/node/address" + address_index = 0 + + # build the address list + address_list = document.context.person_module.getPersonAddressList( + person_id=document.getId(), + ) + # FIXME: Is the sort can be removed ??? + # Build a list of tuple which contains : + # - first, the title build to realise the sort + # - the second element is the brain itself + sorted_address_list = [ + (' '.join([ + getattr(address, i, '') + for i in ['street', 'zip', 'city','country']] + ), address) + for address in address_list + ] + sorted_address_list.sort() + address_list = [t[1] for t in sorted_address_list] + + try: + address = address_list[address_index] + except IndexError: + # create and fill a conflict when the integration site value, the erp5 + # value and the previous value are differents + conflict = Conflict( + object_path=document.getPhysicalPath(), + keyword=tag, + ) + conflict.setXupdate(etree.tostring(xml, encoding='utf-8')) + conflict.setLocalValue(None) + conflict.setRemoteValue(value) + conflict_list.append(conflict) + return conflict_list + + # set the keyword dict which defines what will be updated + keyword = { + 'person_id': document.getId(), + 'address_id': address.getId(), + } + if tag == 'country': + # through the mapping retrieve the country + mapping = document.context.getMappingFromCategory('region/%s' % value) + value = mapping.split('/', 1)[-1] + keyword[tag] = value + document.context.person_module.updatePersonAddress(**keyword) + else: + # XXX: when the DateTime format will be required to sync date + # - 1 - retrieve the format through the integration site + # - 2 - through using of DateTime build the date and render it +# if tag == 'birthday': +# integration_site = self.getIntegrationSite(kw.get('domain')) +# date_format = integration_site.getDateFormat() +# # build the required format +# format = dict_format[date_format] -> render "%Y/%m/%d", ... +# value = DateTime(value).strftime(format) + keyword = {'person_id': document.getId(), tag:value, } + document.context.person_module.updatePerson(**keyword) + + + new_document = document.context.person_module[document.getId()] + document.updateProperties(new_document) + return conflict_list + + diff --git a/product/ERP5TioSafe/Conduit/TioSafeResourceConduit.py b/product/ERP5TioSafe/Conduit/TioSafeResourceConduit.py new file mode 100644 index 0000000000000000000000000000000000000000..6c7c5dbadfe3e1d16f4f14aab03a7d5f65a92a0c --- /dev/null +++ b/product/ERP5TioSafe/Conduit/TioSafeResourceConduit.py @@ -0,0 +1,298 @@ +############################################################################## +# +# Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved. +# Hervé Poulain <herve@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +from Products.ERP5Type.Utils import cartesianProduct +from Products.ERP5TioSafe.Conduit.TioSafeBaseConduit import TioSafeBaseConduit +from Products.ERP5SyncML.Document.Conflict import Conflict +from lxml import etree +from zLOG import LOG + +class TioSafeResourceConduit(TioSafeBaseConduit): + """ + This is the conduit use to synchonize TioSafe Resources + """ + def __init__(self): + self.xml_object_tag = 'resource' + + def _createContent(self, xml=None, object=None, object_id=None, sub_object=None, + reset_local_roles=0, reset_workflow=0, simulate=0, **kw): + LOG("TioSafeNodeConduit._createConten", 300, "xml = %s" %(etree.tostring(xml, pretty_print=1),)) + + # if exist namespace retrieve only the tag + index = 0 + if xml.nsmap not in [None, {}]: + index = -1 + # init the new_id of the product and the checker of the creation + new_id = None + product_created = False + # this dict contains the element to set to the product + keyword = {} + # this dict will contains a list of tuple (base_category, vairiation) + variation_dict = {} + + resource_type = self.getObjectType(xml=xml).strip() + + # browse the xml + for node in xml: + # works on tags, not on comments + if type(node.tag) is not str: + continue + tag = node.tag.split('}')[index] + LOG("browsing tag %s, value %s" %(tag, node.text), 300, "keyword = %s" %(keyword,)) + if tag == 'category': + # retrieve through the mapping the base category and the variation + mapping = object.getMappingFromCategory(node.text) + base_category, variation = mapping.split('/', 1) + variation_dict.setdefault(base_category, []).append(variation) + else: + keyword[tag] = node.text.encode('utf-8') + + # Create the product at the end of the xml browsing + create_method_id = "create%s" %(resource_type,) + create_method = getattr(object, create_method_id, None) + if create_method is not None: + create_result = create_method(**keyword) + else: + raise ValueError, 'Impossible to find a create method named %s and object %s' %(create_method_id, object.getPath(),) + if len(create_result): + # We suppose the id of the object created was returned by the plugin + new_id = create_result[0].getId() + else: + # We must ask for the id of the object previously created + # XXX-AUREL : this must be changed to use gid definition instead + new_id = object.IntegrationSite_lastID(type=resource_type)[0].getId() + + # create the full variations in the integration site + if variation_dict: + # XXX-Aurel : This is too specific to prestashop, must be moved and + # replaced by generic code + + # the cartesianProduct requires to build a list of list of variations + builder_variation_list = [] + for key, value in variation_dict.items(): + variation_list = [] + for variation in value: + variation_list.append((key, variation)) + builder_variation_list.append(variation_list) + + # build and browse the list of variations + variation_list = cartesianProduct(builder_variation_list) + for var_list in variation_list: + object.createProductAttribute(id_product=new_id) + id_product_attribute = object.IntegrationSite_lastID( + type='Product Attribute', + )[0].getId() + for variation in var_list: + object.createProductAttributeCombination( + id_product_attribute=id_product_attribute, + id_product=new_id, + base_category=variation[0], + variation=variation[1], + ) + + return object[new_id] + + + def _deleteContent(self, object=None, object_id=None): + """ This method allows to remove a product in the integration site """ + delete_method_id = "deleteProduct" # XXX-AUREL : must find a way to fix this + delete_method = getattr(object, delete_method_id, None) + if delete_method is not None: + return delete_method(product_id=object_id) + else: + raise ValueError, 'Impossible to find a delete method named %s and object %s' %(delete_method_id, object.getPath(),) + + + def _updateXupdateUpdate(self, document=None, xml=None, previous_xml=None, **kw): + """ + This method is called in updateNode and allows to work on the update of + elements. + """ + conflict_list = [] + xpath_expression = xml.get('select') + tag = xpath_expression.split('/')[-1] + integration_site = document.context.getParentValue() + new_value = xml.text + + # retrieve the previous xml etree through xpath + previous_xml = previous_xml.xpath(xpath_expression) + try: + previous_value = previous_xml[0].text + except IndexError: + raise ValueError, 'Too little or too many value, only one is required for %s' % ( + previous_xml + ) + + if isinstance(previous_value, unicode): + previous_value = previous_value.encode('utf-8') + if isinstance(new_value, unicode): + new_value = new_value.encode('utf-8') + + # check if it'a work on product or on categories + if tag.split('[')[0] == 'category': + # call the method which allows to work on a specific part, the update of + # categories + conflict_list += self._updateCategory(document, xml, previous_value) + else: + # getter used to retrieve the current values and to check conflicts + property_list = ['sale_price', 'purchase_price', 'ean13'] + getter_value_dict = dict(zip( + property_list, [ + getattr(document, prop, None) + for prop in property_list + ] + )) + + # create and fill a conflict when the integration site value, the erp5 + # value and the previous value are differents + current_value = getter_value_dict[tag] + if type(current_value) == float: + current_value = '%.6f' % current_value + if isinstance(current_value, unicode): + current_value = current_value.encode('utf-8') + if current_value not in [new_value, previous_value]: + conflict = Conflict( + object_path=document.getPhysicalPath(), + keyword=tag, + ) + conflict.setXupdate(etree.tostring(xml, encoding='utf-8')) + conflict.setLocalValue(current_value) + conflict.setRemoteValue(new_value) + conflict_list.append(conflict) + else: + keyword = {'product_id': document.getId(), tag: new_value , } + document.context.product_module.updateProduct(**keyword) + + new_document = document.context.product_module[document.getId()] + document.updateProperties(new_document) + return conflict_list + + + def _updateXupdateDel(self, document=None, xml=None, previous_xml=None, **kw): + """ This method is called in updateNode and allows to remove elements. """ + conflict_list = [] + tag = xml.get('select').split('/')[-1] + integration_site = document.context.getParentValue() + + if tag.split('[')[0] == 'category': + # retrieve the previous xml etree through xpath + previous_xml = previous_xml.xpath(tag) + try: + previous_value = integration_site.getMappingFromCategory( + previous_xml[0].text, + ) + except IndexError: + raise IndexError, 'Too little or too many value, only one is required for %s' % ( + previous_xml + ) + + # retrieve the current value to check if exists a conflict + current_value = etree.XML(document.asXML()).xpath(tag)[0].text + current_value = integration_site.getMappingFromCategory(current_value) + + + # work on variations + variation_brain_list = document.context.getProductCategoryList() + for brain in variation_brain_list: + if brain.category == current_value and previous_value == current_value: + base_category, variation = current_value.split('/', 1) + document.context.product_module.deleteProductAttributeCombination( + product_id=document.getId(), + base_category=base_category, + variation=variation, + ) + else: + # previous value different from current value + conflict = Conflict( + object_path=document.getPhysicalPath(), + keyword=tag, + ) + conflict.setXupdate(etree.tostring(xml, encoding='utf-8')) + conflict.setLocalValue(previous_value) + conflict.setRemoteValue(current_value) + conflict_list.append(conflict) + else: + keyword = {'product_id': document.getId(), tag: 'NULL' , } + document.context.product_module.updateProduct(**keyword) + + new_document = document.context.product_module[document.getId()] + document.updateProperties(new_document) + return conflict_list + + + def _updateXupdateInsertOrAdd(self, document=None, xml=None, previous_xml=None, **kw): + """ This method is called in updateNode and allows to add elements. """ + conflict_list = [] + integration_site = document.context.getParentValue() + + # browse subnode of the insert and check what will be create + for subnode in xml.getchildren(): + new_tag = subnode.attrib['name'] + new_value = subnode.text + if new_tag == 'category': + mapping = integration_site.getMappingFromCategory(new_value) + base_category, variation = mapping.split('/', 1) + # retrieve the variations which have a different axe from the updated + # and build the cartesian variation for this new variations + external_axe_list = [ + tuple(x.category.split('/', 1)) + for x in document.context.getProductCategoryList() + if x.category.split('/', 1)[0] != base_category + ] + builder_variation_list = [ + [(base_category, variation)], external_axe_list, + ] + variation_list = cartesianProduct(builder_variation_list) + for var_list in variation_list: + document.context.product_module.createProductAttribute( + id_product=document.getId(), + ) + id_product_attribute = document.context.IntegrationSite_lastID( + type='Product Attribute', + )[0].getId() + for variation in var_list: + document.context.product_module.createProductAttributeCombination( + id_product_attribute=id_product_attribute, + id_product=document.getId(), + base_category=variation[0], + variation=variation[1], + ) + else: + keyword = {'product_id': document.getId(), new_tag: new_value, } + document.context.product_module.updateProduct(**keyword) + + new_document = document.context.product_module[document.getId()] + document.updateProperties(new_document) + return conflict_list + + + def _updateCategory(self, document=None, xml=None, previous_value=None): + """ This method allows to update a Category in the Integration Site. """ + conflict_list = [] + return conflict_list + diff --git a/product/ERP5TioSafe/Conduit/__init__.py b/product/ERP5TioSafe/Conduit/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/product/ERP5TioSafe/ConnectionPlugin/HTTPConnection.py b/product/ERP5TioSafe/ConnectionPlugin/HTTPConnection.py new file mode 100644 index 0000000000000000000000000000000000000000..f6cacbbfc8a808335861635739c2a0562f9ce5d4 --- /dev/null +++ b/product/ERP5TioSafe/ConnectionPlugin/HTTPConnection.py @@ -0,0 +1,95 @@ +############################################################################## +# +# Copyright (c) 2010 Nexedi SARL and Contributors. All Rights Reserved. +# Aurelien Calonne <aurel@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +from Products.ERP5Type.Tool.WebServiceTool import ConnectionError +from urllib import urlencode +from urllib2 import URLError, HTTPError, Request, \ + urlopen, HTTPBasicAuthHandler, build_opener, \ + install_opener + + +class MethodWrapper(object): + + def __init__(self, method, conn): + self._method = method + self._conn = conn + + def __call__(self, *args, **kw): + url = "%s/%s" % (self._conn.url, self._method) + data = urlencode(kw) + request = Request(url, data) + try: + response = urlopen(request) + return url, response.read() + except HTTPError, msg: + error = "Impossible to access to the plugin, error code is %s - %s" %(msg.msg, msg.code,) + raise ConnectionError(error) + except URLError, msg: + error = "Impossible to connect to the plugin, reason is %s" %(msg.reason,) + raise ConnectionError(error) + + +class HTTPConnection: + """ + Holds an HTTP connection to a remote HTTP server. + """ + __allow_access_to_unprotected_subobjects__ = 1 + + def __init__(self, url, user_name = None, password = None, credentials = None): + """ + url (string) + The requested url + user_name (string or None) + password (string is None) + The transport-level (http) credentials to use. + credentials (AuthenticationBase subclass instance or None) + The interface-level (http) credentials to use. + """ + self.url = url + self._user_name = user_name + self._password = password + self._credentials = credentials + + def connect(self): + """Get a handle to a remote connection.""" + auth_handler = HTTPBasicAuthHandler() + auth_handler.add_password(realm=self.url, + uri=self.url, + user=self._user_name, + passwd=self._password) + + opener = build_opener(auth_handler) + install_opener(opener) + return self + + def __getattr__(self, name): + if not name.startswith("_"): + return MethodWrapper(name, self) + + + diff --git a/product/ERP5TioSafe/ConnectionPlugin/MagentoXMLRPCConnection.py b/product/ERP5TioSafe/ConnectionPlugin/MagentoXMLRPCConnection.py new file mode 100644 index 0000000000000000000000000000000000000000..b1e217c66d8514234898143449bbc92a1843281e --- /dev/null +++ b/product/ERP5TioSafe/ConnectionPlugin/MagentoXMLRPCConnection.py @@ -0,0 +1,73 @@ +############################################################################## +# +# Copyright (c) 2006 Nexedi SARL and Contributors. All Rights Reserved. +# Ivan Tyagov <ivan@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +from xmlrpclib import Server, Fault +from Products.ERP5Type.Tool.WebServiceTool import ConnectionError + +class MethodWrapper(object): + + def __init__(self, method, conn): + self._method = method + self._conn = conn + + def __call__(self, *args, **kw): + try: + if len(kw): + return self._method, self._conn.server.call(self._conn.session, + self._method, [kw]) + else: + return self._method, self._conn.server.call(self._conn.session, + self._method, [args]) + except Fault, msg: + error = "XMLRPC error, reason is %s : %s" %(msg.faultCode, msg.faultString,) + raise ConnectionError(error) + + + +class MagentoXMLRPCConnection: + """ + Holds an XML-RPC connection to a remote Magento XML-RPC server. + """ + + def __init__(self, url, user_name = None, password = None): + self.url = url + self._user_name = user_name + self._password = password + + def connect(self): + """Get a handle to a remote connection.""" + url = self.url + self.server = Server(url) + if self._user_name is not None and self._password is not None: + self.session = self.server.login(self._user_name, self._password) + return self + + def __getattr__(self, name): + """ Allow to call mehod on connection """ + if not name.startswith("_"): + return MethodWrapper(name, self) diff --git a/product/ERP5TioSafe/ConnectionPlugin/PHPUnitTestConnection.py b/product/ERP5TioSafe/ConnectionPlugin/PHPUnitTestConnection.py new file mode 100644 index 0000000000000000000000000000000000000000..21476d2c6a52d1346e231129d46212cad4c5d656 --- /dev/null +++ b/product/ERP5TioSafe/ConnectionPlugin/PHPUnitTestConnection.py @@ -0,0 +1,48 @@ +import subprocess + +class MethodWrapper(object): + def __init__(self, method, conn): + self._method = method + self._conn = conn + + def __call__(self, *args, **kw): + # build the php args and execute the php script + php_args = '' + for key, value in kw.items(): + php_args += '$_POST["%s"] = "%s";' % (key, value) + php_args += 'include("%s/%s.php");' % (self._conn.url, self._method) + process = subprocess.Popen( + ['php', '-r', php_args, ], + stdout=subprocess.PIPE, + ) + return self._conn.url, process.stdout.read() + +class PHPUnitTestConnection: + """ + This is a unit test connection class which allows to execute a PHP script. + """ + __allow_access_to_unprotected_subobjects__ = 1 + + def __init__(self, url, user_name=None, password=None, credentials=None): + """ + url (string) + The requested url + user_name (string or None) + password (string is None) + The transport-level (http) credentials to use. + credentials (AuthenticationBase subclass instance or None) + The interface-level (http) credentials to use. + """ + self.url = url + self._user_name = user_name + self._password = password + self._credentials = credentials + + def connect(self): + """Get a handle to a remote connection.""" + return self + + def __getattr__(self, name): + if not name.startswith("_"): + return MethodWrapper(name, self) + diff --git a/product/ERP5TioSafe/ConnectionPlugin/RESTConnection.py b/product/ERP5TioSafe/ConnectionPlugin/RESTConnection.py new file mode 100644 index 0000000000000000000000000000000000000000..1d2f7de662ac16ade2ff4a4e3d32be2ab4ba240c --- /dev/null +++ b/product/ERP5TioSafe/ConnectionPlugin/RESTConnection.py @@ -0,0 +1,88 @@ +############################################################################## +# +# Copyright (c) 2010 Nexedi SARL and Contributors. All Rights Reserved. +# Aurelien Calonne <aurel@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## +from urllib import urlencode +from urllib2 import URLError, HTTPError, Request, urlopen +from Products.ERP5Type.Tool.WebServiceTool import ConnectionError + + +class MethodWrapper(object): + + def __init__(self, method, conn): + self._method = method + self._conn = conn + + def __call__(self, *args, **kw): + + data_kw = {'Method' : self._method, + 'Token' : self._conn._password, + 'Data' : kw.get('data')} + request_data = urlencode(data_kw) + request = Request(self._conn.url, request_data) + try: + response = urlopen(request) + return self._conn.url, response.read() + except HTTPError, msg: + error = "Impossible to access to the plugin, error code is %s - %s" %(msg.msg, msg.code,) + raise ConnectionError(error) + except URLError, msg: + error = "Impossible to connect to the plugin, reason is %s" %(msg.reason,) + raise ConnectionError(error) + + + +class RESTConnection: + """ + Holds a REST connection to a remote web server. + """ + __allow_access_to_unprotected_subobjects__ = 1 + + def __init__(self, url, user_name = None, password = None, credentials = None): + """ + url (string) + The requested url + user_name (string or None) + password (string is None) + The transport-level (http) credentials to use. + credentials (AuthenticationBase subclass instance or None) + The interface-level (http) credentials to use. + """ + self.url = url + self._user_name = user_name + self._password = password + self._credentials = credentials + + def connect(self): + """nothing to do here.""" + return self + + def __getattr__(self, name): + if not name.startswith("_"): + return MethodWrapper(name, self) + + + diff --git a/product/ERP5TioSafe/ConnectionPlugin/__init__.py b/product/ERP5TioSafe/ConnectionPlugin/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/product/ERP5TioSafe/Constraint/__init__.py b/product/ERP5TioSafe/Constraint/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/product/ERP5TioSafe/Document/IntegrationMapping.py b/product/ERP5TioSafe/Document/IntegrationMapping.py new file mode 100644 index 0000000000000000000000000000000000000000..dca394e013c6cd39a453590c572dc5b808553e1f --- /dev/null +++ b/product/ERP5TioSafe/Document/IntegrationMapping.py @@ -0,0 +1,49 @@ +############################################################################## +# +# Copyright (c) 2002-2010 Nexedi SA and Contributors. All Rights Reserved. +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsibility of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# guarantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +############################################################################## + +from AccessControl import ClassSecurityInfo +from Products.CMFCore.utils import getToolByName +from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces +from Products.ERP5Type.XMLObject import XMLObject + +class IntegrationMapping(XMLObject): + # CMF Type Definition + meta_type = 'TioSafe Integration Mapping' + portal_type = 'Integration Mapping' + + # Declarative security + security = ClassSecurityInfo() + security.declareObjectProtected(Permissions.AccessContentsInformation) + + # Default Properties + property_sheets = ( PropertySheet.Base + , PropertySheet.XMLObject + , PropertySheet.CategoryCore + , PropertySheet.DublinCore + , PropertySheet.Arrow + , PropertySheet.Reference + ) \ No newline at end of file diff --git a/product/ERP5TioSafe/Document/IntegrationModule.py b/product/ERP5TioSafe/Document/IntegrationModule.py new file mode 100644 index 0000000000000000000000000000000000000000..96b6b12822f89d150d348eb94c65e9f108775a6e --- /dev/null +++ b/product/ERP5TioSafe/Document/IntegrationModule.py @@ -0,0 +1,101 @@ +############################################################################## +# +# Copyright (c) 2002-2010 Nexedi SA and Contributors. All Rights Reserved. +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsibility of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# guarantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +############################################################################## + +from AccessControl import ClassSecurityInfo +from Products.ERP5Type import Permissions, PropertySheet +from Products.ERP5Type.XMLObject import XMLObject +from Products.ERP5TioSafe.Utils import EchoDictTarget +from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate +from App.Extensions import getBrain +from lxml import etree +from zLOG import LOG, ERROR +from urllib2 import URLError, HTTPError + +_MARKER = [] + +class IntegrationModule(XMLObject): + # CMF Type Definition + meta_type = 'TioSafe Integration Module' + portal_type = 'Integration Module' + + # Declarative security + security = ClassSecurityInfo() + security.declareObjectProtected(Permissions.AccessContentsInformation) + + # Default Properties + property_sheets = ( PropertySheet.Base + , PropertySheet.XMLObject + , PropertySheet.CategoryCore + , PropertySheet.DublinCore + , PropertySheet.SortIndex + , PropertySheet.IntegrationModule + , PropertySheet.Arrow + ) + + def checkConsistency(self, fixit=False, filter=None, **kw): + """ + consistency is checked through a web service request + """ + # XXX-Aurel : result must be formatted here + try: + return self['checkDataConsistency']() + except KeyError: + # WSR not present + return [] + + def __call__(self, **kw): + """ + calling this object will call : + - retrieveObject if exists and parameters are pass + - getObjectList in other cases + as method to retrieve list of object can not always be used + to retrieve just one object + """ + if len(kw) and getattr(self, "retrieveObject", None) is not None: + return self.retrieveObject(**kw) + else: + return self.getObjectList(**kw) + + def __getitem__(self, item): + """ + Simulate the traversable behaviour by retrieving the item through + the web service + """ + try: + if getattr(self, "retrieveObject", None) is not None: + return self.retrieveObject[item] + else: + return self.getObjectList[item] + except ValueError, msg: + raise KeyError, msg + + def getGIDFor(self, item): + """ + Return the gid for a given local id + """ + raise NotImplementedError + diff --git a/product/ERP5TioSafe/Document/IntegrationSite.py b/product/ERP5TioSafe/Document/IntegrationSite.py new file mode 100644 index 0000000000000000000000000000000000000000..85987ef64c40fc005ee7c43c20a3876d9423f170 --- /dev/null +++ b/product/ERP5TioSafe/Document/IntegrationSite.py @@ -0,0 +1,197 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved. +# Aurelien Calonne <aurel@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsibility of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# guarantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + + + +from Products.ERP5Type.Core.Folder import Folder +from AccessControl import ClassSecurityInfo +from Products.ERP5Type import Permissions, PropertySheet +from zLOG import LOG, INFO, ERROR, WARNING + + +class IntegrationSite(Folder): + """ + """ + + meta_type = 'ERP5 Integration Site' + portal_type = 'Integration Site' + add_permission = Permissions.AddPortalContent + + # Declarative security + security = ClassSecurityInfo() + security.declareObjectProtected(Permissions.AccessContentsInformation) + + # Declarative properties + property_sheets = ( PropertySheet.Base + , PropertySheet.XMLObject + , PropertySheet.DublinCore + , PropertySheet.SimpleItem + , PropertySheet.CategoryCore + , PropertySheet.Reference + , PropertySheet.Arrow + , PropertySheet.Task + , PropertySheet.DublinCore + ) + + + def getCategoryFromMapping(self, category, product=None, create_mapping=False, + create_mapping_line=False): + """ + This method allows to retrieve the mapping in the integration site. + args: + category = string of the category we want the mapping + product = product object that can hold categories not mapped + create_mapping = boolean telling if we create an empty base mapping object if not found + create_mapping_line = boolean telling if we create an empty mapping line object if not found + return: + mapped_category as string + raise ValueError when not found + """ + if not category: + LOG("getCategoryFromMapping", ERROR, "empty category provided") + raise ValueError, "Empty category provided" + + # Split the category to have the base and the variation category + base_category, variation_category = category.split('/', 1) + + # Check the product variations if exists the product + if product is not None: + for variation in product.contentValues( + portal_type='Product Individual Variation'): + if variation.getTitle() == variation_category: + return '%s/%s' % (variation.getVariationBaseCategory(), + variation.getRelativeUrl(), + ) + + # mapping is defined with ID + # XXX-Aurel : replace should not be done here as title will not be well defined indeed + current_object = self + mapped_base_category = None + mapped_variation_category = [] + missing_mapping = False + for cat in category.split('/'): + cat_id = cat.replace(' ', '').replace('-', '') + try: + cat_object = current_object[cat_id.encode('ascii', 'ignore')] + except KeyError: + #LOG("getCategoryFromMapping", WARNING, "Nothing found for %s , %s on %s" %(category, cat_id, current_object.getPath())) + if current_object.getPortalType() == "Integration Base Category Mapping": + if create_mapping_line is False: + # This is for the case of individual variation for example + # only the base category has to be mapped + return current_object.getDestinationReference() +'/'+ '/'.join(category.split('/')[1:]) + else: + # Create default line that has to be mapped by user later + cat_object = current_object.newContent(id=cat_id.encode('ascii', 'ignore'), source_reference=cat, title=cat) + LOG("getCategoryFromMapping", INFO, "created mapping %s - %s" %(cat, cat_object),) + missing_mapping = True + else: + if create_mapping: + cat_object = current_object.newContent(portal_type="Integration Base Category Mapping", + id=cat_id.encode('ascii', 'ignore'), source_reference=cat, title=cat) + LOG("getCategoryFromMapping", INFO, "created base mapping %s - %s" %(cat, cat_object),) + missing_mapping = True + else: + LOG("getCategoryFromMapping", ERROR, "Mapping object for %s not found" %(cat,)) + raise ValueError, "Mapping object for %s not found" %(cat,) + + mapped_category = cat_object.getDestinationReference() + if mapped_category in ("", None) and cat_object.getPortalType() == "Integration Category Mapping": + LOG("getCategoryFromMapping", ERROR, "Mapping not defined for %s" % (cat,)) + raise ValueError, "Mapping not defined for %s" % cat + if mapped_base_category is None: + mapped_base_category = mapped_category + else: + mapped_variation_category.append(mapped_category) + current_object = cat_object + + +## LOG("getCategoryFromMapping", INFO, "mapped category returned is %s - %s for %s" %(mapped_base_category, +## mapped_variation_category, +## category)) + if missing_mapping: + # We do not want the process to go on if mappings are missing + raise ValueError, "Mapping not defined for %s" % category + return mapped_variation_category[-1] + + def getMappingFromCategory(self, category): + """ + This method allows to retrieve through the mapping in the integration + site the corresponding value in the external site. + args: + category = string of the category we want the mapping + """ + # FIXME: currently they have only two levels, the category integration + # mapping and the category integration mapping line, if more levels are + # provides this script must be updated ! + base_category, variation = category.split('/', 1) + # retrieve the corresponding integration base category mapping + mapping = self.searchFolder( + portal_type='Integration Base Category Mapping', + destination_reference=base_category, + ) + if len(mapping) != 1: + raise IndexError, 'The integration base category mapping %s must be mapped and with only one base_category' % (base_category) + + mapping = mapping[0].getObject() + # retrieve the corresponding category integration mapping + mapping_line = mapping.searchFolder( + portal_type='Integration Category Mapping', + destination_reference=category, + ) + if len(mapping_line) > 1: + raise IndexError, 'The integration category mapping %s must be mapped with only one category' % (variation) + try: + # shared variation + return '/'.join( + [mapping.getSourceReference(), mapping_line[0].getObject().getSourceReference()] + ) + except IndexError: + # individual variation + return '/'.join([mapping.getSourceReference(), variation]) + + def getMappingFromProperty(self, base_mapping, property_name): + """ + This method allows to retrieve throuhh the mapping in the integration + site the corresponding value in the external site. + args: + base_mapping = the base property mapping + property = string of the property we want the mapping + """ + mapping_line = base_mapping.searchFolder(portal_type='Integration Property Mapping', + path = "%s%%" %(base_mapping.getPath()), + destination_reference=property_name, + ) + if len(mapping_line) > 1: + raise IndexError, 'The integration property mapping %s must be mapped with only one category' % (property_name) + elif len(mapping_line) == 0: + return property_name + else: + return mapping_line[0].getObject().getSourceReference() + diff --git a/product/ERP5TioSafe/Document/__init__.py b/product/ERP5TioSafe/Document/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/product/ERP5TioSafe/Extensions/__init__.py b/product/ERP5TioSafe/Extensions/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/product/ERP5TioSafe/Permissions.py b/product/ERP5TioSafe/Permissions.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/product/ERP5TioSafe/PropertySheet/IntegrationModule.py b/product/ERP5TioSafe/PropertySheet/IntegrationModule.py new file mode 100644 index 0000000000000000000000000000000000000000..fab0066a5359ea93edbe6b5d8b2887e174663439 --- /dev/null +++ b/product/ERP5TioSafe/PropertySheet/IntegrationModule.py @@ -0,0 +1,47 @@ +############################################################################## +# +# Copyright (c) 2002-2010 Nexedi SA and Contributors. All Rights Reserved. +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsibility of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# guarantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +############################################################################## + +class IntegrationModule: + """ + Integration Module properties + """ + + _properties = ( + { 'id' : 'gid_prefix', + 'description' : 'prefix added to the gid', + 'type' : 'string', + 'mode' : 'w' }, + { 'id' : 'gid_property', + 'description' : 'object properties used to generate the GID', + 'type' : 'lines', + 'mode' : 'w' }, + + ) + + _categories = ('source_section', 'destination_section') + + diff --git a/product/ERP5TioSafe/PropertySheet/__init__.py b/product/ERP5TioSafe/PropertySheet/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/product/ERP5TioSafe/README.txt b/product/ERP5TioSafe/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/product/ERP5TioSafe/Tool/IntegrationTool.py b/product/ERP5TioSafe/Tool/IntegrationTool.py new file mode 100644 index 0000000000000000000000000000000000000000..7ae13caa446d62ac96f09aebf81c31156d3944a8 --- /dev/null +++ b/product/ERP5TioSafe/Tool/IntegrationTool.py @@ -0,0 +1,28 @@ +from AccessControl import ClassSecurityInfo +from Globals import InitializeClass, DTMLFile +from Products.ERP5 import _dtmldir +from Products.ERP5Type import Permissions +from Products.ERP5Type.Tool.BaseTool import BaseTool + +""" ERP5 portal_integrations tool """ +class IntegrationTool(BaseTool): + """ + The IntegrationTool is used to exchange with the differents external management systems. + """ + + id = 'portal_integrations' + title = 'Integration Tool' + meta_type = 'ERP5 Integration Tool' + portal_type = 'Integration Tool' + allowed_type = () + + # Declarative Security + security = ClassSecurityInfo() + + # ZMI Methods + security.declareProtected(Permissions.ManagePortal, 'manage_overview') + manage_overview = DTMLFile('explainIntegrationTool', _dtmldir) + + +InitializeClass(IntegrationTool) + diff --git a/product/ERP5TioSafe/Tool/__init__.py b/product/ERP5TioSafe/Tool/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/product/ERP5TioSafe/Utils.py b/product/ERP5TioSafe/Utils.py new file mode 100644 index 0000000000000000000000000000000000000000..be0f77006a8c41cde1c7905f6c5a67b33dd312ad --- /dev/null +++ b/product/ERP5TioSafe/Utils.py @@ -0,0 +1,100 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Copyright (c) 2010 Nexedi SARL and Contributors. All Rights Reserved. +# Aurelien Calonne <aurel@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +from zLOG import LOG, ERROR + +class EchoDictTarget: + """ + This is an echo class used by lxml to parse xml data + + See http://codespeak.net/lxml/parsing.html#the-target-parser-interface + + This class takes a dict as init parameter defining how to parse the xml. + + Dict must looks like : + { xml_tag : (wanted_dict_key, is_root_element),...} + + The result of the parsing will thus return a list of dictionnaries. Each time it finds an xml_tag which is a root element will create a new dict. + + This allow to transform an xml string into a property dict wich can be used to easily create a new erp5 object + + Parsing must be called this way : + parser = etree.XMLParser(target = EchoDictTarget(parser_dict)) + result_list = etree.XML(str(xml), parser,) + + """ + + + def __init__(self, parser_dict): + self.parser_dict = parser_dict + self.result_list = [] + self._current_object = None + self._current_key = None + + def start(self, tag, attrib): + try: + value, root = self.parser_dict[tag] + if root: + self._current_object = {} + if self._current_object is not None and \ + not self._current_object.has_key(value): + self._current_object[value] = "" + self._current_key = value + else: + self._current_key = None + except KeyError: + self._current_key = None + except TypeError: + LOG("EchoTargetDict.start", ERROR, + "got a key for %s, but no root tag exists ! Check your property mapping definition" %(tag,)) + self._current_key = None + + def end(self, tag): + try: + value , root = self.parser_dict[tag] + if root: + self.result_list.append(self._current_object.copy()) + except KeyError: + pass + + def data(self, data): + if self._current_key and len(data.strip()): + # for the element browsed several time + if self._current_object.has_key(self._current_key): + data = self._current_object[self._current_key] + data + self._current_object[self._current_key] = data + + def comment(self, text): + pass + + def close(self): + return self.result_list + + + diff --git a/product/ERP5TioSafe/XSD/nodes.xsd b/product/ERP5TioSafe/XSD/nodes.xsd new file mode 100644 index 0000000000000000000000000000000000000000..aaadb631b32f76b85503f7427aa0cb968526468a --- /dev/null +++ b/product/ERP5TioSafe/XSD/nodes.xsd @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> + <!-- Define the XML Schema of a node --> + <xs:element name="directory"> + <xs:complexType> + <xs:sequence> + <xs:element name="node" maxOccurs="unbounded"> + <xs:complexType> + <xs:sequence> + <xs:element name="title" type="xs:string" minOccurs="0"/> + <xs:element name="firstname" type="xs:string" minOccurs="0"/> + <xs:element name="lastname" type="xs:string" minOccurs="0"/> + <xs:element name="email" type="xs:string" minOccurs="0"/> + <xs:element name="birthday" type="xs:string" minOccurs="0"/> + <xs:element name="address" minOccurs="0" maxOccurs="unbounded"> + <xs:complexType> + <xs:sequence> + <xs:element name="street" type="xs:string"/> + <xs:element name="zip" type="xs:string" minOccurs="0"/> + <xs:element name="city" type="xs:string" minOccurs="0"/> + <xs:element name="country" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="category" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + <xs:attribute name="type" use="required"/> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> +</xs:schema> diff --git a/product/ERP5TioSafe/XSD/resources.xsd b/product/ERP5TioSafe/XSD/resources.xsd new file mode 100644 index 0000000000000000000000000000000000000000..1cf9ad28216619c4ad33aae4830e51185c146f91 --- /dev/null +++ b/product/ERP5TioSafe/XSD/resources.xsd @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> + <!-- Define the XML Schema of a node --> + <xs:element name="catalog"> + <xs:complexType> + <xs:sequence> + <xs:element name="resource" maxOccurs="unbounded"> + <xs:complexType> + <xs:sequence> + <xs:element name="title" type="xs:string"/> + <xs:element name="reference" type="xs:string" minOccurs="0"/> + <xs:element name="sale_price" type="xs:float" minOccurs="0"/> + <xs:element name="purchase_price" type="xs:float" minOccurs="0"/> + <xs:element name="ean13" type="xs:string" minOccurs="0"/> + <xs:element name="category" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + <xs:attribute name="type" use="required"/> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> +</xs:schema> + diff --git a/product/ERP5TioSafe/XSD/transactions.xsd b/product/ERP5TioSafe/XSD/transactions.xsd new file mode 100644 index 0000000000000000000000000000000000000000..17cacecf300a1034d0faa87f19734dc7363fb86e --- /dev/null +++ b/product/ERP5TioSafe/XSD/transactions.xsd @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="utf-8"?> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> + <!-- Define the XML Schema of a transaction --> + <xs:element name="journal"> + <xs:complexType> + <xs:sequence> + <xs:element name="transaction" maxOccurs="unbounded"> + <xs:complexType> + <xs:sequence> + <xs:element name="title" type="xs:string" minOccurs="0"/> + <xs:element name="start_date" type="xs:string"/> + <xs:element name="stop_date" type="xs:string"/> + <xs:element name="reference" type="xs:string"/> + <xs:element name="currency" type="xs:string"/> + <xs:element name="payment_mode" type="xs:string"/> + <xs:element name="category" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="arrow" maxOccurs="unbounded"> + <xs:complexType> + <xs:sequence> + <xs:element name="source" type="xs:string" minOccurs="0"/> + <xs:element name="destination" type="xs:string" minOccurs="0"/> + </xs:sequence> + <xs:attribute name="type" use="required"/> + </xs:complexType> + </xs:element> + <xs:element name="movement" maxOccurs="unbounded"> + <xs:complexType> + <xs:sequence> + <xs:element name="resource" type="xs:string"/> + <xs:element name="title" type="xs:string" minOccurs="0"/> + <xs:element name="reference" type="xs:string" minOccurs="0"/> + <xs:element name="quantity" type="xs:float"/> + <xs:element name="price" type="xs:float"/> + <xs:element name="VAT" type="xs:string"/> + <xs:element name="category" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + </xs:sequence> + <xs:attribute name="type" use="required"/> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> +</xs:schema> diff --git a/product/ERP5TioSafe/__init__.py b/product/ERP5TioSafe/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..092903fa276650b4d6397c82c5d35d7c0b51ef86 --- /dev/null +++ b/product/ERP5TioSafe/__init__.py @@ -0,0 +1,80 @@ +############################################################################## +# +# Copyright (c) 2002-2009 Nexedi SA and Contributors. All Rights Reserved. +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +# Update ERP5 Globals +from Products.ERP5Type.Utils import initializeProduct, updateGlobals +from Tool import IntegrationTool +import sys, Permissions +this_module = sys.modules[ __name__ ] +document_classes = updateGlobals( this_module, globals(), permissions_module = Permissions) + +# Finish installation +def initialize( context ): + import Document + initializeProduct(context, this_module, globals(), + document_module = Document, + document_classes = document_classes, + object_classes = (), + portal_tools = (IntegrationTool.IntegrationTool,), + content_constructors = (), + content_classes = ()) + +# Initialize Connection plugins +from Products.ERP5Type.Tool.WebServiceTool import registerConnectionPlugin +from zLOG import LOG, WARNING + +handler_module_dict = { + 'http': 'HTTPConnection', + 'php_unit_test': 'PHPUnitTestConnection', + 'rest' : 'RESTConnection', + 'magento_xmlrpc' : 'MagentoXMLRPCConnection', +} + +for handler_id, module_id in handler_module_dict.iteritems(): + # Ignore non-functionnal plugins. + # This is done to avoid adding strict dependencies. + # Code relying on the presence of a plugin will fail upon + # WebServiceTool.connect . + try: + module = __import__( + 'Products.ERP5TioSafe.ConnectionPlugin.%s' % (module_id, ), + globals(), {}, [module_id]) + except ImportError: + LOG('ERP5TioSafe.__init__', WARNING, + 'Unable to import module %r. %r transport will not be available.' % \ + (module_id, handler_id), + error=sys.exc_info()) + else: + try: + registerConnectionPlugin(handler_id, getattr(module, module_id)) + except ValueError, msg: + LOG('ERP5TioSafe.ConnectionPlugin.__init__', WARNING, + 'Unable to register module %r. error is %r.' % \ + (module_id, msg), + error=sys.exc_info()) + + diff --git a/product/ERP5TioSafe/dtml/__init__.py b/product/ERP5TioSafe/dtml/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/product/ERP5TioSafe/help/__init__.py b/product/ERP5TioSafe/help/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/product/ERP5TioSafe/interfaces/__init__.py b/product/ERP5TioSafe/interfaces/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/product/ERP5TioSafe/patches/ClassTool.py b/product/ERP5TioSafe/patches/ClassTool.py new file mode 100644 index 0000000000000000000000000000000000000000..621f6a29dc4eaa04c9a2bd6be8d4d3cb3cd92c28 --- /dev/null +++ b/product/ERP5TioSafe/patches/ClassTool.py @@ -0,0 +1,132 @@ +############################################################################## +# +# +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsibility of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# guarantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +############################################################################## + + +from Products.ERP5Type.Tool.ClassTool import ClassTool + +COPYRIGHT = "Copyright (c) 2002-%s Nexedi SA and Contributors. All Rights Reserved." % DateTime().year() + +def newConduit(self, class_id, REQUEST=None): + """ + Create a document class used as Conduit + """ + text = """\ +############################################################################## +# +# %s +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsibility of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# guarantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +############################################################################## + +from Products.ERP5SyncML.Conduit.ERP5Conduit import ERP5Conduit +from lxml import etree +parser = etree.XMLParser(remove_blank_text=True) + +XUPDATE_INSERT_LIST = ('xupdate:insert-after', 'xupdate:insert-before') + +class %s(TioSafeBaseConduit): + ''' + This class provides some tools used by different TioSafe Conduits. + ''' + + def addNode(self, xml=None, object=None, sub_object=None, reset=None, + simulate=None, **kw): + ''' + A node is added + + xml : the xml wich contains what we want to add + + object : from where we want to add something + + previous_xml : the previous xml of the object, if any + + force : apply updates even if there's a conflict + + This fucntion returns conflict_list, wich is of the form, + [conflict1,conflict2,...] where conclict1 is of the form : + [object.getPath(),keyword,local_and_actual_value,subscriber_value] + ''' + raise NotImplementedError + + def _createContent(self, xml=None, object=None, object_id=None, sub_object=None, + reset_local_roles=0, reset_workflow=0, simulate=0, **kw): + ''' This is a method called by the addNode that create object for the given xml''' + raise NotImplementedError + + def _deleteContent(self, object=None, object_id=None): + ''' This method allows to remove a product in the integration site ''' + raise NotImplementedError + + def updateNode(self, xml=None, object=None, previous_xml=None, force=False, + simulate=False, reset=False, xpath_expression=None, **kw): + ''' + This method browse the xml which allows to update data and update the + correpsonging object. + ''' + raise NotImplementedError + + def _updateXupdateUpdate(self, document=None, xml=None, previous_xml=None, **kw): + ''' + This method is called in updateNode and allows to work on the update of + elements. + ''' + raise NotImplementedError + + def _updateXupdateDel(self, document=None, xml=None, previous_xml=None, **kw): + ''' This method is called in updateNode and allows to remove elements. ''' + raise NotImplementedError + + def _updateXupdateInsertOrAdd(self, document=None, xml=None, previous_xml=None, **kw): + ''' This method is called in updateNode and allows to add elements. ''' + raise NotImplementedError +""" % (COPYRIGHT, class_id) + self.writeLocalDocument(class_id, text) + if REQUEST is not None: + REQUEST.RESPONSE.redirect('%s/manage_editDocumentForm?class_id=%s&manage_tabs_message=Conduit+Created' % (self.absolute_url(), class_id)) + + +ClassTool.newDocument = newConduit diff --git a/product/ERP5TioSafe/patches/__init__.py b/product/ERP5TioSafe/patches/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/product/ERP5TioSafe/plugins/prestashop/config/settings.inc.php b/product/ERP5TioSafe/plugins/prestashop/config/settings.inc.php new file mode 100644 index 0000000000000000000000000000000000000000..a3d6d38394267e62668f1ccf9351595733140e80 --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/config/settings.inc.php @@ -0,0 +1,14 @@ +<?php +define('_DB_SERVER_', 'localhost'); +define('_DB_TYPE_', 'MySQL'); +define('_DB_NAME_', 'test'); +define('_DB_USER_', 'test'); +define('_DB_PASSWD_', ''); +define('_DB_PREFIX_', 'ps_'); +define('__PS_BASE_URI__', '/prestashop/'); +define('_THEME_NAME_', 'prestashop'); +define('_COOKIE_KEY_', 'SMAJC64KCHQCUU5bDGjgRE0uifKmDjAqMEevNLnw2UFAB32KvZGZOdWZ'); +define('_COOKIE_IV_', 'XVuoeWcY'); +define('_PS_CREATION_DATE_', '2010-04-16'); +define('_PS_VERSION_', '1.2.5.0'); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/AdminOneClickConnect.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/AdminOneClickConnect.php new file mode 100644 index 0000000000000000000000000000000000000000..85acfabc9dd05605960ead092e4291ed3b6819cd --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/AdminOneClickConnect.php @@ -0,0 +1,21 @@ +<?php +include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); +class AdminOneClickConnect extends AdminTab +{ + private $module = 'oneclickconnect'; + + public function __construct() + { + global $cookie, $_LANGADM; + $langFile = _PS_MODULE_DIR_.$this->module.'/'.Language::getIsoById(intval($cookie->id_lang)).'.php'; + if(file_exists($langFile)) + { + require_once $langFile; + foreach($_MODULE as $key=>$value) + if(substr(strip_tags($key), 0, 5) == 'Admin') + $_LANGADM[str_replace('_', '', strip_tags($key))] = $value; + } + parent::__construct(); + } +} +?> \ No newline at end of file diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/agt_reload.png b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/agt_reload.png new file mode 100755 index 0000000000000000000000000000000000000000..25ea25a349826933dbd238fcea6e20ff4ce8351b Binary files /dev/null and b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/agt_reload.png differ diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/checkCategoryExistency.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/checkCategoryExistency.php new file mode 100644 index 0000000000000000000000000000000000000000..0232c46b18779f82767e967545fd2029cd0ed3a0 --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/checkCategoryExistency.php @@ -0,0 +1,24 @@ +<?php + $path = explode('/modules',dirname(__FILE__)); + $config = $path[0].'/config/settings.inc.php'; + include($config); + include('database.php'); + header('Content-Type: text/plain; charset=utf-8'); + + # build the query which render the count of variations which correspond + $sql = "SELECT "; + $sql .= constant('_DB_PREFIX_')."attribute.id_attribute AS id, name AS title"; + + # which tables are implied in the check of category existency + $sql .= " FROM ".constant('_DB_PREFIX_')."attribute "; + $sql .= " LEFT JOIN ".constant('_DB_PREFIX_')."attribute_lang "; + $sql .= " ON ".constant('_DB_PREFIX_')."attribute_lang.id_attribute=".constant('_DB_PREFIX_')."attribute.id_attribute "; + + # check the good variation + $sql .= "WHERE "; + $sql .= "name='".$_POST['variation']."' AND "; + $sql .= "id_lang=".$_POST['language']." AND "; + $sql .= "id_attribute_group=(SELECT id_attribute_group FROM ".constant('_DB_PREFIX_')."attribute_group_lang WHERE name='".$_POST['base_category']."')"; + + echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/createAddress.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/createAddress.php new file mode 100644 index 0000000000000000000000000000000000000000..46979fb3b1f0d030949b6b8ec2a8ca988b783888 --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/createAddress.php @@ -0,0 +1,32 @@ +<?php + $path = explode('/modules',dirname(__FILE__)); + $config = $path[0].'/config/settings.inc.php'; + include($config); + include('database.php'); + header('Content-Type: text/plain; charset=utf-8'); + + # build the date + $date = date('y-m-d H:i:s'); + + # build the sql which create a person + $sql = "INSERT INTO ".constant('_DB_PREFIX_')."address ( "; + $sql .= "id_country, id_customer, address1, postcode, city, active, deleted, date_add "; + $sql .= " ) VALUES ( "; + + # first find the country in the tables and set the corresponding id + if (isset($_POST['country'])) { + $sql .= "(SELECT id_country FROM ".constant('_DB_PREFIX_')."country_lang "; + $sql .= "WHERE name='".$_POST['country']."' AND id_lang=".$_POST['language']."), "; + } else { + $sql .= "'NULL', "; + } + + # finnaly set the other element of the address + $sql .= $_POST['person_id'].", "; + $sql .= (isset($_POST['street']) ? "'".$_POST['street']."'" : 'NULL').", "; + $sql .= (isset($_POST['zip']) ? "'".$_POST['zip']."'" : 'NULL').", "; + $sql .= (isset($_POST['city']) ? "'".$_POST['city']."'" : 'NULL').", "; + $sql .= "1, 0, '".$date."')"; + + echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/createPerson.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/createPerson.php new file mode 100644 index 0000000000000000000000000000000000000000..62d709d5f7e93f20f7949115694703319d39c8df --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/createPerson.php @@ -0,0 +1,29 @@ +<?php + $path = explode('/modules',dirname(__FILE__)); + $config = $path[0].'/config/settings.inc.php'; + include($config); + include('database.php'); + header('Content-Type: text/plain; charset=utf-8'); + + # build the date + $date = date('y-m-d H:i:s'); + + # build the sql which create a person + $sql = "INSERT INTO ".constant('_DB_PREFIX_')."customer ( "; + $sql .= "firstname, lastname, email, birthday, secure_key, passwd, active, deleted, date_add, date_upd"; + $sql .= " ) VALUES ( "; + + # set the values of the person and check if birthday is give + $sql .= "'".$_POST['firstname']."', "; + $sql .= "'".$_POST['lastname']."', "; + $sql .= "'".$_POST['email']."', "; + $sql .= (isset($_POST['birthday']) ? "'".$_POST['birthday']."'" : 'NULL').", "; + $sql .= "'544ba9e0c36cc903cedcdcad8773f7ff', "; + $sql .= "'4be012eb764d501233f79a33e1024042', "; + $sql .= "1, 0, "; + $sql .= "'".$date."', "; + $sql .= "'".$date."' ) "; + + echo executeSQL($sql); + # TODO: See to add a request and it's this request which "echo" the last id +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/createProduct.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/createProduct.php new file mode 100644 index 0000000000000000000000000000000000000000..5989aec3e794b232264e2f5cfa4e7db9110fa9d9 --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/createProduct.php @@ -0,0 +1,41 @@ +<?php + $path = explode('/modules',dirname(__FILE__)); + $config = $path[0].'/config/settings.inc.php'; + include($config); + include('database.php'); + header('Content-Type: text/plain; charset=utf-8'); + + # build the date + $date = date('y-m-d H:i:s'); + + # build the sql which create a product + $sql = "INSERT INTO ".constant('_DB_PREFIX_')."product ( "; + $sql .= "ean13, reference, id_category_default, active, date_add, date_upd "; + $sql .= " ) VALUES ( "; + $sql .= (isset($_POST['ean13']) ? "'".$_POST['ean13']."'" : 'NULL').", "; + $sql .= (isset($_POST['reference']) ? "'".$_POST['reference']."'" : 'NULL').", "; + $sql .= "1, 1, '".$date."', '".$date."' "; + $sql .= ") "; + executeSQL($sql); + + # add the product name in the corresponding languages + $sql = "INSERT INTO ".constant('_DB_PREFIX_')."product_lang ( "; + $sql .= "id_product, id_lang, link_rewrite, name "; + $sql .= " ) VALUES ( "; + $sql .= "(SELECT MAX(id_product) FROM ".constant('_DB_PREFIX_')."product), "; + $sql .= $_POST['language'].', '; + $sql .= "'".$_POST['title']."', '".$_POST['title']."' "; + $sql .= ") "; + executeSQL($sql); + + # add the product in the category + $sql = "INSERT INTO ".constant('_DB_PREFIX_')."category_product ( "; + $sql .= "id_category, id_product, position "; + $sql .= " ) VALUES ( "; + $sql .= "1, "; + $sql .= "(SELECT MAX(id_product) FROM ".constant('_DB_PREFIX_')."product), "; + $sql .= "(SELECT MAX(id_product) FROM ".constant('_DB_PREFIX_')."product)"; + $sql .= ") "; + + echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/createProductAttribute.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/createProductAttribute.php new file mode 100644 index 0000000000000000000000000000000000000000..a9ca2597191764629778fc9b29c1173103942b0f --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/createProductAttribute.php @@ -0,0 +1,15 @@ +<?php + $path = explode('/modules',dirname(__FILE__)); + $config = $path[0].'/config/settings.inc.php'; + include($config); + include('database.php'); + header('Content-Type: text/plain; charset=utf-8'); + + $sql = "INSERT INTO ".constant('_DB_PREFIX_')."product_attribute ("; + $sql .= "id_product"; + $sql .= " ) VALUES ( "; + $sql .= $_POST['id_product']; + $sql .= ")"; + + echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/createProductAttributeCombination.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/createProductAttributeCombination.php new file mode 100644 index 0000000000000000000000000000000000000000..8fcf706a6efed11c943b530446bb4e1b33496d3e --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/createProductAttributeCombination.php @@ -0,0 +1,23 @@ +<?php + $path = explode('/modules',dirname(__FILE__)); + $config = $path[0].'/config/settings.inc.php'; + include($config); + include('database.php'); + header('Content-Type: text/plain; charset=utf-8'); + + $sql = "INSERT INTO ".constant('_DB_PREFIX_')."product_attribute_combination VALUES ( "; + + # to put values in the database base, first, retrieve the attribute variation + $sql .= "("; + $sql .= "SELECT ".constant('_DB_PREFIX_')."attribute_lang.id_attribute "; + $sql .= "FROM ".constant('_DB_PREFIX_')."attribute_lang "; + $sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."attribute ON "; + $sql .= constant('_DB_PREFIX_')."attribute.id_attribute = ".constant('_DB_PREFIX_')."attribute_lang.id_attribute "; + $sql .= " WHERE name='".$_POST['variation']."' AND id_attribute_group="; + $sql .= "(SELECT id_attribute_group FROM ".constant('_DB_PREFIX_')."attribute_group_lang WHERE name='".$_POST['base_category']."')"; + $sql .= "), "; + $sql .= $_POST['id_product_attribute']; + $sql .= ")"; + + echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/database.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/database.php new file mode 100644 index 0000000000000000000000000000000000000000..f3a3dd27b859f6a040d66e83df488d6c96205ad0 --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/database.php @@ -0,0 +1,36 @@ +<?php +function executeSQL($sql) +{ + $path = explode('/modules',dirname(__FILE__)); + + $db = mysql_connect(constant('_DB_SERVER_'), constant('_DB_USER_'), constant('_DB_PASSWD_')); + mysql_query("SET NAMES UTF8"); + mysql_select_db(constant('_DB_NAME_'),$db); + $req = mysql_query($sql); + if (!$req) { + die('\nInvalid query: ' . mysql_error()); + } + + if (empty($req)) { + return mysql_error(); + } + + if (gettype($req) == 'boolean'){ + return; + } + + $result = "<xml>"; + while($data = mysql_fetch_assoc($req)) + { + $result .= "<object>"; + foreach(array_keys($data) as $key) + { + $result .= "<$key>$data[$key]</$key>"; + } + $result .= "</object>"; + } + $result .= "</xml>"; + mysql_close(); + return $result; +} +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/deleteAddress.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/deleteAddress.php new file mode 100644 index 0000000000000000000000000000000000000000..48be331d682294a965c41459a5495ff80502a57e --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/deleteAddress.php @@ -0,0 +1,15 @@ +<?php + $path = explode('/modules',dirname(__FILE__)); + $config = $path[0].'/config/settings.inc.php'; + include($config); + include('database.php'); + header('Content-Type: text/plain; charset=utf-8'); + + # to remove addresses of someone, put the deleted field to 1 + $sql = "UPDATE ".constant('_DB_PREFIX_')."address SET "; + $sql .= "deleted=1, active=0 "; + $sql .= "WHERE id_customer=".$_POST['person_id']; + $sql .= (isset($_POST['address_id']) ? " AND id_address='".$_POST['address_id']."' " : ''); + + echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/deletePerson.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/deletePerson.php new file mode 100644 index 0000000000000000000000000000000000000000..408fe133899fea2dfe8c7515eb0a9c028fa95d9e --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/deletePerson.php @@ -0,0 +1,14 @@ +<?php + $path = explode('/modules',dirname(__FILE__)); + $config = $path[0].'/config/settings.inc.php'; + include($config); + include('database.php'); + header('Content-Type: text/plain; charset=utf-8'); + + # to remove someone, just put the deleted field to 1 + $sql = "UPDATE ".constant('_DB_PREFIX_')."customer SET "; + $sql .= "deleted=1, active=0 "; + $sql .= "WHERE id_customer=".$_POST['person_id']; + + echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/deleteProduct.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/deleteProduct.php new file mode 100644 index 0000000000000000000000000000000000000000..ef7ca36497aafe4b3861921d0a362f83a1ca8f40 --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/deleteProduct.php @@ -0,0 +1,12 @@ +<?php + $path = explode('/modules',dirname(__FILE__)); + $config = $path[0].'/config/settings.inc.php'; + include($config); + include('database.php'); + header('Content-Type: text/plain; charset=utf-8'); + + $sql = "UPDATE ".constant('_DB_PREFIX_')."product SET "; + $sql .= "active=0 WHERE id_product=".$_POST['product_id']; + + echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/deleteProductAttributeCombination.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/deleteProductAttributeCombination.php new file mode 100644 index 0000000000000000000000000000000000000000..40a455172b8a7a1783a5f11ef4bb8388d8c22204 --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/deleteProductAttributeCombination.php @@ -0,0 +1,46 @@ +<?php + $path = explode('/modules',dirname(__FILE__)); + $config = $path[0].'/config/settings.inc.php'; + include($config); + include('database.php'); + header('Content-Type: text/plain; charset=utf-8'); + + # create the view which contains the element to remove + $sql = "CREATE VIEW variation_combination_view AS "; + $sql .= "SELECT DISTINCT(id_product_attribute) "; + $sql .= "FROM ".constant('_DB_PREFIX_')."product_attribute_combination "; + $sql .= "WHERE id_attribute=( "; + $sql .= " SELECT ".constant('_DB_PREFIX_')."attribute.id_attribute "; + $sql .= " FROM ".constant('_DB_PREFIX_')."attribute "; + $sql .= " LEFT JOIN ".constant('_DB_PREFIX_')."attribute_lang "; + $sql .= " ON ".constant('_DB_PREFIX_')."attribute_lang.id_attribute=".constant('_DB_PREFIX_')."attribute.id_attribute "; + $sql .= " WHERE name='".$_POST['variation']."' "; + $sql .= " AND id_lang=".$_POST['language']; + $sql .= " AND id_attribute_group=( "; + $sql .= " SELECT id_attribute_group FROM ".constant('_DB_PREFIX_')."attribute_group_lang "; + $sql .= " WHERE name='".$_POST['base_category']."' AND id_lang=".$_POST['language']; + $sql .= " )"; + $sql .= " ) AND id_product_attribute IN ( "; + $sql .= " SELECT id_product_attribute "; + $sql .= " FROM ".constant('_DB_PREFIX_')."product_attribute "; + $sql .= " WHERE id_product=".$_POST['product_id']; + $sql .= "); "; + executeSQL($sql); + + # remove the element in the different tables + $sql = "DELETE FROM ".constant('_DB_PREFIX_')."product_attribute_combination "; + $sql .= "WHERE id_product_attribute IN ("; + $sql .= " SELECT id_product_attribute FROM variation_combination_view"; + $sql .= ") "; + executeSQL($sql); + $sql = "DELETE FROM ".constant('_DB_PREFIX_')."product_attribute "; + $sql .= "WHERE id_product_attribute IN ("; + $sql .= " SELECT id_product_attribute FROM variation_combination_view"; + $sql .= ") "; + executeSQL($sql); + + # remove the view + $sql = "DROP VIEW variation_combination_view"; + + echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getDeliverySaleOrderLineList.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getDeliverySaleOrderLineList.php new file mode 100644 index 0000000000000000000000000000000000000000..4a6e37db95bf85983f253d41faaa2138e2c3648b --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getDeliverySaleOrderLineList.php @@ -0,0 +1,43 @@ +<?php +$path = explode('/modules',dirname(__FILE__)); +$config = $path[0].'/config/settings.inc.php'; +include($config); +include('database.php'); + + +header('Content-Type: text/plain; charset=utf-8'); + +$sql = "SELECT "; +$sql .= constant('_DB_PREFIX_')."orders.id_order AS id, "; +$sql .= "'Service Delivery' AS id_product, "; +$sql .= "0 AS id_group, "; +$sql .= "' Service Delivery' AS resource, "; +$sql .= "'Delivery' AS title, "; +$sql .= "'Delivery' AS reference, "; +$sql .= "FORMAT(1, 2) AS quantity, "; +# build value without taxes +$sql .= "ROUND("; +$sql .= "(".constant('_DB_PREFIX_')."orders.total_shipping / (1 + "; +$sql .= "(IFNULL(".constant('_DB_PREFIX_')."tax.rate, 19.60) / 100)"; +$sql .= "))"; +$sql .= ", 6) AS price, "; +$sql .= "ROUND((IFNULL(".constant('_DB_PREFIX_')."tax.rate, 19.60)), 2) AS VAT "; + +$sql .= "FROM ".constant('_DB_PREFIX_')."orders "; + +$sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."carrier "; +$sql .= "ON ".constant('_DB_PREFIX_')."carrier.id_carrier=".constant('_DB_PREFIX_')."orders.id_carrier "; + +$sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."tax "; +$sql .= "ON ".constant('_DB_PREFIX_')."tax.id_tax=".constant('_DB_PREFIX_')."carrier.id_tax "; + +$sql .= "WHERE "; +$sql .= constant('_DB_PREFIX_')."orders.total_shipping != 0.0 "; + +if (isset($_POST['sale_order_id'])){ + $sql .= "AND ".constant('_DB_PREFIX_')."orders.id_order=".$_POST['sale_order_id']; +} + + +echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getDiscountSaleOrderLineList.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getDiscountSaleOrderLineList.php new file mode 100644 index 0000000000000000000000000000000000000000..0cc4c7218ce24ea4e89765d50b675d4683089948 --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getDiscountSaleOrderLineList.php @@ -0,0 +1,28 @@ +<?php +$path = explode('/modules',dirname(__FILE__)); +$config = $path[0].'/config/settings.inc.php'; +include($config); +include('database.php'); + +header('Content-Type: text/plain; charset=utf-8'); + +$sql = "SELECT "; +$sql .= constant('_DB_PREFIX_')."order_discount.id_order_discount AS id, "; +$sql .= "'Service Discount' AS id_product, "; +$sql .= "0 AS id_group, "; +$sql .= "' Service Discount' AS resource, "; +$sql .= "'Discount' AS title, "; +$sql .= "'Discount' AS reference, "; +$sql .= "FORMAT(1, 2) AS quantity, "; +$sql .= "-(ROUND(value, 6)) AS price, "; +$sql .= "'0.00' AS VAT "; + +$sql .= "FROM ".constant('_DB_PREFIX_')."order_discount "; + +if (isset($_POST['sale_order_id'])){ + $sql .= "WHERE "; + $sql .= "id_order=".$_POST['sale_order_id']; +} + +echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getLanguageList.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getLanguageList.php new file mode 100644 index 0000000000000000000000000000000000000000..ae51739d45ac4dda004cc80e7111e27c189b3462 --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getLanguageList.php @@ -0,0 +1,12 @@ +<?php + $path = explode('/modules',dirname(__FILE__)); + $config = $path[0].'/config/settings.inc.php'; + include($config); + include('database.php'); + header('Content-Type: text/plain; charset=utf-8'); + + # build the sql which render the language list + $sql = "SELECT id_lang AS id, name AS title FROM ".constant('_DB_PREFIX_')."lang"; + + echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getLastID.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getLastID.php new file mode 100644 index 0000000000000000000000000000000000000000..36ff66b5de72e92982d7d4232cfc271a2bf15757 --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getLastID.php @@ -0,0 +1,21 @@ +<?php + $path = explode('/modules',dirname(__FILE__)); + $config = $path[0].'/config/settings.inc.php'; + include($config); + include('database.php'); + header('Content-Type: text/plain; charset=utf-8'); + + # through the type render the id of the corresponding data + if ($_POST['type'] == 'Person') { + $sql = "SELECT MAX(id_customer) AS last_id "; + $sql .= "FROM ".constant('_DB_PREFIX_')."customer " ; + } else if ($_POST['type'] == 'Product') { + $sql = "SELECT MAX(id_product) AS last_id "; + $sql .= "FROM ".constant('_DB_PREFIX_')."product " ; + } else if ($_POST['type'] == 'Product Attribute') { + $sql = "SELECT MAX(id_product_attribute) AS last_id "; + $sql .= "FROM ".constant('_DB_PREFIX_')."product_attribute " ; + } + + echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getPersonAddressList.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getPersonAddressList.php new file mode 100644 index 0000000000000000000000000000000000000000..19c04a5cf8c0c8b83a2615203bb27d962c026aa6 --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getPersonAddressList.php @@ -0,0 +1,44 @@ +<?php + $path = explode('/modules',dirname(__FILE__)); + $config = $path[0].'/config/settings.inc.php'; + include($config); + include('database.php'); + header('Content-Type: text/plain; charset=utf-8'); + + # build the sql which allows to retrieve the address of a person + $sql = "SELECT "; + $sql .= constant('_DB_PREFIX_')."address.id_address AS id, "; + $sql .= constant('_DB_PREFIX_')."address.address1 AS street, "; + $sql .= constant('_DB_PREFIX_')."address.postcode AS zip, "; + $sql .= constant('_DB_PREFIX_')."address.city AS city, "; + $sql .= constant('_DB_PREFIX_')."country_lang.name AS country "; + + # which tables are implied in the retrieve of address + $sql .= "FROM ".constant('_DB_PREFIX_')."address " ; + $sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."country " ; + $sql .= "ON ".constant('_DB_PREFIX_')."country.id_country=".constant('_DB_PREFIX_')."address.id_country "; + $sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."country_lang " ; + $sql .= "ON ".constant('_DB_PREFIX_')."country_lang.id_country=".constant('_DB_PREFIX_')."country.id_country "; + + # where clause which restrict to the good person + $sql .= "WHERE "; + if (isset($_POST['person_id'])){ + $sql .= constant('_DB_PREFIX_')."address.id_customer=".$_POST['person_id']." AND "; + } + $sql .= constant('_DB_PREFIX_')."country_lang.id_lang=".$_POST['language']." AND "; + $sql .= "address1 IS NOT NULL AND "; + $sql .= "postcode IS NOT NULL AND "; + $sql .= "city IS NOT NULL AND "; + $sql .= constant('_DB_PREFIX_')."address.id_country IS NOT NULL AND "; + $sql .= constant('_DB_PREFIX_')."address.active=1 AND "; + $sql .= constant('_DB_PREFIX_')."address.deleted=0 "; + + # group the address by data + $sql .= "GROUP BY address1, postcode, city, ".constant('_DB_PREFIX_')."address.id_country "; + + # FIXME: Is the order is usefull, the brain doesn't work on it ??? + # order by address id + $sql .= "ORDER BY ".constant('_DB_PREFIX_')."address.id_address ASC "; + + echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getPersonList.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getPersonList.php new file mode 100644 index 0000000000000000000000000000000000000000..81f6c34571314764d5ed8d7567be47ede64c959f --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getPersonList.php @@ -0,0 +1,24 @@ +<?php + $path = explode('/modules',dirname(__FILE__)); + $config = $path[0].'/config/settings.inc.php'; + include($config); + include('database.php'); + header('Content-Type: text/plain; charset=utf-8'); + + # build the sql which render the persons or only one if the id is provided + $sql = "SELECT id_customer AS id, "; + $sql .= "firstname AS firstname, lastname AS lastname, email AS email, "; + $sql .= "DATE_FORMAT(birthday, '%Y/%m/%d') AS birthday "; + $sql .= "FROM ".constant('_DB_PREFIX_')."customer " ; + $sql .= "WHERE "; + if (isset($_POST['person_id'])) { + $sql .= "id_customer=".$_POST['person_id']." AND "; + } + $sql .= "firstname != '' AND lastname != '' AND email != '' AND deleted = 0 "; + + $sql .= "GROUP BY firstname, lastname, email "; + # FIXME: Is the order is usefull, the brain doesn't work on it ??? + $sql .= "ORDER BY firstname ASC, lastname ASC, email ASC"; + + echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getProductCategoryList.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getProductCategoryList.php new file mode 100644 index 0000000000000000000000000000000000000000..f68fb3cb2b8d876f9df78853abc89aee921d0603 --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getProductCategoryList.php @@ -0,0 +1,61 @@ +<?php + $path = explode('/modules',dirname(__FILE__)); + $config = $path[0].'/config/settings.inc.php'; + include($config); + include('database.php'); + header('Content-Type: text/plain; charset=utf-8'); + + # build the sql which render the categories + $sql = "SELECT "; + $sql .= "DISTINCT(".constant('_DB_PREFIX_')."attribute_lang.name) AS distinction, "; + $sql .= constant('_DB_PREFIX_')."product_attribute.id_product_attribute AS id, "; + $sql .= "CONCAT("; + $sql .= constant('_DB_PREFIX_')."attribute_group_lang.name, "; + $sql .= " '/', "; + $sql .= constant('_DB_PREFIX_')."attribute_lang.name "; + $sql .= ") AS category "; + + # which tables are implied in the retrieve of product variations + $sql .= "FROM ".constant('_DB_PREFIX_')."product "; + $sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."product_lang "; + $sql .= "ON ".constant('_DB_PREFIX_')."product_lang.id_product=".constant('_DB_PREFIX_')."product.id_product "; + + $sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."product_attribute "; + $sql .= "ON ".constant('_DB_PREFIX_')."product_attribute.id_product=".constant('_DB_PREFIX_')."product.id_product "; + + $sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."product_attribute_combination "; + $sql .= "ON ".constant('_DB_PREFIX_')."product_attribute_combination.id_product_attribute=".constant('_DB_PREFIX_')."product_attribute.id_product_attribute "; + + $sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."attribute "; + $sql .= "ON ".constant('_DB_PREFIX_')."attribute.id_attribute=".constant('_DB_PREFIX_')."product_attribute_combination.id_attribute "; + + $sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."attribute_lang "; + $sql .= "ON ".constant('_DB_PREFIX_')."attribute_lang.id_attribute=".constant('_DB_PREFIX_')."attribute.id_attribute "; + + $sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."attribute_group_lang "; + $sql .= "ON ".constant('_DB_PREFIX_')."attribute_group_lang.id_attribute_group=".constant('_DB_PREFIX_')."attribute.id_attribute_group "; + + # where clause which restrict to the good variations + $sql .= "WHERE "; + if (isset($_POST['product_id'])) { + $sql .= constant('_DB_PREFIX_')."product.id_product=".$_POST['product_id']." AND "; + } else if (isset($_POST['group_id'])) { + $sql .= constant('_DB_PREFIX_')."product_attribute.id_product_attribute=".$_POST['group_id']." AND "; + } + $sql .= constant('_DB_PREFIX_')."product_lang.id_lang=".$_POST['language']." AND "; + $sql .= constant('_DB_PREFIX_')."attribute_lang.id_lang=".$_POST['language']." AND "; + $sql .= constant('_DB_PREFIX_')."attribute_group_lang.id_lang=".$_POST['language']." "; + + # group the render + $sql .= "GROUP BY "; + $sql .= constant('_DB_PREFIX_')."attribute_group_lang.name, "; + $sql .= constant('_DB_PREFIX_')."attribute_lang.name "; + + # FIXME: Is the order is usefull, the brain doesn't work on it ??? + # order by group name and category name + $sql .= "ORDER BY "; + $sql .= constant('_DB_PREFIX_')."attribute_group_lang.name ASC, "; + $sql .= constant('_DB_PREFIX_')."attribute_lang.name ASC "; + + echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getProductList.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getProductList.php new file mode 100644 index 0000000000000000000000000000000000000000..38fc0bc95a1dbd1ca1e795be20091636050e868b --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getProductList.php @@ -0,0 +1,29 @@ +<?php + $path = explode('/modules',dirname(__FILE__)); + $config = $path[0].'/config/settings.inc.php'; + include($config); + include('database.php'); + header('Content-Type: text/plain; charset=utf-8'); + + # build the sql which render the products or only one if the id is provided + $sql = "SELECT "; + $sql .= "DISTINCT(".constant('_DB_PREFIX_')."product.id_product) AS id_product, "; + $sql .= constant('_DB_PREFIX_')."product.ean13 AS ean13, "; + $sql .= constant('_DB_PREFIX_')."product.reference AS reference, "; + $sql .= "(SELECT name FROM ".constant('_DB_PREFIX_')."product_lang WHERE id_product=".constant('_DB_PREFIX_')."product.id_product AND id_lang=".$_POST['language'].") AS title "; + # which tables are implied in the render of products + $sql .= "FROM ".constant('_DB_PREFIX_')."product " ; + $sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."product_lang " ; + $sql .= "ON ".constant('_DB_PREFIX_')."product_lang.id_product=".constant('_DB_PREFIX_')."product.id_product "; + $sql .= "WHERE ".constant('_DB_PREFIX_')."product.active=1 "; + if (isset($_POST['product_id'])) { + $sql .= "AND ".constant('_DB_PREFIX_')."product.id_product=".$_POST['product_id']." "; + } + + # FIXME: Is the order is usefull, the brain doesn't work on it ??? + $sql .= "ORDER BY "; + $sql .= constant('_DB_PREFIX_')."product_lang.name ASC, "; + $sql .= constant('_DB_PREFIX_')."product.reference ASC "; + + echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getSaleOrderLineCategoryList.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getSaleOrderLineCategoryList.php new file mode 100644 index 0000000000000000000000000000000000000000..536d323fa78091f2c38db1967390011a38e86a04 --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getSaleOrderLineCategoryList.php @@ -0,0 +1,75 @@ +<?php + $path = explode('/modules',dirname(__FILE__)); + $config = $path[0].'/config/settings.inc.php'; + include($config); + include('database.php'); + header('Content-Type: text/plain; charset=utf-8'); + + # build the sql which render the categories + $sql = "SELECT "; + $sql .= "DISTINCT(".constant('_DB_PREFIX_')."attribute_lang.name) AS distinction, "; + $sql .= constant('_DB_PREFIX_')."product_attribute.id_product_attribute AS id, "; + $sql .= "CONCAT("; + $sql .= constant('_DB_PREFIX_')."attribute_group_lang.name, "; + $sql .= " '/', "; + $sql .= constant('_DB_PREFIX_')."attribute_lang.name "; + $sql .= ") AS category "; + + # which tables are implied in the retrieve of product variations + $sql .= "FROM ".constant('_DB_PREFIX_')."product "; + $sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."product_lang "; + $sql .= "ON ".constant('_DB_PREFIX_')."product_lang.id_product=".constant('_DB_PREFIX_')."product.id_product "; + + $sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."product_attribute "; + $sql .= "ON ".constant('_DB_PREFIX_')."product_attribute.id_product=".constant('_DB_PREFIX_')."product.id_product "; + + $sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."product_attribute_combination "; + $sql .= "ON ".constant('_DB_PREFIX_')."product_attribute_combination.id_product_attribute=".constant('_DB_PREFIX_')."product_attribute.id_product_attribute "; + + $sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."attribute "; + $sql .= "ON ".constant('_DB_PREFIX_')."attribute.id_attribute=".constant('_DB_PREFIX_')."product_attribute_combination.id_attribute "; + + $sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."attribute_lang "; + $sql .= "ON ".constant('_DB_PREFIX_')."attribute_lang.id_attribute=".constant('_DB_PREFIX_')."attribute.id_attribute "; + + $sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."attribute_group_lang "; + $sql .= "ON ".constant('_DB_PREFIX_')."attribute_group_lang.id_attribute_group=".constant('_DB_PREFIX_')."attribute.id_attribute_group "; + + # where clause which restrict to the good variations + $sql .= "WHERE "; + if (isset($_POST['sale_order_line_id'])) { + # use the product id from the sale order line + $sql .= constant('_DB_PREFIX_')."product.id_product=("; + $sql .= "SELECT product_id FROM ".constant('_DB_PREFIX_')."order_detail "; + $sql .= "WHERE id_order_detail=".$_POST['sale_order_line_id']; + $sql .= ") AND "; + # and add group id if exist in the order line + $sql .= "IFNULL("; + $sql .= constant('_DB_PREFIX_')."product_attribute.id_product_attribute=("; + $sql .= "SELECT product_attribute_id FROM ps_order_detail "; + $sql .= "WHERE id_order_detail=".$_POST['sale_order_line_id']; + $sql .= "), 1"; + $sql .= ") AND "; + } +# if (isset($_POST['product_id'])) { +# $sql .= constant('_DB_PREFIX_')."product.id_product=".$_POST['product_id']." AND "; +# } else if (isset($_POST['group_id'])) { +# $sql .= constant('_DB_PREFIX_')."product_attribute.id_product_attribute=".$_POST['group_id']." AND "; +# } + $sql .= constant('_DB_PREFIX_')."product_lang.id_lang=".$_POST['language']." AND "; + $sql .= constant('_DB_PREFIX_')."attribute_lang.id_lang=".$_POST['language']." AND "; + $sql .= constant('_DB_PREFIX_')."attribute_group_lang.id_lang=".$_POST['language']." "; + + # group the render + $sql .= "GROUP BY "; + $sql .= constant('_DB_PREFIX_')."attribute_group_lang.name, "; + $sql .= constant('_DB_PREFIX_')."attribute_lang.name "; + + # FIXME: Is the order is usefull, the brain doesn't work on it ??? + # order by group name and category name + $sql .= "ORDER BY "; + $sql .= constant('_DB_PREFIX_')."attribute_group_lang.name ASC, "; + $sql .= constant('_DB_PREFIX_')."attribute_lang.name ASC "; + + echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getSaleOrderLineList.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getSaleOrderLineList.php new file mode 100644 index 0000000000000000000000000000000000000000..0cf0516e9fc21249e74fc1dd77aef9153c716e59 --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getSaleOrderLineList.php @@ -0,0 +1,46 @@ +<?php + $path = explode('/modules',dirname(__FILE__)); + $config = $path[0].'/config/settings.inc.php'; + include($config); + include('database.php'); + header('Content-Type: text/plain; charset=utf-8'); + + # build the sql query which allows to render the sale order line + $sql = "SELECT "; + $sql .= "DISTINCT(".constant('_DB_PREFIX_')."order_detail.product_id) AS id_product, "; + $sql .= constant('_DB_PREFIX_')."order_detail.id_order_detail AS id, "; + $sql .= constant('_DB_PREFIX_')."order_detail.product_name AS title, "; + $sql .= constant('_DB_PREFIX_')."order_detail.product_reference AS reference, "; + $sql .= constant('_DB_PREFIX_')."order_detail.product_id AS resource, "; + $sql .= constant('_DB_PREFIX_')."order_detail.product_attribute_id AS id_group, "; + $sql .= "FORMAT(".constant('_DB_PREFIX_')."order_detail.product_quantity, 2) AS quantity, "; + $sql .= constant('_DB_PREFIX_')."order_detail.product_price AS price, "; + $sql .= constant('_DB_PREFIX_')."order_detail.tax_rate AS VAT "; + + # from which tables data come + $sql .= "FROM ".constant('_DB_PREFIX_')."orders "; + $sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."order_detail "; + $sql .= "ON ".constant('_DB_PREFIX_')."order_detail.id_order=".constant('_DB_PREFIX_')."orders.id_order "; + $sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."currency "; + $sql .= "ON ".constant('_DB_PREFIX_')."currency.id_currency=".constant('_DB_PREFIX_')."orders.id_currency "; + $sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."product_lang "; + $sql .= "ON ".constant('_DB_PREFIX_')."product_lang.id_product=".constant('_DB_PREFIX_')."order_detail.product_id "; + $sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."product "; + $sql .= "ON ".constant('_DB_PREFIX_')."product.id_product=".constant('_DB_PREFIX_')."order_detail.product_id "; + + # restrict the render + if (isset($_POST['sale_order_id'])){ + $sql .= "WHERE "; + $sql .= constant('_DB_PREFIX_')."orders.id_order=".$_POST['sale_order_id']; + if (isset($_POST['product_id'])){ + $sql .= " AND ".constant('_DB_PREFIX_')."order_detail.product_id=".$_POST['product_id']; + } + } + +# # CHECK: is it usefull to provie an order ? +# $sql .= " ORDER BY "; +# $sql .= constant('_DB_PREFIX_')."order_detail.product_name ASC, "; +# $sql .= constant('_DB_PREFIX_')."order_detail.product_reference ASC "; + + echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getSaleOrderList.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getSaleOrderList.php new file mode 100644 index 0000000000000000000000000000000000000000..1425d1871e770087425ba44cdf205c0f04c9393d --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/getSaleOrderList.php @@ -0,0 +1,57 @@ +<?php +$path = explode('/modules',dirname(__FILE__)); +$config = $path[0].'/config/settings.inc.php'; +include($config); +include('database.php'); + + +header('Content-Type: text/plain; charset=utf-8'); + + +$sql = "SELECT "; +$sql .= "DISTINCT(".constant('_DB_PREFIX_')."orders.id_order) AS reference, "; +$sql .= constant('_DB_PREFIX_')."orders.id_order AS id, "; +$sql .= constant('_DB_PREFIX_')."currency.iso_code AS currency, "; +$sql .= "DATE_FORMAT(".constant('_DB_PREFIX_')."orders.invoice_date, '%Y/%m/%d') AS start_date, "; +$sql .= "DATE_FORMAT(".constant('_DB_PREFIX_')."orders.delivery_date, '%Y/%m/%d') AS stop_date, "; +# Source and Destination +$sql .= "CONCAT('', IFNULL("; +$sql .= "CONCAT(".constant('_DB_PREFIX_')."customer.id_customer), ' Unknown unknown@person.com'"; +$sql .= ")) AS destination, "; +# Source and Destination for the Ownership +$sql .= "CONCAT('', IFNULL("; +$sql .= "CONCAT(".constant('_DB_PREFIX_')."customer.id_customer), ' Unknown unknown@person.com'"; +$sql .= ")) AS destination_ownership, "; +# Payment mode +$sql .= constant('_DB_PREFIX_')."orders.payment AS payment_mode "; + +# Join's list +$sql .= "FROM ".constant('_DB_PREFIX_')."orders " ; + +$sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."customer " ; +$sql .= "ON ".constant('_DB_PREFIX_')."customer.id_customer=".constant('_DB_PREFIX_')."orders.id_customer "; + +$sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."currency " ; +$sql .= "ON ".constant('_DB_PREFIX_')."currency.id_currency=".constant('_DB_PREFIX_')."orders.id_currency "; + +$sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."order_history " ; +$sql .= "ON ".constant('_DB_PREFIX_')."order_history.id_order=".constant('_DB_PREFIX_')."orders.id_order "; + +$sql .= "LEFT JOIN ".constant('_DB_PREFIX_')."order_detail " ; +$sql .= "ON ".constant('_DB_PREFIX_')."order_detail.id_order=".constant('_DB_PREFIX_')."orders.id_order "; + +$sql .= "WHERE "; + +if (isset($_POST['sale_order_id'])){ + $sql .= constant('_DB_PREFIX_')."orders.id_order=".$_POST['sale_order_id']." AND "; +} + +$sql .= constant('_DB_PREFIX_')."order_history.id_order_history="; +$sql .= "(SELECT MAX(id_order_history) FROM ".constant('_DB_PREFIX_')."order_history WHERE id_order=".constant('_DB_PREFIX_')."orders.id_order) AND "; +$sql .= constant('_DB_PREFIX_')."order_history.id_order_state IN (4, 5, 6, 7) "; + +$sql .= "ORDER BY ".constant('_DB_PREFIX_')."orders.id_order ASC "; + + +echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/logo.gif b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/logo.gif new file mode 100644 index 0000000000000000000000000000000000000000..c1f36f5e2c9760fa0d6be64fcfdbf19789367e1e Binary files /dev/null and b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/logo.gif differ diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/old-logo.gif b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/old-logo.gif new file mode 100644 index 0000000000000000000000000000000000000000..a52514b43f64070608f26d6206c6e03a110eda30 Binary files /dev/null and b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/old-logo.gif differ diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/oneclickconnect.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/oneclickconnect.php new file mode 100644 index 0000000000000000000000000000000000000000..7c4977ee7141dfcb5236cec858d7a5da8aca81c3 --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/oneclickconnect.php @@ -0,0 +1,106 @@ +<?php +class oneclickconnect extends Module +{ + public function __construct() + { + $this->name = 'oneclickconnect'; + $this->tab = 'Products'; + $this->version = ''; + + parent::__construct(); + + $this->displayName = $this->l('One Click Connect'); + $this->description = $this->l('Synchronize all your data with the TioSafe platform.'); + $this->confirmUninstall = $this->l('Are you sure you want to uninstall the module One Click Connect?'); + } + + public function install() + { + if(!parent::install() + || !$this->registerHook('leftColumn') + || !Configuration::updateValue('MOD_EXPORT_ONECLICKCONNECT_URL', 'https://www.tiolive.com/en/tiolive_image/logo.png') + || !$this->installModuleTab('AdminOneClickConnect', array(1=>'One Click Connect', 2=>'One Click Connect'), 2) + || !$this->installModuleTab('AdminOneClickConnect', array(1=>'One Click Connect', 2=>'One Click Connect'), 3) + || !$this->installModuleTab('AdminOneClickConnect', array(1=>'One Click Connect', 2=>'One Click Connect'), 1)) + return false; + return true; + } + + private function installModuleTab($tabClass, $tabName, $idTabParent) + { + @copy(_PS_MODULE_DIR_.$this->name.'/logo.gif', _PS_IMG_DIR_.'t/'.$tabClass.'.gif'); + $tab = new Tab(); + $tab->name = $tabName; + $tab->class_name = $tabClass; + $tab->module = $this->name; + $tab->id_parent = $idTabParent; + if(!$tab->save()) + return false; + return true; + } + + public function uninstall() + { + if(!parent::uninstall() + || !Configuration::deleteByName('MOD_EXPORT_ONECLICKCONNECT_URL') + || !$this->uninstallModuleTab('AdminOneClickConnect')) + return false; + return true; + } + + private function uninstallModuleTab($tabClass) + { + $idTab = Tab::getIdFromClassName($tabClass); + if($idTab != 0) + { + $tab = new Tab($idTab); + $tab->delete(); + return true; + } + return false; + } + + public function getContent() + { + $html = ''; + $html .= '<h2>'.$this->l('One Click Connect: synchronize your data').'</h2> + <fieldset> +<legend>'.$this->l('Informations :').'</legend>'.$this->l("TioSafe allows you to synchronize your between multiple applications.").'<br /> + <br />'.$this->l('blablabla.').' + <br />'.$this->l('bla.').' + <br clear="all" /> + <br clear="all" /> + <a href="http://www.tiolive.com" target="_blank"><img src="https://www.tiolive.com/en/tiolive_image/logo.png" alt="Solution TioSafe" border="0" /></a> + + </fieldset> +<br clear="all" /> +'; + return $html; + } + + public function secureDir($dir) + { + define('_ONECLICKCONNECT_DIR_','/oneclickconnect'); + define('MSG_ALERT_MODULE_NAME',$this->l('Module One Click Connect should not be renamed')); + + if($dir != _ONECLICKCONNECT_DIR_) + { + echo utf8_decode(MSG_ALERT_MODULE_NAME); + exit(); + } + } + + public function netoyage_html($CatList) + { + $CatList = strip_tags ($CatList); + $CatList = trim ($CatList); + $CatList = str_replace(" "," ",$CatList); + $CatList = str_replace("'","' ",$CatList); + $CatList = str_replace("–","-",$CatList); + $CatList = str_replace(chr(9)," ",$CatList); + $CatList = str_replace(chr(10)," ",$CatList); + $CatList = str_replace(chr(13)," ",$CatList); + return $CatList; + } +} +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/updateAddress.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/updateAddress.php new file mode 100644 index 0000000000000000000000000000000000000000..fcfad6dc5dc5764a1ba5b8b30fe8a7d16eb1d272 --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/updateAddress.php @@ -0,0 +1,41 @@ +<?php + $path = explode('/modules',dirname(__FILE__)); + $config = $path[0].'/config/settings.inc.php'; + include($config); + include('database.php'); + header('Content-Type: text/plain; charset=utf-8'); + + # build the date + $date = date('y-m-d H:i:s'); + + # build the update of address + $sql = "UPDATE ".constant('_DB_PREFIX_')."address SET "; + # check which property must be updated + $property_array = array( + 'street' => 'address1', + 'zip' => 'postcode', + 'city' => 'city', + ); + foreach ($property_array as $property => $field) { + if (isset($_POST[$property])) { + if ($_POST[$property] != 'NULL') { + $_POST[$property] = "'".$_POST[$property]."'"; + } + $sql .= $field."=".$_POST[$property].", "; + } + } + if (isset($_POST['country'])) { + if ($_POST['country'] == 'NULL') { + $sql .= 'id_country=0, '; + } else { + $sql .= "id_country=(SELECT id_country FROM ".constant('_DB_PREFIX_')."country_lang "; + $sql .= "WHERE name='".$_POST['country']."' AND "; + $sql .= "id_lang=".$_POST['language']."), "; + } + } + $sql .= "date_upd='".$date."' "; + # where clause which restrict to the good address + $sql .= " WHERE id_address='".$_POST['address_id']."' AND id_customer='".$_POST['person_id']."'"; + + echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/updatePerson.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/updatePerson.php new file mode 100644 index 0000000000000000000000000000000000000000..cadd8bc4eb81521402bd22c7ea863f16594cb23d --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/updatePerson.php @@ -0,0 +1,31 @@ +<?php + $path = explode('/modules',dirname(__FILE__)); + $config = $path[0].'/config/settings.inc.php'; + include($config); + include('database.php'); + header('Content-Type: text/plain; charset=utf-8'); + + # build the date + $date = date('y-m-d H:i:s'); + + # build the update of person + $sql = "UPDATE ".constant('_DB_PREFIX_')."customer SET "; + # check which property must be updated + $property_array = array( + 'firstname' => 'firstname', + 'lastname' => 'lastname', + 'email' => 'email', + 'birthday' => 'birthday', + ); + foreach ($property_array as $property => $field) { + if (isset($_POST[$property])) { + if ($_POST[$property] != 'NULL') { + $_POST[$property] = "'".$_POST[$property]."'"; + } + $sql .= $field."=".$_POST[$property].", "; + } + } + $sql .= "date_upd='".$date."' WHERE id_customer=".$_POST['person_id']; + + echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/updateProduct.php b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/updateProduct.php new file mode 100644 index 0000000000000000000000000000000000000000..5399d629a9b4c73df1efbb69fbc05dc13be0d9cd --- /dev/null +++ b/product/ERP5TioSafe/plugins/prestashop/modules/oneclickconnect/updateProduct.php @@ -0,0 +1,29 @@ +<?php + $path = explode('/modules',dirname(__FILE__)); + $config = $path[0].'/config/settings.inc.php'; + include($config); + include('database.php'); + header('Content-Type: text/plain; charset=utf-8'); + + # build the date + $date = date('y-m-d H:i:s'); + + # build the update + $sql = "UPDATE ".constant('_DB_PREFIX_')."product SET "; + # check which property must be updated + $property_array = array( + 'reference' => 'reference', + 'ean13' => 'ean13', + ); + foreach ($property_array as $property => $field) { + if (isset($_POST[$property])) { + if ($_POST[$property] != 'NULL') { + $_POST[$property] = "'".$_POST[$property]."'"; + } + $sql .= $field."=".$_POST[$property].", "; + } + } + $sql .= "date_upd='".$date."' WHERE id_product=".$_POST['product_id']; + + echo executeSQL($sql); +?> diff --git a/product/ERP5TioSafe/refresh.txt b/product/ERP5TioSafe/refresh.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/product/ERP5TioSafe/skins/__init__.py b/product/ERP5TioSafe/skins/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/product/ERP5TioSafe/tests/__init__.py b/product/ERP5TioSafe/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_00_TioSafeXML.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_00_TioSafeXML.sql new file mode 100644 index 0000000000000000000000000000000000000000..2426e4194156ad0fe22200413c8596deaa9f75b8 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_00_TioSafeXML.sql @@ -0,0 +1,346 @@ +-- MySQL dump 10.13 Distrib 5.1.34, for mandriva-linux-gnu (x86_64) +-- +-- Host: localhost Database: dump_test +-- ------------------------------------------------------ +-- Server version 5.1.34-Max + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `ps_address` +-- + +DROP TABLE IF EXISTS `ps_address`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_address` ( + `id_address` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_country` int(10) unsigned NOT NULL, + `id_state` int(10) unsigned DEFAULT NULL, + `id_customer` int(10) unsigned NOT NULL DEFAULT '0', + `id_manufacturer` int(10) unsigned NOT NULL DEFAULT '0', + `id_supplier` int(10) unsigned NOT NULL DEFAULT '0', + `alias` varchar(32) NOT NULL, + `company` varchar(32) DEFAULT NULL, + `lastname` varchar(32) NOT NULL, + `firstname` varchar(32) NOT NULL, + `address1` varchar(128) NOT NULL, + `address2` varchar(128) DEFAULT NULL, + `postcode` varchar(12) DEFAULT NULL, + `city` varchar(64) NOT NULL, + `other` text, + `phone` varchar(16) DEFAULT NULL, + `phone_mobile` varchar(16) DEFAULT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + `active` tinyint(1) unsigned NOT NULL DEFAULT '1', + `deleted` tinyint(1) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id_address`), + KEY `address_customer` (`id_customer`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_address` +-- + +LOCK TABLES `ps_address` WRITE; +/*!40000 ALTER TABLE `ps_address` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_address` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_country` +-- + +DROP TABLE IF EXISTS `ps_country`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_country` ( + `id_country` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_zone` int(10) unsigned NOT NULL, + `iso_code` varchar(3) NOT NULL, + `active` tinyint(1) unsigned NOT NULL DEFAULT '0', + `contains_states` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id_country`), + KEY `country_iso_code` (`iso_code`), + KEY `country_` (`id_zone`) +) ENGINE=MyISAM AUTO_INCREMENT=35 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_country` +-- + +LOCK TABLES `ps_country` WRITE; +/*!40000 ALTER TABLE `ps_country` DISABLE KEYS */; +INSERT INTO `ps_country` VALUES (1,1,'DE',1,0),(2,1,'AT',1,0),(3,1,'BE',1,0),(4,2,'CA',1,0),(5,3,'CN',1,0),(6,1,'ES',1,0),(7,1,'FI',1,0),(8,1,'FR',1,0),(9,1,'GR',1,0),(10,1,'IT',1,0),(11,3,'JP',1,0),(12,1,'LU',1,0),(13,1,'NL',1,0),(14,1,'PL',1,0),(15,1,'PT',1,0),(16,1,'CZ',1,0),(17,1,'GB',1,0),(18,1,'SE',1,0),(19,1,'CH',1,0),(20,1,'DK',1,0),(21,2,'US',1,1),(22,3,'HK',1,0),(23,1,'NO',1,0),(24,5,'AU',1,0),(25,3,'SG',1,0),(26,1,'IE',1,0),(27,5,'NZ',1,0),(28,3,'KR',1,0),(29,3,'IL',1,0),(30,4,'ZA',1,0),(31,4,'NG',1,0),(32,4,'CI',1,0),(33,4,'TG',1,0),(34,2,'BO',1,0); +/*!40000 ALTER TABLE `ps_country` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_country_lang` +-- + +DROP TABLE IF EXISTS `ps_country_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_country_lang` ( + `id_country` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(64) NOT NULL, + UNIQUE KEY `country_lang_index` (`id_country`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_country_lang` +-- + +LOCK TABLES `ps_country_lang` WRITE; +/*!40000 ALTER TABLE `ps_country_lang` DISABLE KEYS */; +INSERT INTO `ps_country_lang` VALUES (1,1,'Germany'),(1,2,'Allemagne'),(2,1,'Austria'),(2,2,'Autriche'),(3,1,'Belgium'),(3,2,'Belgique'),(4,1,'Canada'),(4,2,'Canada'),(5,1,'China'),(5,2,'Chine'),(6,1,'Spain'),(6,2,'Espagne'),(7,1,'Finland'),(7,2,'Finlande'),(8,1,'France'),(8,2,'France'),(9,1,'Greece'),(9,2,'Grèce'),(10,1,'Italy'),(10,2,'Italie'),(11,1,'Japan'),(11,2,'Japon'),(12,1,'Luxemburg'),(12,2,'Luxembourg'),(13,1,'Netherlands'),(13,2,'Pays-bas'),(14,1,'Poland'),(14,2,'Pologne'),(15,1,'Portugal'),(15,2,'Portugal'),(16,1,'Czech Republic'),(16,2,'République Tchèque'),(17,1,'United Kingdom'),(17,2,'Royaume-Uni'),(18,1,'Sweden'),(18,2,'Suède'),(19,1,'Switzerland'),(19,2,'Suisse'),(20,1,'Denmark'),(20,2,'Danemark'),(21,1,'USA'),(21,2,'USA'),(22,1,'HongKong'),(22,2,'Hong-Kong'),(23,1,'Norway'),(23,2,'Norvège'),(24,1,'Australia'),(24,2,'Australie'),(25,1,'Singapore'),(25,2,'Singapour'),(26,1,'Ireland'),(26,2,'Eire'),(27,1,'New Zealand'),(27,2,'Nouvelle-Zélande'),(28,1,'South Korea'),(28,2,'Corée du Sud'),(29,1,'Israel'),(29,2,'Israël'),(30,1,'South Africa'),(30,2,'Afrique du Sud'),(31,1,'Nigeria'),(31,2,'Nigeria'),(32,1,'Ivory Coast'),(32,2,'Côte d\'Ivoire'),(33,1,'Togo'),(33,2,'Togo'),(34,1,'Bolivia'),(34,2,'Bolivie'); +/*!40000 ALTER TABLE `ps_country_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_customer` +-- + +DROP TABLE IF EXISTS `ps_customer`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_customer` ( + `id_customer` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_gender` int(10) unsigned NOT NULL, + `secure_key` varchar(32) NOT NULL DEFAULT '-1', + `email` varchar(128) NOT NULL, + `passwd` varchar(32) NOT NULL, + `last_passwd_gen` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `birthday` date DEFAULT NULL, + `lastname` varchar(32) NOT NULL, + `newsletter` tinyint(1) unsigned NOT NULL DEFAULT '0', + `ip_registration_newsletter` varchar(15) DEFAULT NULL, + `newsletter_date_add` datetime DEFAULT NULL, + `optin` tinyint(1) unsigned NOT NULL DEFAULT '0', + `firstname` varchar(32) NOT NULL, + `active` tinyint(1) unsigned NOT NULL DEFAULT '0', + `deleted` tinyint(1) NOT NULL DEFAULT '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_customer`), + UNIQUE KEY `customer_email` (`email`), + KEY `customer_login` (`email`,`passwd`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_customer` +-- + +LOCK TABLES `ps_customer` WRITE; +/*!40000 ALTER TABLE `ps_customer` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_customer` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_lang` +-- + +DROP TABLE IF EXISTS `ps_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_lang` ( + `id_lang` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(32) NOT NULL, + `active` tinyint(3) unsigned NOT NULL DEFAULT '0', + `iso_code` char(2) NOT NULL, + PRIMARY KEY (`id_lang`), + KEY `lang_iso_code` (`iso_code`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_lang` +-- + +LOCK TABLES `ps_lang` WRITE; +/*!40000 ALTER TABLE `ps_lang` DISABLE KEYS */; +INSERT INTO `ps_lang` VALUES (1,'English (English)',1,'en'),(2,'Français (French)',1,'fr'); +/*!40000 ALTER TABLE `ps_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_manufacturer` +-- + +DROP TABLE IF EXISTS `ps_manufacturer`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_manufacturer` ( + `id_manufacturer` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(64) NOT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_manufacturer`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_manufacturer` +-- + +LOCK TABLES `ps_manufacturer` WRITE; +/*!40000 ALTER TABLE `ps_manufacturer` DISABLE KEYS */; +INSERT INTO `ps_manufacturer` VALUES (1,'Apple Computer, Inc','2009-06-09 11:36:02','2009-06-09 11:36:02'),(2,'Shure Incorporated','2009-06-09 11:36:02','2009-06-09 11:36:02'); +/*!40000 ALTER TABLE `ps_manufacturer` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_manufacturer_lang` +-- + +DROP TABLE IF EXISTS `ps_manufacturer_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_manufacturer_lang` ( + `id_manufacturer` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `description` text, + PRIMARY KEY (`id_manufacturer`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_manufacturer_lang` +-- + +LOCK TABLES `ps_manufacturer_lang` WRITE; +/*!40000 ALTER TABLE `ps_manufacturer_lang` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_manufacturer_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_state` +-- + +DROP TABLE IF EXISTS `ps_state`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_state` ( + `id_state` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_country` int(11) NOT NULL, + `id_zone` int(11) NOT NULL, + `name` varchar(64) NOT NULL, + `iso_code` varchar(3) NOT NULL, + `tax_behavior` smallint(1) NOT NULL DEFAULT '0', + `active` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id_state`) +) ENGINE=MyISAM AUTO_INCREMENT=53 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_state` +-- + +LOCK TABLES `ps_state` WRITE; +/*!40000 ALTER TABLE `ps_state` DISABLE KEYS */; +INSERT INTO `ps_state` VALUES (1,21,2,'Alabama','AL',0,1),(2,21,2,'Alaska','AK',0,1),(3,21,2,'Arizona','AZ',0,1),(4,21,2,'Arkansas','AR',0,1),(5,21,2,'California','CA',0,1),(6,21,2,'Colorado','CO',0,1),(7,21,2,'Connecticut','CT',0,1),(8,21,2,'Delaware','DE',0,1),(9,21,2,'Florida','FL',0,1),(10,21,2,'Georgia','GA',0,1),(11,21,2,'Hawaii','HI',0,1),(12,21,2,'Idaho','ID',0,1),(13,21,2,'Illinois','IL',0,1),(14,21,2,'Indiana','IN',0,1),(15,21,2,'Iowa','IA',0,1),(16,21,2,'Kansas','KS',0,1),(17,21,2,'Kentucky','KY',0,1),(18,21,2,'Louisiana','LA',0,1),(19,21,2,'Maine','ME',0,1),(20,21,2,'Maryland','MD',0,1),(21,21,2,'Massachusetts','MA',0,1),(22,21,2,'Michigan','MI',0,1),(23,21,2,'Minnesota','MN',0,1),(24,21,2,'Mississippi','MS',0,1),(25,21,2,'Missouri','MO',0,1),(26,21,2,'Montana','MT',0,1),(27,21,2,'Nebraska','NE',0,1),(28,21,2,'Nevada','NV',0,1),(29,21,2,'New Hampshire','NH',0,1),(30,21,2,'New Jersey','NJ',0,1),(31,21,2,'New Mexico','NM',0,1),(32,21,2,'New York','NY',0,1),(33,21,2,'North Carolina','NC',0,1),(34,21,2,'North Dakota','ND',0,1),(35,21,2,'Ohio','OH',0,1),(36,21,2,'Oklahoma','OK',0,1),(37,21,2,'Oregon','OR',0,1),(38,21,2,'Pennsylvania','PA',0,1),(39,21,2,'Rhode Island','RI',0,1),(40,21,2,'South Carolina','SC',0,1),(41,21,2,'South Dakota','SD',0,1),(42,21,2,'Tennessee','TN',0,1),(43,21,2,'Texas','TX',0,1),(44,21,2,'Utah','UT',0,1),(45,21,2,'Vermont','VT',0,1),(46,21,2,'Virginia','VA',0,1),(47,21,2,'Washington','WA',0,1),(48,21,2,'West Virginia','WV',0,1),(49,21,2,'Wisconsin','WI',0,1),(50,21,2,'Wyoming','WY',0,1),(51,21,2,'Puerto Rico','PR',0,1),(52,21,2,'US Virgin Islands','VI',0,1); +/*!40000 ALTER TABLE `ps_state` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_supplier` +-- + +DROP TABLE IF EXISTS `ps_supplier`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_supplier` ( + `id_supplier` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(64) NOT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_supplier`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_supplier` +-- + +LOCK TABLES `ps_supplier` WRITE; +/*!40000 ALTER TABLE `ps_supplier` DISABLE KEYS */; +INSERT INTO `ps_supplier` VALUES (1,'AppleStore','2009-06-09 11:36:02','2009-06-09 11:36:02'),(2,'Shure Online Store','2009-06-09 11:36:02','2009-06-09 11:36:02'); +/*!40000 ALTER TABLE `ps_supplier` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_supplier_lang` +-- + +DROP TABLE IF EXISTS `ps_supplier_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_supplier_lang` ( + `id_supplier` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `description` text, + PRIMARY KEY (`id_supplier`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_supplier_lang` +-- + +LOCK TABLES `ps_supplier_lang` WRITE; +/*!40000 ALTER TABLE `ps_supplier_lang` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_supplier_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_zone` +-- + +DROP TABLE IF EXISTS `ps_zone`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_zone` ( + `id_zone` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(64) NOT NULL, + `active` tinyint(1) unsigned NOT NULL DEFAULT '0', + `enabled` tinyint(1) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id_zone`) +) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_zone` +-- + +LOCK TABLES `ps_zone` WRITE; +/*!40000 ALTER TABLE `ps_zone` DISABLE KEYS */; +INSERT INTO `ps_zone` VALUES (1,'Europe',1,1),(2,'US',1,1),(3,'Asia',1,1),(4,'Africa',1,1),(5,'Oceania',1,1); +/*!40000 ALTER TABLE `ps_zone` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2009-10-15 8:39:34 diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_00_init_tables.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_00_init_tables.sql new file mode 100644 index 0000000000000000000000000000000000000000..3ba2a6398707dfd8b378603f5399ce42878a741d --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_00_init_tables.sql @@ -0,0 +1,3643 @@ +-- MySQL dump 10.11 +-- +-- Host: localhost Database: ps_dump +-- ------------------------------------------------------ +-- Server version 5.0.87-Max + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `ps_access` +-- + +DROP TABLE IF EXISTS `ps_access`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_access` ( + `id_profile` int(10) unsigned NOT NULL, + `id_tab` int(10) unsigned NOT NULL, + `view` int(11) NOT NULL, + `add` int(11) NOT NULL, + `edit` int(11) NOT NULL, + `delete` int(11) NOT NULL, + PRIMARY KEY (`id_profile`,`id_tab`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_access` +-- + +LOCK TABLES `ps_access` WRITE; +/*!40000 ALTER TABLE `ps_access` DISABLE KEYS */; +INSERT INTO `ps_access` VALUES (1,1,1,1,1,1),(1,2,1,1,1,1),(1,3,1,1,1,1),(1,4,1,1,1,1),(1,5,1,1,1,1),(1,6,1,1,1,1),(1,7,1,1,1,1),(1,8,1,1,1,1),(1,9,1,1,1,1),(1,10,1,1,1,1),(1,11,1,1,1,1),(1,12,1,1,1,1),(1,13,1,1,1,1),(1,14,1,1,1,1),(1,15,1,1,1,1),(1,16,1,1,1,1),(1,17,1,1,1,1),(1,18,1,1,1,1),(1,19,1,1,1,1),(1,20,1,1,1,1),(1,21,1,1,1,1),(1,22,1,1,1,1),(1,23,1,1,1,1),(1,24,1,1,1,1),(1,26,1,1,1,1),(1,27,1,1,1,1),(1,28,1,1,1,1),(1,29,1,1,1,1),(1,30,1,1,1,1),(1,31,1,1,1,1),(1,32,1,1,1,1),(1,33,1,1,1,1),(1,34,1,1,1,1),(1,35,1,1,1,1),(1,36,1,1,1,1),(1,37,1,1,1,1),(1,38,1,1,1,1),(1,39,1,1,1,1),(1,40,1,1,1,1),(1,41,1,1,1,1),(1,42,1,1,1,1),(1,43,1,1,1,1),(1,44,1,1,1,1),(1,46,1,1,1,1),(1,47,1,1,1,1),(1,48,1,1,1,1),(1,49,1,1,1,1),(1,50,1,1,1,1),(1,51,1,1,1,1),(1,52,1,1,1,1),(1,53,1,1,1,1),(1,54,1,1,1,1),(1,55,1,1,1,1),(1,56,1,1,1,1),(1,57,1,1,1,1),(1,58,1,1,1,1),(1,59,1,1,1,1),(1,60,1,1,1,1),(1,61,1,1,1,1),(1,62,1,1,1,1),(1,63,1,1,1,1),(1,64,1,1,1,1),(1,65,1,1,1,1),(1,66,1,1,1,1),(1,67,1,1,1,1),(1,68,1,1,1,1); +/*!40000 ALTER TABLE `ps_access` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_accessory` +-- + +DROP TABLE IF EXISTS `ps_accessory`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_accessory` ( + `id_product_1` int(10) unsigned NOT NULL, + `id_product_2` int(10) unsigned NOT NULL, + KEY `accessory_product` (`id_product_1`,`id_product_2`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_accessory` +-- + +LOCK TABLES `ps_accessory` WRITE; +/*!40000 ALTER TABLE `ps_accessory` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_accessory` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_address` +-- + +DROP TABLE IF EXISTS `ps_address`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_address` ( + `id_address` int(10) unsigned NOT NULL auto_increment, + `id_country` int(10) unsigned NOT NULL, + `id_state` int(10) unsigned default NULL, + `id_customer` int(10) unsigned NOT NULL default '0', + `id_manufacturer` int(10) unsigned NOT NULL default '0', + `id_supplier` int(10) unsigned NOT NULL default '0', + `alias` varchar(32) NOT NULL, + `company` varchar(32) default NULL, + `lastname` varchar(32) NOT NULL, + `firstname` varchar(32) NOT NULL, + `address1` varchar(128) NOT NULL, + `address2` varchar(128) default NULL, + `postcode` varchar(12) default NULL, + `city` varchar(64) NOT NULL, + `other` text, + `phone` varchar(16) default NULL, + `phone_mobile` varchar(16) default NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + `active` tinyint(1) unsigned NOT NULL default '1', + `deleted` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_address`), + KEY `address_customer` (`id_customer`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_address` +-- + +LOCK TABLES `ps_address` WRITE; +/*!40000 ALTER TABLE `ps_address` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_address` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_alias` +-- + +DROP TABLE IF EXISTS `ps_alias`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_alias` ( + `id_alias` int(10) unsigned NOT NULL auto_increment, + `alias` varchar(255) NOT NULL, + `search` varchar(255) NOT NULL, + `active` tinyint(1) NOT NULL default '1', + PRIMARY KEY (`id_alias`), + UNIQUE KEY `alias` (`alias`) +) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_alias` +-- + +LOCK TABLES `ps_alias` WRITE; +/*!40000 ALTER TABLE `ps_alias` DISABLE KEYS */; +INSERT INTO `ps_alias` VALUES (4,'piod','ipod',1),(3,'ipdo','ipod',1); +/*!40000 ALTER TABLE `ps_alias` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_attachment` +-- + +DROP TABLE IF EXISTS `ps_attachment`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_attachment` ( + `id_attachment` int(10) unsigned NOT NULL auto_increment, + `file` varchar(40) NOT NULL, + `mime` varchar(32) NOT NULL, + PRIMARY KEY (`id_attachment`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_attachment` +-- + +LOCK TABLES `ps_attachment` WRITE; +/*!40000 ALTER TABLE `ps_attachment` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_attachment` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_attachment_lang` +-- + +DROP TABLE IF EXISTS `ps_attachment_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_attachment_lang` ( + `id_attachment` int(10) unsigned NOT NULL auto_increment, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(32) default NULL, + `description` text, + PRIMARY KEY (`id_attachment`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_attachment_lang` +-- + +LOCK TABLES `ps_attachment_lang` WRITE; +/*!40000 ALTER TABLE `ps_attachment_lang` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_attachment_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_attribute` +-- + +DROP TABLE IF EXISTS `ps_attribute`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_attribute` ( + `id_attribute` int(10) unsigned NOT NULL auto_increment, + `id_attribute_group` int(10) unsigned NOT NULL, + `color` varchar(32) default NULL, + PRIMARY KEY (`id_attribute`), + KEY `attribute_group` (`id_attribute_group`) +) ENGINE=MyISAM AUTO_INCREMENT=21 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_attribute` +-- + +LOCK TABLES `ps_attribute` WRITE; +/*!40000 ALTER TABLE `ps_attribute` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_attribute` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_attribute_group` +-- + +DROP TABLE IF EXISTS `ps_attribute_group`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_attribute_group` ( + `id_attribute_group` int(10) unsigned NOT NULL auto_increment, + `is_color_group` tinyint(1) NOT NULL default '0', + PRIMARY KEY (`id_attribute_group`) +) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_attribute_group` +-- + +LOCK TABLES `ps_attribute_group` WRITE; +/*!40000 ALTER TABLE `ps_attribute_group` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_attribute_group` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_attribute_group_lang` +-- + +DROP TABLE IF EXISTS `ps_attribute_group_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_attribute_group_lang` ( + `id_attribute_group` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(128) NOT NULL, + `public_name` varchar(64) NOT NULL, + PRIMARY KEY (`id_attribute_group`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_attribute_group_lang` +-- + +LOCK TABLES `ps_attribute_group_lang` WRITE; +/*!40000 ALTER TABLE `ps_attribute_group_lang` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_attribute_group_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_attribute_impact` +-- + +DROP TABLE IF EXISTS `ps_attribute_impact`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_attribute_impact` ( + `id_attribute_impact` int(10) unsigned NOT NULL auto_increment, + `id_product` int(11) NOT NULL, + `id_attribute` int(11) NOT NULL, + `weight` float NOT NULL, + `price` decimal(10,2) NOT NULL, + PRIMARY KEY (`id_attribute_impact`), + UNIQUE KEY `id_product` (`id_product`,`id_attribute`) +) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_attribute_impact` +-- + +LOCK TABLES `ps_attribute_impact` WRITE; +/*!40000 ALTER TABLE `ps_attribute_impact` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_attribute_impact` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_attribute_lang` +-- + +DROP TABLE IF EXISTS `ps_attribute_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_attribute_lang` ( + `id_attribute` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(128) NOT NULL, + PRIMARY KEY (`id_attribute`,`id_lang`), + KEY `id_lang` (`id_lang`,`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_attribute_lang` +-- + +LOCK TABLES `ps_attribute_lang` WRITE; +/*!40000 ALTER TABLE `ps_attribute_lang` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_attribute_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_block_cms` +-- + +DROP TABLE IF EXISTS `ps_block_cms`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_block_cms` ( + `id_block` int(10) NOT NULL, + `id_cms` int(10) NOT NULL, + PRIMARY KEY (`id_block`,`id_cms`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_block_cms` +-- + +LOCK TABLES `ps_block_cms` WRITE; +/*!40000 ALTER TABLE `ps_block_cms` DISABLE KEYS */; +INSERT INTO `ps_block_cms` VALUES (12,1),(12,2),(12,3),(12,4),(23,3),(23,4); +/*!40000 ALTER TABLE `ps_block_cms` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_carrier` +-- + +DROP TABLE IF EXISTS `ps_carrier`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_carrier` ( + `id_carrier` int(10) unsigned NOT NULL auto_increment, + `id_tax` int(10) unsigned default '0', + `name` varchar(64) NOT NULL, + `url` varchar(255) default NULL, + `active` tinyint(1) unsigned NOT NULL default '0', + `deleted` tinyint(1) unsigned NOT NULL default '0', + `shipping_handling` tinyint(1) unsigned NOT NULL default '1', + `range_behavior` tinyint(1) unsigned NOT NULL default '0', + `is_module` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_carrier`), + KEY `deleted` (`deleted`,`active`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_carrier` +-- + +LOCK TABLES `ps_carrier` WRITE; +/*!40000 ALTER TABLE `ps_carrier` DISABLE KEYS */; +INSERT INTO `ps_carrier` VALUES (1,0,'0',NULL,1,0,0,0,0),(2,1,'My carrier',NULL,1,0,1,0,0); +/*!40000 ALTER TABLE `ps_carrier` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_carrier_lang` +-- + +DROP TABLE IF EXISTS `ps_carrier_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_carrier_lang` ( + `id_carrier` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `delay` varchar(128) default NULL, + UNIQUE KEY `shipper_lang_index` (`id_lang`,`id_carrier`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_carrier_lang` +-- + +LOCK TABLES `ps_carrier_lang` WRITE; +/*!40000 ALTER TABLE `ps_carrier_lang` DISABLE KEYS */; +INSERT INTO `ps_carrier_lang` VALUES (1,1,'Pick up in-store'),(1,2,'Retrait au magasin'),(2,1,'Delivery next day!'),(2,2,'Livraison le lendemain !'); +/*!40000 ALTER TABLE `ps_carrier_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_carrier_zone` +-- + +DROP TABLE IF EXISTS `ps_carrier_zone`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_carrier_zone` ( + `id_carrier` int(10) unsigned NOT NULL, + `id_zone` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_carrier`,`id_zone`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_carrier_zone` +-- + +LOCK TABLES `ps_carrier_zone` WRITE; +/*!40000 ALTER TABLE `ps_carrier_zone` DISABLE KEYS */; +INSERT INTO `ps_carrier_zone` VALUES (1,1),(2,1),(2,2); +/*!40000 ALTER TABLE `ps_carrier_zone` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_cart` +-- + +DROP TABLE IF EXISTS `ps_cart`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_cart` ( + `id_cart` int(10) unsigned NOT NULL auto_increment, + `id_carrier` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `id_address_delivery` int(10) unsigned NOT NULL, + `id_address_invoice` int(10) unsigned NOT NULL, + `id_currency` int(10) unsigned NOT NULL, + `id_customer` int(10) unsigned NOT NULL, + `id_guest` int(10) unsigned NOT NULL, + `recyclable` tinyint(1) unsigned NOT NULL default '1', + `gift` tinyint(1) unsigned NOT NULL default '0', + `gift_message` text, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_cart`), + KEY `cart_customer` (`id_customer`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_cart` +-- + +LOCK TABLES `ps_cart` WRITE; +/*!40000 ALTER TABLE `ps_cart` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_cart` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_cart_discount` +-- + +DROP TABLE IF EXISTS `ps_cart_discount`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_cart_discount` ( + `id_cart` int(10) unsigned NOT NULL, + `id_discount` int(10) unsigned NOT NULL, + KEY `cart_discount_index` (`id_cart`,`id_discount`), + KEY `id_discount` (`id_discount`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_cart_discount` +-- + +LOCK TABLES `ps_cart_discount` WRITE; +/*!40000 ALTER TABLE `ps_cart_discount` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_cart_discount` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_cart_product` +-- + +DROP TABLE IF EXISTS `ps_cart_product`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_cart_product` ( + `id_cart` int(10) unsigned NOT NULL, + `id_product` int(10) unsigned NOT NULL, + `id_product_attribute` int(10) unsigned default NULL, + `quantity` int(10) unsigned NOT NULL default '0', + `date_add` datetime NOT NULL, + KEY `cart_product_index` (`id_cart`,`id_product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_cart_product` +-- + +LOCK TABLES `ps_cart_product` WRITE; +/*!40000 ALTER TABLE `ps_cart_product` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_cart_product` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_category` +-- + +DROP TABLE IF EXISTS `ps_category`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_category` ( + `id_category` int(10) unsigned NOT NULL auto_increment, + `id_parent` int(10) unsigned NOT NULL, + `level_depth` tinyint(3) unsigned NOT NULL default '0', + `active` tinyint(1) unsigned NOT NULL default '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_category`), + KEY `category_parent` (`id_parent`) +) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_category` +-- + +LOCK TABLES `ps_category` WRITE; +/*!40000 ALTER TABLE `ps_category` DISABLE KEYS */; +INSERT INTO `ps_category` VALUES (1,0,0,1,'2010-06-08 14:08:09','2010-06-08 14:08:09'),(2,1,1,1,'2010-06-08 14:08:09','2010-06-08 14:08:09'),(3,1,1,1,'2010-06-08 14:08:09','2010-06-08 14:08:09'),(4,1,1,1,'2010-06-08 14:08:09','2010-06-08 14:08:09'); +/*!40000 ALTER TABLE `ps_category` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_category_group` +-- + +DROP TABLE IF EXISTS `ps_category_group`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_category_group` ( + `id_category` int(10) unsigned NOT NULL, + `id_group` int(10) unsigned NOT NULL, + KEY `category_group_index` (`id_category`,`id_group`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_category_group` +-- + +LOCK TABLES `ps_category_group` WRITE; +/*!40000 ALTER TABLE `ps_category_group` DISABLE KEYS */; +INSERT INTO `ps_category_group` VALUES (1,1),(2,1),(3,1),(4,1); +/*!40000 ALTER TABLE `ps_category_group` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_category_lang` +-- + +DROP TABLE IF EXISTS `ps_category_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_category_lang` ( + `id_category` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(128) NOT NULL, + `description` text, + `link_rewrite` varchar(128) NOT NULL, + `meta_title` varchar(128) default NULL, + `meta_keywords` varchar(128) default NULL, + `meta_description` varchar(128) default NULL, + UNIQUE KEY `category_lang_index` (`id_category`,`id_lang`), + KEY `category_name` (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_category_lang` +-- + +LOCK TABLES `ps_category_lang` WRITE; +/*!40000 ALTER TABLE `ps_category_lang` DISABLE KEYS */; +INSERT INTO `ps_category_lang` VALUES (1,1,'Home','','home',NULL,NULL,NULL),(1,2,'Accueil','','home',NULL,NULL,NULL),(2,1,'iPods','Now that you can buy movies from the iTunes Store and sync them to your iPod, the whole world is your theater.','music-ipods','','',''),(2,2,'iPods','Il est temps, pour le meilleur lecteur de musique, de remonter sur scène pour un rappel. Avec le nouvel iPod, le monde est votre scène.','musique-ipods','','',''),(3,1,'Accessories','Wonderful accessories for your iPod','accessories-ipod','','',''),(3,2,'Accessoires','Tous les accessoires à la mode pour votre iPod','accessoires-ipod','','',''),(4,1,'Laptops','The latest Intel processor, a bigger hard drive, plenty of memory, and even more new features all fit inside just one liberating inch. The new Mac laptops have the performance, power, and connectivity of a desktop computer. Without the desk part.','laptops','Apple laptops','Apple laptops MacBook Air','Powerful and chic Apple laptops'),(4,2,'Portables','Le tout dernier processeur Intel, un disque dur plus spacieux, de la mémoire à profusion et d\'autres nouveautés. Le tout, dans à peine 2,59 cm qui vous libèrent de toute entrave. Les nouveaux portables Mac réunissent les performances, la puissance et la connectivité d\'un ordinateur de bureau. Sans la partie bureau.','portables-apple','Portables Apple','portables apple macbook air','portables apple puissants et design'); +/*!40000 ALTER TABLE `ps_category_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_category_product` +-- + +DROP TABLE IF EXISTS `ps_category_product`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_category_product` ( + `id_category` int(10) unsigned NOT NULL, + `id_product` int(10) unsigned NOT NULL, + `position` int(10) unsigned NOT NULL default '0', + KEY `category_product_index` (`id_category`,`id_product`), + KEY `id_product` (`id_product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_category_product` +-- + +LOCK TABLES `ps_category_product` WRITE; +/*!40000 ALTER TABLE `ps_category_product` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_category_product` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_cms` +-- + +DROP TABLE IF EXISTS `ps_cms`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_cms` ( + `id_cms` int(10) unsigned NOT NULL auto_increment, + PRIMARY KEY (`id_cms`) +) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_cms` +-- + +LOCK TABLES `ps_cms` WRITE; +/*!40000 ALTER TABLE `ps_cms` DISABLE KEYS */; +INSERT INTO `ps_cms` VALUES (1),(2),(3),(4),(5); +/*!40000 ALTER TABLE `ps_cms` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_cms_lang` +-- + +DROP TABLE IF EXISTS `ps_cms_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_cms_lang` ( + `id_cms` int(10) unsigned NOT NULL auto_increment, + `id_lang` int(10) unsigned NOT NULL, + `meta_title` varchar(128) NOT NULL, + `meta_description` varchar(255) default NULL, + `meta_keywords` varchar(255) default NULL, + `content` longtext, + `link_rewrite` varchar(128) NOT NULL, + PRIMARY KEY (`id_cms`,`id_lang`) +) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_cms_lang` +-- + +LOCK TABLES `ps_cms_lang` WRITE; +/*!40000 ALTER TABLE `ps_cms_lang` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_cms_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_configuration` +-- + +DROP TABLE IF EXISTS `ps_configuration`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_configuration` ( + `id_configuration` int(10) unsigned NOT NULL auto_increment, + `name` varchar(32) NOT NULL, + `value` text, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_configuration`), + UNIQUE KEY `name` (`name`) +) ENGINE=MyISAM AUTO_INCREMENT=83 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_configuration` +-- + +LOCK TABLES `ps_configuration` WRITE; +/*!40000 ALTER TABLE `ps_configuration` DISABLE KEYS */; +INSERT INTO `ps_configuration` VALUES (1,'PS_LANG_DEFAULT','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(2,'PS_CURRENCY_DEFAULT','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(3,'PS_COUNTRY_DEFAULT','8','2010-06-08 14:08:09','2010-06-08 14:08:09'),(4,'PS_REWRITING_SETTINGS','0','2010-06-08 14:08:09','2010-06-08 14:08:09'),(5,'PS_ORDER_OUT_OF_STOCK','0','2010-06-08 14:08:09','2010-06-08 14:08:09'),(6,'PS_LAST_QTIES','3','2010-06-08 14:08:09','2010-06-08 14:08:09'),(7,'PS_CART_REDIRECT','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(8,'PS_HELPBOX','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(9,'PS_CONDITIONS','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(10,'PS_RECYCLABLE_PACK','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(11,'PS_GIFT_WRAPPING','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(12,'PS_GIFT_WRAPPING_PRICE','0','2010-06-08 14:08:09','2010-06-08 14:08:09'),(13,'PS_STOCK_MANAGEMENT','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(14,'PS_NAVIGATION_PIPE','>','2010-06-08 14:08:09','2010-06-08 14:08:09'),(15,'PS_PRODUCTS_PER_PAGE','10','2010-06-08 14:08:09','2010-06-08 14:08:09'),(16,'PS_PURCHASE_MINIMUM','0','2010-06-08 14:08:09','2010-06-08 14:08:09'),(17,'PS_PRODUCTS_ORDER_WAY','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(18,'PS_PRODUCTS_ORDER_BY','4','2010-06-08 14:08:09','2010-06-08 14:08:09'),(19,'PS_DISPLAY_QTIES','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(20,'PS_SHIPPING_HANDLING','2','2010-06-08 14:08:09','2010-06-08 14:08:09'),(21,'PS_SHIPPING_FREE_PRICE','300','2010-06-08 14:08:09','2010-06-08 14:08:09'),(22,'PS_SHIPPING_FREE_WEIGHT','20','2010-06-08 14:08:09','2010-06-08 14:08:09'),(23,'PS_SHIPPING_METHOD','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(24,'PS_TAX','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(25,'PS_SHOP_ENABLE','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(26,'PS_NB_DAYS_NEW_PRODUCT','20','2010-06-08 14:08:09','2010-06-08 14:08:09'),(27,'PS_SSL_ENABLED','0','2010-06-08 14:08:09','2010-06-08 14:08:09'),(28,'PS_WEIGHT_UNIT','kg','2010-06-08 14:08:09','2010-06-08 14:08:09'),(29,'PS_BLOCK_CART_AJAX','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(30,'PS_ORDER_RETURN','0','2010-06-08 14:08:09','2010-06-08 14:08:09'),(31,'PS_ORDER_RETURN_NB_DAYS','7','2010-06-08 14:08:09','2010-06-08 14:08:09'),(32,'PS_MAIL_TYPE','3','2010-06-08 14:08:09','2010-06-08 14:08:09'),(33,'PS_PRODUCT_PICTURE_MAX_SIZE','131072','2010-06-08 14:08:09','2010-06-08 14:08:09'),(34,'PS_PRODUCT_PICTURE_WIDTH','64','2010-06-08 14:08:09','2010-06-08 14:08:09'),(35,'PS_PRODUCT_PICTURE_HEIGHT','64','2010-06-08 14:08:09','2010-06-08 14:08:09'),(36,'PS_INVOICE_PREFIX','IN','2010-06-08 14:08:09','2010-06-08 14:08:09'),(37,'PS_INVOICE_NUMBER','2','2010-06-08 14:08:09','2010-06-08 14:08:09'),(38,'PS_DELIVERY_PREFIX','DE','2010-06-08 14:08:09','2010-06-08 14:08:09'),(39,'PS_DELIVERY_NUMBER','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(40,'PS_INVOICE','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(41,'PS_PASSWD_TIME_BACK','360','2010-06-08 14:08:09','2010-06-08 14:08:09'),(42,'PS_PASSWD_TIME_FRONT','360','2010-06-08 14:08:09','2010-06-08 14:08:09'),(43,'PS_DISP_UNAVAILABLE_ATTR','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(44,'PS_VOUCHERS','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(45,'PS_SEARCH_MINWORDLEN','3','2010-06-08 14:08:09','2010-06-08 14:08:09'),(46,'PS_SEARCH_BLACKLIST','','2010-06-08 14:08:09','2010-06-08 14:08:09'),(47,'PS_SEARCH_WEIGHT_PNAME','6','2010-06-08 14:08:09','2010-06-08 14:08:09'),(48,'PS_SEARCH_WEIGHT_REF','10','2010-06-08 14:08:09','2010-06-08 14:08:09'),(49,'PS_SEARCH_WEIGHT_SHORTDESC','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(50,'PS_SEARCH_WEIGHT_DESC','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(51,'PS_SEARCH_WEIGHT_CNAME','3','2010-06-08 14:08:09','2010-06-08 14:08:09'),(52,'PS_SEARCH_WEIGHT_MNAME','3','2010-06-08 14:08:09','2010-06-08 14:08:09'),(53,'PS_SEARCH_WEIGHT_TAG','4','2010-06-08 14:08:09','2010-06-08 14:08:09'),(54,'PS_SEARCH_WEIGHT_ATTRIBUTE','2','2010-06-08 14:08:09','2010-06-08 14:08:09'),(55,'PS_SEARCH_WEIGHT_FEATURE','2','2010-06-08 14:08:09','2010-06-08 14:08:09'),(56,'PS_SEARCH_AJAX','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(57,'PS_TIMEZONE','374','2010-06-08 14:08:09','2010-06-08 14:08:09'),(58,'PS_THEME_V11','0','2010-06-08 14:08:09','2010-06-08 14:08:09'),(59,'PS_CARRIER_DEFAULT','2','2010-06-08 14:08:09','2010-06-08 14:08:09'),(60,'PAYPAL_BUSINESS','paypal@prestashop.com','2010-06-08 14:08:09','2010-06-08 14:08:09'),(61,'PAYPAL_SANDBOX','0','2010-06-08 14:08:09','2010-06-08 14:08:09'),(62,'PAYPAL_CURRENCY','customer','2010-06-08 14:08:09','2010-06-08 14:08:09'),(63,'BANK_WIRE_CURRENCIES','2,1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(64,'CHEQUE_CURRENCIES','2,1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(65,'PRODUCTS_VIEWED_NBR','2','2010-06-08 14:08:09','2010-06-08 14:08:09'),(66,'BLOCK_CATEG_DHTML','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(67,'BLOCK_CATEG_MAX_DEPTH','3','2010-06-08 14:08:09','2010-06-08 14:08:09'),(68,'MANUFACTURER_DISPLAY_FORM','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(69,'MANUFACTURER_DISPLAY_TEXT','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(70,'MANUFACTURER_DISPLAY_TEXT_NB','5','2010-06-08 14:08:09','2010-06-08 14:08:09'),(71,'NEW_PRODUCTS_NBR','5','2010-06-08 14:08:09','2010-06-08 14:08:09'),(72,'STATSHOME_YEAR_FROM','2010','2010-06-08 14:08:09','2010-06-08 14:08:09'),(73,'STATSHOME_MONTH_FROM','06','2010-06-08 14:08:09','2010-06-08 14:08:09'),(74,'STATSHOME_DAY_FROM','08','2010-06-08 14:08:09','2010-06-08 14:08:09'),(75,'STATSHOME_YEAR_TO','2010','2010-06-08 14:08:09','2010-06-08 14:08:09'),(76,'STATSHOME_MONTH_TO','06','2010-06-08 14:08:09','2010-06-08 14:08:09'),(77,'STATSHOME_DAY_TO','08','2010-06-08 14:08:09','2010-06-08 14:08:09'),(78,'PS_TOKEN_ENABLE','1','2010-06-08 14:08:09','2010-06-08 14:08:09'),(79,'PS_STATS_RENDER','graphxmlswfcharts','2010-06-08 14:08:09','2010-06-08 14:08:09'),(80,'PS_STATS_OLD_CONNECT_AUTO_CLEAN','never','2010-06-08 14:08:09','2010-06-08 14:08:09'),(81,'PS_STATS_GRID_RENDER','gridextjs','2010-06-08 14:08:09','2010-06-08 14:08:09'),(82,'BLOCKTAGS_NBR','10','2010-06-08 14:08:09','2010-06-08 14:08:09'); +/*!40000 ALTER TABLE `ps_configuration` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_configuration_lang` +-- + +DROP TABLE IF EXISTS `ps_configuration_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_configuration_lang` ( + `id_configuration` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `value` text, + `date_upd` datetime default NULL, + PRIMARY KEY (`id_configuration`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_configuration_lang` +-- + +LOCK TABLES `ps_configuration_lang` WRITE; +/*!40000 ALTER TABLE `ps_configuration_lang` DISABLE KEYS */; +INSERT INTO `ps_configuration_lang` VALUES (36,1,'IN','2010-06-08 14:08:09'),(36,2,'FA','2010-06-08 14:08:09'),(38,1,'DE','2010-06-08 14:08:09'),(38,2,'LI','2010-06-08 14:08:09'),(46,1,'a|the|of|on|in|and|to','2010-06-08 14:08:09'),(46,2,'le|les|de|et|en|des|les|une','2010-06-08 14:08:09'); +/*!40000 ALTER TABLE `ps_configuration_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_connections` +-- + +DROP TABLE IF EXISTS `ps_connections`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_connections` ( + `id_connections` int(10) unsigned NOT NULL auto_increment, + `id_guest` int(10) unsigned NOT NULL, + `id_page` int(10) unsigned NOT NULL, + `ip_address` varchar(16) default NULL, + `date_add` datetime NOT NULL, + `http_referer` varchar(255) default NULL, + PRIMARY KEY (`id_connections`), + KEY `id_guest` (`id_guest`), + KEY `date_add` (`date_add`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_connections` +-- + +LOCK TABLES `ps_connections` WRITE; +/*!40000 ALTER TABLE `ps_connections` DISABLE KEYS */; +INSERT INTO `ps_connections` VALUES (1,1,1,'2130706433','2010-06-08 14:08:09','http://www.prestashop.com'); +/*!40000 ALTER TABLE `ps_connections` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_connections_page` +-- + +DROP TABLE IF EXISTS `ps_connections_page`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_connections_page` ( + `id_connections` int(10) unsigned NOT NULL, + `id_page` int(10) unsigned NOT NULL, + `time_start` datetime NOT NULL, + `time_end` datetime default NULL, + PRIMARY KEY (`id_connections`,`id_page`,`time_start`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_connections_page` +-- + +LOCK TABLES `ps_connections_page` WRITE; +/*!40000 ALTER TABLE `ps_connections_page` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_connections_page` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_connections_source` +-- + +DROP TABLE IF EXISTS `ps_connections_source`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_connections_source` ( + `id_connections_source` int(10) unsigned NOT NULL auto_increment, + `id_connections` int(10) unsigned NOT NULL, + `http_referer` varchar(255) default NULL, + `request_uri` varchar(255) default NULL, + `keywords` varchar(255) default NULL, + `date_add` datetime NOT NULL, + PRIMARY KEY (`id_connections_source`), + KEY `connections` (`id_connections`), + KEY `orderby` (`date_add`), + KEY `http_referer` (`http_referer`), + KEY `request_uri` (`request_uri`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_connections_source` +-- + +LOCK TABLES `ps_connections_source` WRITE; +/*!40000 ALTER TABLE `ps_connections_source` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_connections_source` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_contact` +-- + +DROP TABLE IF EXISTS `ps_contact`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_contact` ( + `id_contact` int(10) unsigned NOT NULL auto_increment, + `email` varchar(128) NOT NULL, + `position` tinyint(2) unsigned NOT NULL default '0', + PRIMARY KEY (`id_contact`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_contact` +-- + +LOCK TABLES `ps_contact` WRITE; +/*!40000 ALTER TABLE `ps_contact` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_contact` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_contact_lang` +-- + +DROP TABLE IF EXISTS `ps_contact_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_contact_lang` ( + `id_contact` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(32) NOT NULL, + `description` text, + UNIQUE KEY `contact_lang_index` (`id_contact`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_contact_lang` +-- + +LOCK TABLES `ps_contact_lang` WRITE; +/*!40000 ALTER TABLE `ps_contact_lang` DISABLE KEYS */; +INSERT INTO `ps_contact_lang` VALUES (1,1,'Webmaster','If a technical problem occurs on this website'),(1,2,'Webmaster','Si un problème technique survient sur le site'),(2,1,'Customer service','For any question about a product, an order'),(2,2,'Service client','Pour toute question ou réclamation sur une commande'); +/*!40000 ALTER TABLE `ps_contact_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_country` +-- + +DROP TABLE IF EXISTS `ps_country`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_country` ( + `id_country` int(10) unsigned NOT NULL auto_increment, + `id_zone` int(10) unsigned NOT NULL, + `iso_code` varchar(3) NOT NULL, + `active` tinyint(1) unsigned NOT NULL default '0', + `contains_states` tinyint(1) NOT NULL default '0', + PRIMARY KEY (`id_country`), + KEY `country_iso_code` (`iso_code`), + KEY `country_` (`id_zone`) +) ENGINE=MyISAM AUTO_INCREMENT=245 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_country` +-- + +LOCK TABLES `ps_country` WRITE; +/*!40000 ALTER TABLE `ps_country` DISABLE KEYS */; +INSERT INTO `ps_country` VALUES (1,1,'DE',1,0),(2,1,'AT',1,0),(3,1,'BE',1,0),(4,2,'CA',1,0),(5,3,'CN',1,0),(6,1,'ES',1,0),(7,1,'FI',1,0),(8,1,'FR',1,0),(9,1,'GR',1,0),(10,1,'IT',1,0),(11,3,'JP',1,0),(12,1,'LU',1,0),(13,1,'NL',1,0),(14,1,'PL',1,0),(15,1,'PT',1,0),(16,1,'CZ',1,0),(17,1,'GB',1,0),(18,1,'SE',1,0),(19,1,'CH',1,0),(20,1,'DK',1,0),(21,2,'US',1,1),(22,3,'HK',1,0),(23,1,'NO',1,0),(24,5,'AU',1,0),(25,3,'SG',1,0),(26,1,'IE',1,0),(27,5,'NZ',1,0),(28,3,'KR',1,0),(29,3,'IL',1,0),(30,4,'ZA',1,0),(31,4,'NG',1,0),(32,4,'CI',1,0),(33,4,'TG',1,0),(34,2,'BO',1,0),(35,4,'MU',1,0),(143,1,'HU',1,0),(36,1,'RO',1,0),(37,1,'SK',1,0),(38,4,'DZ',1,0),(39,2,'AS',1,0),(40,1,'AD',1,0),(41,4,'AO',1,0),(42,2,'AI',1,0),(43,2,'AG',1,0),(44,2,'AR',1,0),(45,3,'AM',1,0),(46,2,'AW',1,0),(47,3,'AZ',1,0),(48,2,'BS',1,0),(49,3,'BH',1,0),(50,3,'BD',1,0),(51,2,'BB',1,0),(52,1,'BY',1,0),(53,2,'BZ',1,0),(54,4,'BJ',1,0),(55,2,'BM',1,0),(56,3,'BT',1,0),(57,4,'BW',1,0),(58,2,'BR',1,0),(59,3,'BN',1,0),(60,4,'BF',1,0),(61,3,'MM',1,0),(62,4,'BI',1,0),(63,3,'KH',1,0),(64,4,'CM',1,0),(65,4,'CV',1,0),(66,4,'CF',1,0),(67,4,'TD',1,0),(68,2,'CL',1,0),(69,2,'CO',1,0),(70,4,'KM',1,0),(71,4,'CD',1,0),(72,4,'CG',1,0),(73,2,'CR',1,0),(74,1,'HR',1,0),(75,2,'CU',1,0),(76,1,'CY',1,0),(77,4,'DJ',1,0),(78,2,'DM',1,0),(79,2,'DO',1,0),(80,3,'TL',1,0),(81,2,'EC',1,0),(82,4,'EG',1,0),(83,2,'SV',1,0),(84,4,'GQ',1,0),(85,4,'ER',1,0),(86,1,'EE',1,0),(87,4,'ET',1,0),(88,2,'FK',1,0),(89,1,'FO',1,0),(90,5,'FJ',1,0),(91,4,'GA',1,0),(92,4,'GM',1,0),(93,3,'GE',1,0),(94,4,'GH',1,0),(95,2,'GD',1,0),(96,1,'GL',1,0),(97,1,'GI',1,0),(98,2,'GP',1,0),(99,2,'GU',1,0),(100,2,'GT',1,0),(101,1,'GG',1,0),(102,4,'GN',1,0),(103,4,'GW',1,0),(104,2,'GY',1,0),(105,2,'HT',1,0),(106,5,'HM',1,0),(107,1,'VA',1,0),(108,2,'HN',1,0),(109,1,'IS',1,0),(110,3,'IN',1,0),(111,3,'ID',1,0),(112,3,'IR',1,0),(113,3,'IQ',1,0),(114,1,'IM',1,0),(115,2,'JM',1,0),(116,1,'JE',1,0),(117,3,'JO',1,0),(118,3,'KZ',1,0),(119,4,'KE',1,0),(120,1,'KI',1,0),(121,3,'KP',1,0),(122,3,'KW',1,0),(123,3,'KG',1,0),(124,3,'LA',1,0),(125,1,'LV',1,0),(126,3,'LB',1,0),(127,4,'LS',1,0),(128,4,'LR',1,0),(129,4,'LY',1,0),(130,1,'LI',1,0),(131,1,'LT',1,0),(132,3,'MO',1,0),(133,1,'MK',1,0),(134,4,'MG',1,0),(135,4,'MW',1,0),(136,3,'MY',1,0),(137,3,'MV',1,0),(138,4,'ML',1,0),(139,1,'MT',1,0),(140,5,'MH',1,0),(141,2,'MQ',1,0),(142,4,'MR',1,0),(144,4,'YT',1,0),(145,2,'MX',1,0),(146,5,'FM',1,0),(147,1,'MD',1,0),(148,1,'MC',1,0),(149,3,'MN',1,0),(150,1,'ME',1,0),(151,2,'MS',1,0),(152,4,'MA',1,0),(153,4,'MZ',1,0),(154,4,'NA',1,0),(155,5,'NR',1,0),(156,3,'NP',1,0),(157,2,'AN',1,0),(158,5,'NC',1,0),(159,2,'NI',1,0),(160,4,'NE',1,0),(161,5,'NU',1,0),(162,5,'NF',1,0),(163,5,'MP',1,0),(164,3,'OM',1,0),(165,3,'PK',1,0),(166,5,'PW',1,0),(167,3,'PS',1,0),(168,2,'PA',1,0),(169,5,'PG',1,0),(170,2,'PY',1,0),(171,2,'PE',1,0),(172,3,'PH',1,0),(173,5,'PN',1,0),(174,2,'PR',1,0),(175,3,'QA',1,0),(176,4,'RE',1,0),(177,1,'RU',1,0),(178,4,'RW',1,0),(179,2,'BL',1,0),(180,2,'KN',1,0),(181,2,'LC',1,0),(182,2,'MF',1,0),(183,2,'PM',1,0),(184,2,'VC',1,0),(185,5,'WS',1,0),(186,1,'SM',1,0),(187,4,'ST',1,0),(188,3,'SA',1,0),(189,4,'SN',1,0),(190,1,'RS',1,0),(191,4,'SC',1,0),(192,4,'SL',1,0),(193,1,'SI',1,0),(194,5,'SB',1,0),(195,4,'SO',1,0),(196,2,'GS',1,0),(197,3,'LK',1,0),(198,4,'SD',1,0),(199,2,'SR',1,0),(200,1,'SJ',1,0),(201,4,'SZ',1,0),(202,3,'SY',1,0),(203,3,'TW',1,0),(204,3,'TJ',1,0),(205,4,'TZ',1,0),(206,3,'TH',1,0),(207,5,'TK',1,0),(208,5,'TO',1,0),(209,2,'TT',1,0),(210,4,'TN',1,0),(211,1,'TR',1,0),(212,3,'TM',1,0),(213,2,'TC',1,0),(214,5,'TV',1,0),(215,4,'UG',1,0),(216,1,'UA',1,0),(217,3,'AE',1,0),(218,2,'UY',1,0),(219,3,'UZ',1,0),(220,5,'VU',1,0),(221,2,'VE',1,0),(222,3,'VN',1,0),(223,2,'VG',1,0),(224,2,'VI',1,0),(225,5,'WF',1,0),(226,4,'EH',1,0),(227,3,'YE',1,0),(228,4,'ZM',1,0),(229,4,'ZW',1,0),(230,1,'AL',1,0),(231,3,'AF',1,0),(232,5,'AQ',1,0),(233,1,'BA',1,0),(234,5,'BV',1,0),(235,5,'IO',1,0),(236,1,'BG',1,0),(237,2,'KY',1,0),(238,3,'CX',1,0),(239,3,'CC',1,0),(240,5,'CK',1,0),(241,2,'GF',1,0),(242,5,'PF',1,0),(243,5,'TF',1,0),(244,1,'AX',1,0); +/*!40000 ALTER TABLE `ps_country` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_country_lang` +-- + +DROP TABLE IF EXISTS `ps_country_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_country_lang` ( + `id_country` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(64) NOT NULL, + UNIQUE KEY `country_lang_index` (`id_country`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_country_lang` +-- + +LOCK TABLES `ps_country_lang` WRITE; +/*!40000 ALTER TABLE `ps_country_lang` DISABLE KEYS */; +INSERT INTO `ps_country_lang` VALUES (1,1,'Germany'),(1,2,'Allemagne'),(2,1,'Austria'),(2,2,'Autriche'),(3,1,'Belgium'),(3,2,'Belgique'),(4,1,'Canada'),(4,2,'Canada'),(5,1,'China'),(5,2,'Chine'),(6,1,'Spain'),(6,2,'Espagne'),(7,1,'Finland'),(7,2,'Finlande'),(8,1,'France'),(8,2,'France'),(9,1,'Greece'),(9,2,'Grèce'),(10,1,'Italy'),(10,2,'Italie'),(11,1,'Japan'),(11,2,'Japon'),(12,1,'Luxemburg'),(12,2,'Luxembourg'),(13,1,'Netherlands'),(13,2,'Pays-bas'),(14,1,'Poland'),(14,2,'Pologne'),(15,1,'Portugal'),(15,2,'Portugal'),(16,1,'Czech Republic'),(16,2,'République Tchèque'),(17,1,'United Kingdom'),(17,2,'Royaume-Uni'),(18,1,'Sweden'),(18,2,'Suède'),(19,1,'Switzerland'),(19,2,'Suisse'),(20,1,'Denmark'),(20,2,'Danemark'),(21,1,'USA'),(21,2,'USA'),(22,1,'HongKong'),(22,2,'Hong-Kong'),(23,1,'Norway'),(23,2,'Norvège'),(24,1,'Australia'),(24,2,'Australie'),(25,1,'Singapore'),(25,2,'Singapour'),(26,1,'Ireland'),(26,2,'Eire'),(27,1,'New Zealand'),(27,2,'Nouvelle-Zélande'),(28,1,'South Korea'),(28,2,'Corée du Sud'),(29,1,'Israel'),(29,2,'Israël'),(30,1,'South Africa'),(30,2,'Afrique du Sud'),(31,1,'Nigeria'),(31,2,'Nigeria'),(32,1,'Ivory Coast'),(32,2,'Côte d\'Ivoire'),(33,1,'Togo'),(33,2,'Togo'),(34,1,'Bolivia'),(34,2,'Bolivie'),(35,1,'Mauritius'),(35,2,'Ile Maurice'),(143,1,'Hungary'),(143,2,'Hongrie'),(36,1,'Romania'),(36,2,'Roumanie'),(37,1,'Slovakia'),(37,2,'Slovaquie'),(38,1,'Algeria'),(38,2,'Algérie'),(39,1,'American Samoa'),(39,2,'Samoa Américaines'),(40,1,'Andorra'),(40,2,'Andorre'),(41,1,'Angola'),(41,2,'Angola'),(42,1,'Anguilla'),(42,2,'Anguilla'),(43,1,'Antigua and Barbuda'),(43,2,'Antigua et Barbuda'),(44,1,'Argentina'),(44,2,'Argentine'),(45,1,'Armenia'),(45,2,'Arménie'),(46,1,'Aruba'),(46,2,'Aruba'),(47,1,'Azerbaijan'),(47,2,'Azerbaïdjan'),(48,1,'Bahamas'),(48,2,'Bahamas'),(49,1,'Bahrain'),(49,2,'Bahreïn'),(50,1,'Bangladesh'),(50,2,'Bangladesh'),(51,1,'Barbados'),(51,2,'Barbade'),(52,1,'Belarus'),(52,2,'Bélarus'),(53,1,'Belize'),(53,2,'Belize'),(54,1,'Benin'),(54,2,'Bénin'),(55,1,'Bermuda'),(55,2,'Bermudes'),(56,1,'Bhutan'),(56,2,'Bhoutan'),(57,1,'Botswana'),(57,2,'Botswana'),(58,1,'Brazil'),(58,2,'Brésil'),(59,1,'Brunei'),(59,2,'Brunéi Darussalam'),(60,1,'Burkina Faso'),(60,2,'Burkina Faso'),(61,1,'Burma (Myanmar)'),(61,2,'Burma (Myanmar)'),(62,1,'Burundi'),(62,2,'Burundi'),(63,1,'Cambodia'),(63,2,'Cambodge'),(64,1,'Cameroon'),(64,2,'Cameroun'),(65,1,'Cape Verde'),(65,2,'Cap-Vert'),(66,1,'Central African Republic'),(66,2,'Centrafricaine, République'),(67,1,'Chad'),(67,2,'Tchad'),(68,1,'Chile'),(68,2,'Chili'),(69,1,'Colombia'),(69,2,'Colombie'),(70,1,'Comoros'),(70,2,'Comores'),(71,1,'Congo, Dem. Republic'),(71,2,'Congo, Rép. Dém.'),(72,1,'Congo, Republic'),(72,2,'Congo, Rép.'),(73,1,'Costa Rica'),(73,2,'Costa Rica'),(74,1,'Croatia'),(74,2,'Croatie'),(75,1,'Cuba'),(75,2,'Cuba'),(76,1,'Cyprus'),(76,2,'Chypre'),(77,1,'Djibouti'),(77,2,'Djibouti'),(78,1,'Dominica'),(78,2,'Dominica'),(79,1,'Dominican Republic'),(79,2,'République Dominicaine'),(80,1,'East Timor'),(80,2,'Timor oriental'),(81,1,'Ecuador'),(81,2,'Équateur'),(82,1,'Egypt'),(82,2,'Égypte'),(83,1,'El Salvador'),(83,2,'El Salvador'),(84,1,'Equatorial Guinea'),(84,2,'Guinée Équatoriale'),(85,1,'Eritrea'),(85,2,'Érythrée'),(86,1,'Estonia'),(86,2,'Estonie'),(87,1,'Ethiopia'),(87,2,'Éthiopie'),(88,1,'Falkland Islands'),(88,2,'Falkland, ÃŽles'),(89,1,'Faroe Islands'),(89,2,'Féroé, ÃŽles'),(90,1,'Fiji'),(90,2,'Fidji'),(91,1,'Gabon'),(91,2,'Gabon'),(92,1,'Gambia'),(92,2,'Gambie'),(93,1,'Georgia'),(93,2,'Géorgie'),(94,1,'Ghana'),(94,2,'Ghana'),(95,1,'Grenada'),(95,2,'Grenade'),(96,1,'Greenland'),(96,2,'Groenland'),(97,1,'Gibraltar'),(97,2,'Gibraltar'),(98,1,'Guadeloupe'),(98,2,'Guadeloupe'),(99,1,'Guam'),(99,2,'Guam'),(100,1,'Guatemala'),(100,2,'Guatemala'),(101,1,'Guernsey'),(101,2,'Guernesey'),(102,1,'Guinea'),(102,2,'Guinée'),(103,1,'Guinea-Bissau'),(103,2,'Guinée-Bissau'),(104,1,'Guyana'),(104,2,'Guyana'),(105,1,'Haiti'),(105,2,'Haîti'),(106,1,'Heard Island and McDonald Islands'),(106,2,'Heard, ÃŽle et Mcdonald, ÃŽles'),(107,1,'Vatican City State'),(107,2,'Saint-Siege (État de la Cité du Vatican)'),(108,1,'Honduras'),(108,2,'Honduras'),(109,1,'Iceland'),(109,2,'Islande'),(110,1,'India'),(110,2,'Indie'),(111,1,'Indonesia'),(111,2,'Indonésie'),(112,1,'Iran'),(112,2,'Iran'),(113,1,'Iraq'),(113,2,'Iraq'),(114,1,'Isle of Man'),(114,2,'ÃŽle de Man'),(115,1,'Jamaica'),(115,2,'Jamaique'),(116,1,'Jersey'),(116,2,'Jersey'),(117,1,'Jordan'),(117,2,'Jordanie'),(118,1,'Kazakhstan'),(118,2,'Kazakhstan'),(119,1,'Kenya'),(119,2,'Kenya'),(120,1,'Kiribati'),(120,2,'Kiribati'),(121,1,'Korea, Dem. Republic of'),(121,2,'Corée, Rép. Populaire Dém. de'),(122,1,'Kuwait'),(122,2,'Koweït'),(123,1,'Kyrgyzstan'),(123,2,'Kirghizistan'),(124,1,'Laos'),(124,2,'Laos'),(125,1,'Latvia'),(125,2,'Lettonie'),(126,1,'Lebanon'),(126,2,'Liban'),(127,1,'Lesotho'),(127,2,'Lesotho'),(128,1,'Liberia'),(128,2,'Libéria'),(129,1,'Libya'),(129,2,'Libyenne, Jamahiriya Arabe'),(130,1,'Liechtenstein'),(130,2,'Liechtenstein'),(131,1,'Lithuania'),(131,2,'Lituanie'),(132,1,'Macau'),(132,2,'Macao'),(133,1,'Macedonia'),(133,2,'Macédoine'),(134,1,'Madagascar'),(134,2,'Madagascar'),(135,1,'Malawi'),(135,2,'Malawi'),(136,1,'Malaysia'),(136,2,'Malaisie'),(137,1,'Maldives'),(137,2,'Maldives'),(138,1,'Mali'),(138,2,'Mali'),(139,1,'Malta'),(139,2,'Malte'),(140,1,'Marshall Islands'),(140,2,'Marshall, ÃŽles'),(141,1,'Martinique'),(141,2,'Martinique'),(142,1,'Mauritania'),(142,2,'Mauritanie'),(144,1,'Mayotte'),(144,2,'Mayotte'),(145,1,'Mexico'),(145,2,'Mexique'),(146,1,'Micronesia'),(146,2,'Micronésie'),(147,1,'Moldova'),(147,2,'Moldova'),(148,1,'Monaco'),(148,2,'Monaco'),(149,1,'Mongolia'),(149,2,'Mongolie'),(150,1,'Montenegro'),(150,2,'Monténégro'),(151,1,'Montserrat'),(151,2,'Montserrat'),(152,1,'Morocco'),(152,2,'Maroc'),(153,1,'Mozambique'),(153,2,'Mozambique'),(154,1,'Namibia'),(154,2,'Namibie'),(155,1,'Nauru'),(155,2,'Nauru'),(156,1,'Nepal'),(156,2,'Népal'),(157,1,'Netherlands Antilles'),(157,2,'Antilles Néerlandaises'),(158,1,'New Caledonia'),(158,2,'Nouvelle-Calédonie'),(159,1,'Nicaragua'),(159,2,'Nicaragua'),(160,1,'Niger'),(160,2,'Niger'),(161,1,'Niue'),(161,2,'Niué'),(162,1,'Norfolk Island'),(162,2,'Norfolk, ÃŽle'),(163,1,'Northern Mariana Islands'),(163,2,'Mariannes du Nord, ÃŽles'),(164,1,'Oman'),(164,2,'Oman'),(165,1,'Pakistan'),(165,2,'Pakistan'),(166,1,'Palau'),(166,2,'Palaos'),(167,1,'Palestinian Territories'),(167,2,'Palestinien Occupé, Territoire'),(168,1,'Panama'),(168,2,'Panama'),(169,1,'Papua New Guinea'),(169,2,'Papouasie-Nouvelle-Guinée'),(170,1,'Paraguay'),(170,2,'Paraguay'),(171,1,'Peru'),(171,2,'Pérou'),(172,1,'Philippines'),(172,2,'Philippines'),(173,1,'Pitcairn'),(173,2,'Pitcairn'),(174,1,'Puerto Rico'),(174,2,'Porto Rico'),(175,1,'Qatar'),(175,2,'Qatar'),(176,1,'Réunion'),(176,2,'Réunion'),(177,1,'Russian Federation'),(177,2,'Russie, Fédération de'),(178,1,'Rwanda'),(178,2,'Rwanda'),(179,1,'Saint Barthélemy'),(179,2,'Saint-Barthélemy'),(180,1,'Saint Kitts and Nevis'),(180,2,'Saint-Kitts-et-Nevis'),(181,1,'Saint Lucia'),(181,2,'Sainte-Lucie'),(182,1,'Saint Martin'),(182,2,'Saint-Martin'),(183,1,'Saint Pierre and Miquelon'),(183,2,'Saint-Pierre-et-Miquelon'),(184,1,'Saint Vincent and the Grenadines'),(184,2,'Saint-Vincent-et-Les Grenadines'),(185,1,'Samoa'),(185,2,'Samoa'),(186,1,'San Marino'),(186,2,'Saint-Marin'),(187,1,'São Tomé and PrÃncipe'),(187,2,'Sao Tomé-et-Principe'),(188,1,'Saudi Arabia'),(188,2,'Arabie Saoudite'),(189,1,'Senegal'),(189,2,'Sénégal'),(190,1,'Serbia'),(190,2,'Serbie'),(191,1,'Seychelles'),(191,2,'Seychelles'),(192,1,'Sierra Leone'),(192,2,'Sierra Leone'),(193,1,'Slovenia'),(193,2,'Slovénie'),(194,1,'Solomon Islands'),(194,2,'Salomon, ÃŽles'),(195,1,'Somalia'),(195,2,'Somalie'),(196,1,'South Georgia and the South Sandwich Islands'),(196,2,'Géorgie du Sud et les ÃŽles Sandwich du Sud'),(197,1,'Sri Lanka'),(197,2,'Sri Lanka'),(198,1,'Sudan'),(198,2,'Soudan'),(199,1,'Suriname'),(199,2,'Suriname'),(200,1,'Svalbard and Jan Mayen'),(200,2,'Svalbard et ÃŽle Jan Mayen'),(201,1,'Swaziland'),(201,2,'Swaziland'),(202,1,'Syria'),(202,2,'Syrienne'),(203,1,'Taiwan'),(203,2,'Taïwan'),(204,1,'Tajikistan'),(204,2,'Tadjikistan'),(205,1,'Tanzania'),(205,2,'Tanzanie'),(206,1,'Thailand'),(206,2,'Thaïlande'),(207,1,'Tokelau'),(207,2,'Tokelau'),(208,1,'Tonga'),(208,2,'Tonga'),(209,1,'Trinidad and Tobago'),(209,2,'Trinité-et-Tobago'),(210,1,'Tunisia'),(210,2,'Tunisie'),(211,1,'Turkey'),(211,2,'Turquie'),(212,1,'Turkmenistan'),(212,2,'Turkménistan'),(213,1,'Turks and Caicos Islands'),(213,2,'Turks et Caiques, ÃŽles'),(214,1,'Tuvalu'),(214,2,'Tuvalu'),(215,1,'Uganda'),(215,2,'Ouganda'),(216,1,'Ukraine'),(216,2,'Ukraine'),(217,1,'United Arab Emirates'),(217,2,'Émirats Arabes Unis'),(218,1,'Uruguay'),(218,2,'Uruguay'),(219,1,'Uzbekistan'),(219,2,'Ouzbékistan'),(220,1,'Vanuatu'),(220,2,'Vanuatu'),(221,1,'Venezuela'),(221,2,'Venezuela'),(222,1,'Vietnam'),(222,2,'Vietnam'),(223,1,'Virgin Islands (British)'),(223,2,'ÃŽles Vierges Britanniques'),(224,1,'Virgin Islands (U.S.)'),(224,2,'ÃŽles Vierges des États-Unis'),(225,1,'Wallis and Futuna'),(225,2,'Wallis et Futuna'),(226,1,'Western Sahara'),(226,2,'Sahara Occidental'),(227,1,'Yemen'),(227,2,'Yémen'),(228,1,'Zambia'),(228,2,'Zambie'),(229,1,'Zimbabwe'),(229,2,'Zimbabwe'),(230,1,'Albania'),(230,2,'Albanie'),(231,1,'Afghanistan'),(231,2,'Afghanistan'),(232,1,'Antarctica'),(232,2,'Antarctique'),(233,1,'Bosnia and Herzegovina'),(233,2,'Bosnie-Herzégovine'),(234,1,'Bouvet Island'),(234,2,'Bouvet, ÃŽle'),(235,1,'British Indian Ocean Territory'),(235,2,'Océan Indien, Territoire Britannique de L\''),(236,1,'Bulgaria'),(236,2,'Bulgarie'),(237,1,'Cayman Islands'),(237,2,'Caïmans, ÃŽles'),(238,1,'Christmas Island'),(238,2,'Christmas, ÃŽle'),(239,1,'Cocos (Keeling) Islands'),(239,2,'Cocos (Keeling), ÃŽles'),(240,1,'Cook Islands'),(240,2,'Cook, ÃŽles'),(241,1,'French Guiana'),(241,2,'Guyane Française'),(242,1,'French Polynesia'),(242,2,'Polynésie Française'),(243,1,'French Southern Territories'),(243,2,'Terres Australes Françaises'),(244,1,'Ã…land Islands'),(244,2,'Ã…land, ÃŽles'); +/*!40000 ALTER TABLE `ps_country_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_currency` +-- + +DROP TABLE IF EXISTS `ps_currency`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_currency` ( + `id_currency` int(10) unsigned NOT NULL auto_increment, + `name` varchar(32) NOT NULL, + `iso_code` varchar(3) NOT NULL default '0', + `sign` varchar(8) NOT NULL, + `blank` tinyint(1) unsigned NOT NULL default '0', + `format` tinyint(1) unsigned NOT NULL default '0', + `decimals` tinyint(1) unsigned NOT NULL default '1', + `conversion_rate` decimal(13,6) NOT NULL, + `deleted` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_currency`) +) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_currency` +-- + +LOCK TABLES `ps_currency` WRITE; +/*!40000 ALTER TABLE `ps_currency` DISABLE KEYS */; +INSERT INTO `ps_currency` VALUES (1,'Euro','EUR','€',1,2,1,'1.000000',0),(2,'Dollar','USD','$',0,1,1,'1.470000',0),(3,'Pound','GBP','£',0,1,1,'0.800000',0); +/*!40000 ALTER TABLE `ps_currency` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_customer` +-- + +DROP TABLE IF EXISTS `ps_customer`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_customer` ( + `id_customer` int(10) unsigned NOT NULL auto_increment, + `id_gender` int(10) unsigned NOT NULL, + `secure_key` varchar(32) NOT NULL default '-1', + `email` varchar(128) NOT NULL, + `passwd` varchar(32) NOT NULL, + `last_passwd_gen` timestamp NOT NULL default CURRENT_TIMESTAMP, + `birthday` date default NULL, + `lastname` varchar(32) NOT NULL, + `newsletter` tinyint(1) unsigned NOT NULL default '0', + `ip_registration_newsletter` varchar(15) default NULL, + `newsletter_date_add` datetime default NULL, + `optin` tinyint(1) unsigned NOT NULL default '0', + `firstname` varchar(32) NOT NULL, + `active` tinyint(1) unsigned NOT NULL default '0', + `deleted` tinyint(1) NOT NULL default '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_customer`), + UNIQUE KEY `customer_email` (`email`), + KEY `customer_login` (`email`,`passwd`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_customer` +-- + +LOCK TABLES `ps_customer` WRITE; +/*!40000 ALTER TABLE `ps_customer` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_customer` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_customer_group` +-- + +DROP TABLE IF EXISTS `ps_customer_group`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_customer_group` ( + `id_customer` int(10) unsigned NOT NULL, + `id_group` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_customer`,`id_group`), + KEY `customer_login` (`id_group`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_customer_group` +-- + +LOCK TABLES `ps_customer_group` WRITE; +/*!40000 ALTER TABLE `ps_customer_group` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_customer_group` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_customization` +-- + +DROP TABLE IF EXISTS `ps_customization`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_customization` ( + `id_customization` int(10) unsigned NOT NULL auto_increment, + `id_product_attribute` int(10) NOT NULL default '0', + `id_cart` int(10) NOT NULL, + `id_product` int(10) NOT NULL, + `quantity` int(10) NOT NULL, + `quantity_refunded` int(11) NOT NULL default '0', + `quantity_returned` int(11) NOT NULL default '0', + PRIMARY KEY (`id_customization`,`id_cart`,`id_product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_customization` +-- + +LOCK TABLES `ps_customization` WRITE; +/*!40000 ALTER TABLE `ps_customization` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_customization` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_customization_field` +-- + +DROP TABLE IF EXISTS `ps_customization_field`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_customization_field` ( + `id_customization_field` int(10) unsigned NOT NULL auto_increment, + `id_product` int(10) NOT NULL, + `type` tinyint(1) NOT NULL, + `required` tinyint(1) NOT NULL, + PRIMARY KEY (`id_customization_field`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_customization_field` +-- + +LOCK TABLES `ps_customization_field` WRITE; +/*!40000 ALTER TABLE `ps_customization_field` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_customization_field` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_customization_field_lang` +-- + +DROP TABLE IF EXISTS `ps_customization_field_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_customization_field_lang` ( + `id_customization_field` int(10) NOT NULL, + `id_lang` int(10) NOT NULL, + `name` varchar(255) NOT NULL, + PRIMARY KEY (`id_customization_field`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_customization_field_lang` +-- + +LOCK TABLES `ps_customization_field_lang` WRITE; +/*!40000 ALTER TABLE `ps_customization_field_lang` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_customization_field_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_customized_data` +-- + +DROP TABLE IF EXISTS `ps_customized_data`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_customized_data` ( + `id_customization` int(10) NOT NULL, + `type` tinyint(1) NOT NULL, + `index` int(3) NOT NULL, + `value` varchar(255) NOT NULL, + PRIMARY KEY (`id_customization`,`type`,`index`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_customized_data` +-- + +LOCK TABLES `ps_customized_data` WRITE; +/*!40000 ALTER TABLE `ps_customized_data` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_customized_data` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_date_range` +-- + +DROP TABLE IF EXISTS `ps_date_range`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_date_range` ( + `id_date_range` int(10) unsigned NOT NULL auto_increment, + `time_start` datetime NOT NULL, + `time_end` datetime NOT NULL, + PRIMARY KEY (`id_date_range`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_date_range` +-- + +LOCK TABLES `ps_date_range` WRITE; +/*!40000 ALTER TABLE `ps_date_range` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_date_range` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_delivery` +-- + +DROP TABLE IF EXISTS `ps_delivery`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_delivery` ( + `id_delivery` int(10) unsigned NOT NULL auto_increment, + `id_carrier` int(10) unsigned NOT NULL, + `id_range_price` int(10) unsigned default NULL, + `id_range_weight` int(10) unsigned default NULL, + `id_zone` int(10) unsigned NOT NULL, + `price` decimal(10,2) NOT NULL, + PRIMARY KEY (`id_delivery`), + KEY `id_zone` (`id_zone`), + KEY `id_carrier` (`id_carrier`,`id_zone`) +) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_delivery` +-- + +LOCK TABLES `ps_delivery` WRITE; +/*!40000 ALTER TABLE `ps_delivery` DISABLE KEYS */; +INSERT INTO `ps_delivery` VALUES (1,2,NULL,1,1,'5.00'),(2,2,NULL,1,2,'5.00'),(4,2,1,NULL,1,'5.00'),(5,2,1,NULL,2,'5.00'); +/*!40000 ALTER TABLE `ps_delivery` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_discount` +-- + +DROP TABLE IF EXISTS `ps_discount`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_discount` ( + `id_discount` int(10) unsigned NOT NULL auto_increment, + `id_discount_type` int(10) unsigned NOT NULL, + `id_customer` int(10) unsigned NOT NULL, + `name` varchar(32) NOT NULL, + `value` decimal(10,2) NOT NULL default '0.00', + `quantity` int(10) unsigned NOT NULL default '0', + `quantity_per_user` int(10) unsigned NOT NULL default '1', + `cumulable` tinyint(1) unsigned NOT NULL default '0', + `cumulable_reduction` tinyint(1) unsigned NOT NULL default '0', + `date_from` datetime NOT NULL, + `date_to` datetime NOT NULL, + `minimal` decimal(10,2) default NULL, + `active` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_discount`), + KEY `discount_name` (`name`), + KEY `discount_customer` (`id_customer`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_discount` +-- + +LOCK TABLES `ps_discount` WRITE; +/*!40000 ALTER TABLE `ps_discount` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_discount` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_discount_category` +-- + +DROP TABLE IF EXISTS `ps_discount_category`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_discount_category` ( + `id_category` int(11) NOT NULL, + `id_discount` int(11) NOT NULL, + PRIMARY KEY (`id_category`,`id_discount`), + KEY `discount` (`id_discount`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_discount_category` +-- + +LOCK TABLES `ps_discount_category` WRITE; +/*!40000 ALTER TABLE `ps_discount_category` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_discount_category` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_discount_lang` +-- + +DROP TABLE IF EXISTS `ps_discount_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_discount_lang` ( + `id_discount` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `description` text, + PRIMARY KEY (`id_discount`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_discount_lang` +-- + +LOCK TABLES `ps_discount_lang` WRITE; +/*!40000 ALTER TABLE `ps_discount_lang` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_discount_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_discount_quantity` +-- + +DROP TABLE IF EXISTS `ps_discount_quantity`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_discount_quantity` ( + `id_discount_quantity` int(10) unsigned NOT NULL auto_increment, + `id_discount_type` int(10) unsigned NOT NULL, + `id_product` int(10) unsigned NOT NULL, + `id_product_attribute` int(10) unsigned default NULL, + `quantity` int(10) unsigned NOT NULL, + `value` decimal(10,2) unsigned NOT NULL, + PRIMARY KEY (`id_discount_quantity`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_discount_quantity` +-- + +LOCK TABLES `ps_discount_quantity` WRITE; +/*!40000 ALTER TABLE `ps_discount_quantity` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_discount_quantity` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_discount_type` +-- + +DROP TABLE IF EXISTS `ps_discount_type`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_discount_type` ( + `id_discount_type` int(10) unsigned NOT NULL auto_increment, + PRIMARY KEY (`id_discount_type`) +) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_discount_type` +-- + +LOCK TABLES `ps_discount_type` WRITE; +/*!40000 ALTER TABLE `ps_discount_type` DISABLE KEYS */; +INSERT INTO `ps_discount_type` VALUES (1),(2),(3); +/*!40000 ALTER TABLE `ps_discount_type` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_discount_type_lang` +-- + +DROP TABLE IF EXISTS `ps_discount_type_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_discount_type_lang` ( + `id_discount_type` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(64) NOT NULL, + PRIMARY KEY (`id_discount_type`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_discount_type_lang` +-- + +LOCK TABLES `ps_discount_type_lang` WRITE; +/*!40000 ALTER TABLE `ps_discount_type_lang` DISABLE KEYS */; +INSERT INTO `ps_discount_type_lang` VALUES (1,1,'Discount on order (%)'),(2,1,'Discount on order (amount)'),(3,1,'Free shipping'),(1,2,'Réduction sur la commande (%)'),(2,2,'Réduction sur la commande (montant)'),(3,2,'Frais de port gratuits'); +/*!40000 ALTER TABLE `ps_discount_type_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_employee` +-- + +DROP TABLE IF EXISTS `ps_employee`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_employee` ( + `id_employee` int(10) unsigned NOT NULL auto_increment, + `id_profile` int(10) unsigned NOT NULL, + `lastname` varchar(32) NOT NULL, + `firstname` varchar(32) NOT NULL, + `email` varchar(128) NOT NULL, + `passwd` varchar(32) NOT NULL, + `last_passwd_gen` timestamp NOT NULL default CURRENT_TIMESTAMP, + `stats_date_from` date default NULL, + `stats_date_to` date default NULL, + `active` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_employee`), + KEY `employee_login` (`email`,`passwd`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_employee` +-- + +LOCK TABLES `ps_employee` WRITE; +/*!40000 ALTER TABLE `ps_employee` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_employee` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_feature` +-- + +DROP TABLE IF EXISTS `ps_feature`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_feature` ( + `id_feature` int(10) unsigned NOT NULL auto_increment, + PRIMARY KEY (`id_feature`) +) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_feature` +-- + +LOCK TABLES `ps_feature` WRITE; +/*!40000 ALTER TABLE `ps_feature` DISABLE KEYS */; +INSERT INTO `ps_feature` VALUES (1),(2),(3),(4),(5); +/*!40000 ALTER TABLE `ps_feature` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_feature_lang` +-- + +DROP TABLE IF EXISTS `ps_feature_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_feature_lang` ( + `id_feature` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(128) default NULL, + PRIMARY KEY (`id_feature`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_feature_lang` +-- + +LOCK TABLES `ps_feature_lang` WRITE; +/*!40000 ALTER TABLE `ps_feature_lang` DISABLE KEYS */; +INSERT INTO `ps_feature_lang` VALUES (1,1,'Height'),(1,2,'Hauteur'),(2,1,'Width'),(2,2,'Largeur'),(3,1,'Depth'),(3,2,'Profondeur'),(4,1,'Weight'),(4,2,'Poids'),(5,1,'Headphone'),(5,2,'Prise casque'); +/*!40000 ALTER TABLE `ps_feature_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_feature_product` +-- + +DROP TABLE IF EXISTS `ps_feature_product`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_feature_product` ( + `id_feature` int(10) unsigned NOT NULL, + `id_product` int(10) unsigned NOT NULL, + `id_feature_value` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_feature`,`id_product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_feature_product` +-- + +LOCK TABLES `ps_feature_product` WRITE; +/*!40000 ALTER TABLE `ps_feature_product` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_feature_product` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_feature_value` +-- + +DROP TABLE IF EXISTS `ps_feature_value`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_feature_value` ( + `id_feature_value` int(10) unsigned NOT NULL auto_increment, + `id_feature` int(10) unsigned NOT NULL, + `custom` tinyint(3) unsigned default NULL, + PRIMARY KEY (`id_feature_value`), + KEY `feature` (`id_feature`) +) ENGINE=MyISAM AUTO_INCREMENT=27 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_feature_value` +-- + +LOCK TABLES `ps_feature_value` WRITE; +/*!40000 ALTER TABLE `ps_feature_value` DISABLE KEYS */; +INSERT INTO `ps_feature_value` VALUES (11,1,1),(15,1,1),(12,2,1),(16,2,1),(14,3,1),(18,3,1),(13,4,1),(17,4,1),(26,3,1),(25,4,1),(24,2,1),(23,1,1),(9,5,NULL),(10,5,NULL); +/*!40000 ALTER TABLE `ps_feature_value` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_feature_value_lang` +-- + +DROP TABLE IF EXISTS `ps_feature_value_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_feature_value_lang` ( + `id_feature_value` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `value` varchar(255) default NULL, + PRIMARY KEY (`id_feature_value`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_feature_value_lang` +-- + +LOCK TABLES `ps_feature_value_lang` WRITE; +/*!40000 ALTER TABLE `ps_feature_value_lang` DISABLE KEYS */; +INSERT INTO `ps_feature_value_lang` VALUES (13,1,'49.2 grams'),(13,2,'49,2 grammes'),(12,2,'52,3 mm'),(12,1,'52.3 mm'),(11,2,'69,8 mm'),(11,1,'69.8 mm'),(17,2,'15,5 g'),(17,1,'15.5 g'),(16,2,'41,2 mm'),(16,1,'41.2 mm'),(15,2,'27,3 mm'),(15,1,'27.3 mm'),(9,1,'Jack stereo'),(9,2,'Jack stéréo'),(10,1,'Mini-jack stereo'),(10,2,'Mini-jack stéréo'),(14,1,'6,5 mm'),(14,2,'6,5 mm'),(18,1,'10,5 mm (clip compris)'),(18,2,'10,5 mm (clip compris)'),(26,2,'8mm'),(26,1,'8mm'),(25,2,'120g'),(25,1,'120g'),(24,2,'70mm'),(24,1,'70mm'),(23,2,'110mm'),(23,1,'110mm'); +/*!40000 ALTER TABLE `ps_feature_value_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_group` +-- + +DROP TABLE IF EXISTS `ps_group`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_group` ( + `id_group` int(10) unsigned NOT NULL auto_increment, + `reduction` decimal(10,2) NOT NULL default '0.00', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_group`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_group` +-- + +LOCK TABLES `ps_group` WRITE; +/*!40000 ALTER TABLE `ps_group` DISABLE KEYS */; +INSERT INTO `ps_group` VALUES (1,'0.00','2010-06-08 14:08:09','2010-06-08 14:08:09'); +/*!40000 ALTER TABLE `ps_group` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_group_lang` +-- + +DROP TABLE IF EXISTS `ps_group_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_group_lang` ( + `id_group` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(32) NOT NULL, + UNIQUE KEY `attribute_lang_index` (`id_group`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_group_lang` +-- + +LOCK TABLES `ps_group_lang` WRITE; +/*!40000 ALTER TABLE `ps_group_lang` DISABLE KEYS */; +INSERT INTO `ps_group_lang` VALUES (1,1,'Default'),(1,2,'Défaut'); +/*!40000 ALTER TABLE `ps_group_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_guest` +-- + +DROP TABLE IF EXISTS `ps_guest`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_guest` ( + `id_guest` int(10) unsigned NOT NULL auto_increment, + `id_operating_system` int(10) unsigned default NULL, + `id_web_browser` int(10) unsigned default NULL, + `id_customer` int(10) unsigned default NULL, + `javascript` tinyint(1) default '0', + `screen_resolution_x` smallint(5) unsigned default NULL, + `screen_resolution_y` smallint(5) unsigned default NULL, + `screen_color` tinyint(3) unsigned default NULL, + `sun_java` tinyint(1) default NULL, + `adobe_flash` tinyint(1) default NULL, + `adobe_director` tinyint(1) default NULL, + `apple_quicktime` tinyint(1) default NULL, + `real_player` tinyint(1) default NULL, + `windows_media` tinyint(1) default NULL, + `accept_language` varchar(8) default NULL, + PRIMARY KEY (`id_guest`), + KEY `id_customer` (`id_customer`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_guest` +-- + +LOCK TABLES `ps_guest` WRITE; +/*!40000 ALTER TABLE `ps_guest` DISABLE KEYS */; +INSERT INTO `ps_guest` VALUES (1,1,3,1,1,1680,1050,32,1,1,0,1,1,0,'en-us'); +/*!40000 ALTER TABLE `ps_guest` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_hook` +-- + +DROP TABLE IF EXISTS `ps_hook`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_hook` ( + `id_hook` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) NOT NULL, + `title` varchar(64) NOT NULL, + `description` text, + `position` tinyint(1) NOT NULL default '1', + PRIMARY KEY (`id_hook`), + UNIQUE KEY `hook_name` (`name`) +) ENGINE=MyISAM AUTO_INCREMENT=50 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_hook` +-- + +LOCK TABLES `ps_hook` WRITE; +/*!40000 ALTER TABLE `ps_hook` DISABLE KEYS */; +INSERT INTO `ps_hook` VALUES (1,'payment','Payment',NULL,1),(2,'newOrder','New orders',NULL,0),(3,'paymentConfirm','Payment confirmation',NULL,0),(4,'paymentReturn','Payment return',NULL,0),(5,'updateQuantity','Quantity update','Quantity is updated only when the customer effectively <b>place</b> his order.',0),(6,'rightColumn','Right column blocks',NULL,1),(7,'leftColumn','Left column blocks',NULL,1),(8,'home','Homepage content',NULL,1),(9,'header','Header of pages','A hook which allow you to do things in the header of each pages',1),(10,'cart','Cart creation and update',NULL,0),(11,'authentication','Successful customer authentication',NULL,0),(12,'addproduct','Product creation',NULL,0),(13,'updateproduct','Product Update',NULL,0),(14,'top','Top of pages','A hook which allow you to do things a the top of each pages.',1),(15,'extraRight','Extra actions on the product page (right column).',NULL,0),(16,'deleteproduct','Product deletion','This hook is called when a product is deleted',0),(17,'productfooter','Product footer','Add new blocks under the product description',1),(18,'invoice','Invoice','Add blocks to invoice (order)',1),(19,'updateOrderStatus','Order\'s status update event','Launch modules when the order\'s status of an order change.',0),(20,'adminOrder','Display in Back-Office, tab AdminOrder','Launch modules when the tab AdminOrder is displayed on back-office.',0),(21,'footer','Footer','Add block in footer',1),(22,'PDFInvoice','PDF Invoice','Allow the display of extra informations into the PDF invoice',0),(23,'adminCustomers','Display in Back-Office, tab AdminCustomers','Launch modules when the tab AdminCustomers is displayed on back-office.',0),(24,'orderConfirmation','Order confirmation page','Called on order confirmation page',0),(25,'createAccount','Successful customer create account','Called when new customer create account successfuled',0),(26,'customerAccount','Customer account page display in front office','Display on page account of the customer',1),(27,'orderSlip','Called when a order slip is created','Called when a quantity of one product change in an order.',0),(28,'productTab','Tabs on product page','Called on order product page tabs',0),(29,'productTabContent','Content of tabs on product page','Called on order product page tabs',0),(30,'shoppingCart','Shopping cart footer','Display some specific informations on the shopping cart page',0),(31,'createAccountForm','Customer account creation form','Display some information on the form to create a customer account',1),(32,'AdminStatsModules','Stats - Modules',NULL,1),(33,'GraphEngine','Graph Engines',NULL,0),(34,'orderReturn','Product returned',NULL,0),(35,'productActions','Product actions','Put new action buttons on product page',1),(36,'backOfficeHome','Administration panel homepage',NULL,1),(37,'GridEngine','Grid Engines',NULL,0),(38,'watermark','Watermark',NULL,0),(39,'cancelProduct','Product cancelled','This hook is called when you cancel a product in an order',0),(40,'extraLeft','Extra actions on the product page (left column).',NULL,0),(41,'productOutOfStock','Product out of stock','Make action while product is out of stock',1),(42,'updateProductAttribute','Product attribute update',NULL,0),(43,'extraCarrier','Extra carrier (module mode)',NULL,0),(44,'shoppingCartExtra','Shopping cart extra button','Display some specific informations',1),(45,'search','Search',NULL,0),(46,'backBeforePayment','Redirect in order process','Redirect user to the module instead of displaying payment modules',0),(47,'updateCarrier','Carrier Update','This hook is called when a carrier is updated',0),(48,'postUpdateOrderStatus','Post update of order status',NULL,0),(49,'myAccountBlock','My account block','Display extra informations inside the \"my account\" block',1); +/*!40000 ALTER TABLE `ps_hook` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_hook_module` +-- + +DROP TABLE IF EXISTS `ps_hook_module`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_hook_module` ( + `id_module` int(10) unsigned NOT NULL, + `id_hook` int(10) unsigned NOT NULL, + `position` tinyint(2) unsigned NOT NULL, + PRIMARY KEY (`id_module`,`id_hook`), + KEY `id_hook` (`id_hook`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_hook_module` +-- + +LOCK TABLES `ps_hook_module` WRITE; +/*!40000 ALTER TABLE `ps_hook_module` DISABLE KEYS */; +INSERT INTO `ps_hook_module` VALUES (3,1,1),(6,1,2),(4,1,3),(8,2,1),(3,4,1),(6,4,2),(9,6,1),(16,6,2),(8,6,3),(20,6,4),(15,7,1),(21,7,2),(10,7,3),(24,7,4),(14,7,5),(12,7,6),(7,7,7),(17,7,8),(5,8,1),(1,8,2),(19,9,1),(11,14,1),(13,14,2),(18,14,3),(19,14,4),(22,14,5),(8,19,1),(23,21,1),(25,11,1),(25,21,2),(26,32,1),(27,32,2),(28,32,3),(30,32,4),(31,32,5),(32,32,6),(33,32,7),(34,33,1),(35,33,2),(36,33,3),(37,33,4),(38,36,1),(39,37,1),(40,32,8),(41,32,9),(42,32,10),(43,32,11),(42,14,6),(43,14,7),(44,32,12),(45,32,13),(46,32,15),(47,32,14),(48,32,16),(49,32,17),(50,32,18),(51,32,19),(51,45,1),(25,25,1),(41,20,2); +/*!40000 ALTER TABLE `ps_hook_module` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_hook_module_exceptions` +-- + +DROP TABLE IF EXISTS `ps_hook_module_exceptions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_hook_module_exceptions` ( + `id_hook_module_exceptions` int(10) unsigned NOT NULL auto_increment, + `id_module` int(10) unsigned NOT NULL, + `id_hook` int(10) unsigned NOT NULL, + `file_name` varchar(255) default NULL, + PRIMARY KEY (`id_hook_module_exceptions`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_hook_module_exceptions` +-- + +LOCK TABLES `ps_hook_module_exceptions` WRITE; +/*!40000 ALTER TABLE `ps_hook_module_exceptions` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_hook_module_exceptions` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_image` +-- + +DROP TABLE IF EXISTS `ps_image`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_image` ( + `id_image` int(10) unsigned NOT NULL auto_increment, + `id_product` int(10) unsigned NOT NULL, + `position` tinyint(2) unsigned NOT NULL default '0', + `cover` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_image`), + KEY `image_product` (`id_product`) +) ENGINE=MyISAM AUTO_INCREMENT=50 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_image` +-- + +LOCK TABLES `ps_image` WRITE; +/*!40000 ALTER TABLE `ps_image` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_image` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_image_lang` +-- + +DROP TABLE IF EXISTS `ps_image_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_image_lang` ( + `id_image` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `legend` varchar(128) default NULL, + UNIQUE KEY `image_lang_index` (`id_image`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_image_lang` +-- + +LOCK TABLES `ps_image_lang` WRITE; +/*!40000 ALTER TABLE `ps_image_lang` DISABLE KEYS */; +INSERT INTO `ps_image_lang` VALUES (40,2,'iPod Nano'),(40,1,'iPod Nano'),(39,2,'iPod Nano'),(39,1,'iPod Nano'),(38,2,'iPod Nano'),(38,1,'iPod Nano'),(37,2,'iPod Nano'),(37,1,'iPod Nano'),(48,2,'iPod shuffle'),(48,1,'iPod shuffle'),(47,2,'iPod shuffle'),(47,1,'iPod shuffle'),(49,2,'iPod shuffle'),(49,1,'iPod shuffle'),(46,2,'iPod shuffle'),(46,1,'iPod shuffle'),(10,1,'luxury-cover-for-ipod-video'),(10,2,'housse-luxe-pour-ipod-video'),(11,1,'cover'),(11,2,'housse'),(12,1,'myglove-ipod-nano'),(12,2,'myglove-ipod-nano'),(13,1,'myglove-ipod-nano'),(13,2,'myglove-ipod-nano'),(14,1,'myglove-ipod-nano'),(14,2,'myglove-ipod-nano'),(15,1,'MacBook Air'),(15,2,'macbook-air-1'),(16,1,'MacBook Air'),(16,2,'macbook-air-2'),(17,1,'MacBook Air'),(17,2,'macbook-air-3'),(18,1,'MacBook Air'),(18,2,'macbook-air-4'),(19,1,'MacBook Air'),(19,2,'macbook-air-5'),(20,1,' MacBook Air SuperDrive'),(20,2,'superdrive-pour-macbook-air-1'),(24,2,'iPod touch'),(24,1,'iPod touch'),(33,1,'housse-portefeuille-en-cuir'),(26,1,'iPod touch'),(26,2,'iPod touch'),(27,1,'iPod touch'),(27,2,'iPod touch'),(29,1,'iPod touch'),(29,2,'iPod touch'),(30,1,'iPod touch'),(30,2,'iPod touch'),(32,1,'iPod touch'),(32,2,'iPod touch'),(33,2,'housse-portefeuille-en-cuir-ipod-nano'),(36,2,'Écouteurs à isolation sonore Shure SE210'),(36,1,'Shure SE210 Sound-Isolating Earphones for iPod and iPhone'),(41,1,'iPod Nano'),(41,2,'iPod Nano'),(42,1,'iPod Nano'),(42,2,'iPod Nano'),(44,1,'iPod Nano'),(44,2,'iPod Nano'),(45,1,'iPod Nano'),(45,2,'iPod Nano'); +/*!40000 ALTER TABLE `ps_image_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_image_type` +-- + +DROP TABLE IF EXISTS `ps_image_type`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_image_type` ( + `id_image_type` int(10) unsigned NOT NULL auto_increment, + `name` varchar(16) NOT NULL, + `width` int(10) unsigned NOT NULL, + `height` int(10) unsigned NOT NULL, + `products` tinyint(1) NOT NULL default '1', + `categories` tinyint(1) NOT NULL default '1', + `manufacturers` tinyint(1) NOT NULL default '1', + `suppliers` tinyint(1) NOT NULL default '1', + `scenes` tinyint(1) NOT NULL default '1', + PRIMARY KEY (`id_image_type`), + KEY `image_type_name` (`name`) +) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_image_type` +-- + +LOCK TABLES `ps_image_type` WRITE; +/*!40000 ALTER TABLE `ps_image_type` DISABLE KEYS */; +INSERT INTO `ps_image_type` VALUES (1,'small',45,45,1,1,1,1,0),(2,'medium',80,80,1,1,1,1,0),(3,'large',300,300,1,1,1,1,0),(4,'thickbox',600,600,1,0,0,0,0),(5,'category',500,150,0,1,0,0,0),(6,'home',129,129,1,0,0,0,0),(7,'large_scene',556,200,0,0,0,0,1),(8,'thumb_scene',161,58,0,0,0,0,1); +/*!40000 ALTER TABLE `ps_image_type` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_lang` +-- + +DROP TABLE IF EXISTS `ps_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_lang` ( + `id_lang` int(10) unsigned NOT NULL auto_increment, + `name` varchar(32) NOT NULL, + `active` tinyint(3) unsigned NOT NULL default '0', + `iso_code` char(2) NOT NULL, + PRIMARY KEY (`id_lang`), + KEY `lang_iso_code` (`iso_code`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_lang` +-- + +LOCK TABLES `ps_lang` WRITE; +/*!40000 ALTER TABLE `ps_lang` DISABLE KEYS */; +INSERT INTO `ps_lang` VALUES (1,'English (English)',1,'en'),(2,'Français (French)',1,'fr'); +/*!40000 ALTER TABLE `ps_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_manufacturer` +-- + +DROP TABLE IF EXISTS `ps_manufacturer`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_manufacturer` ( + `id_manufacturer` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) NOT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_manufacturer`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_manufacturer` +-- + +LOCK TABLES `ps_manufacturer` WRITE; +/*!40000 ALTER TABLE `ps_manufacturer` DISABLE KEYS */; +INSERT INTO `ps_manufacturer` VALUES (1,'Apple Computer, Inc','2010-06-08 14:08:09','2010-06-08 14:08:09'),(2,'Shure Incorporated','2010-06-08 14:08:09','2010-06-08 14:08:09'); +/*!40000 ALTER TABLE `ps_manufacturer` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_manufacturer_lang` +-- + +DROP TABLE IF EXISTS `ps_manufacturer_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_manufacturer_lang` ( + `id_manufacturer` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `description` text, + `short_description` varchar(254) default NULL, + `meta_title` varchar(254) default NULL, + `meta_keywords` varchar(254) default NULL, + `meta_description` varchar(254) default NULL, + PRIMARY KEY (`id_manufacturer`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_manufacturer_lang` +-- + +LOCK TABLES `ps_manufacturer_lang` WRITE; +/*!40000 ALTER TABLE `ps_manufacturer_lang` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_manufacturer_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_message` +-- + +DROP TABLE IF EXISTS `ps_message`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_message` ( + `id_message` int(10) unsigned NOT NULL auto_increment, + `id_cart` int(10) unsigned default NULL, + `id_customer` int(10) unsigned NOT NULL, + `id_employee` int(10) unsigned default NULL, + `id_order` int(10) unsigned NOT NULL, + `message` text NOT NULL, + `private` tinyint(1) unsigned NOT NULL default '1', + `date_add` datetime NOT NULL, + PRIMARY KEY (`id_message`), + KEY `message_order` (`id_order`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_message` +-- + +LOCK TABLES `ps_message` WRITE; +/*!40000 ALTER TABLE `ps_message` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_message` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_message_readed` +-- + +DROP TABLE IF EXISTS `ps_message_readed`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_message_readed` ( + `id_message` int(10) unsigned NOT NULL, + `id_employee` int(10) unsigned NOT NULL, + `date_add` datetime NOT NULL, + PRIMARY KEY (`id_message`,`id_employee`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_message_readed` +-- + +LOCK TABLES `ps_message_readed` WRITE; +/*!40000 ALTER TABLE `ps_message_readed` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_message_readed` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_meta` +-- + +DROP TABLE IF EXISTS `ps_meta`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_meta` ( + `id_meta` int(10) unsigned NOT NULL auto_increment, + `page` varchar(64) NOT NULL, + PRIMARY KEY (`id_meta`), + KEY `meta_name` (`page`) +) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_meta` +-- + +LOCK TABLES `ps_meta` WRITE; +/*!40000 ALTER TABLE `ps_meta` DISABLE KEYS */; +INSERT INTO `ps_meta` VALUES (1,'404'),(2,'best-sales'),(3,'contact-form'),(4,'index'),(5,'manufacturer'),(6,'new-products'),(7,'password'),(8,'prices-drop'),(9,'sitemap'),(10,'supplier'); +/*!40000 ALTER TABLE `ps_meta` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_meta_lang` +-- + +DROP TABLE IF EXISTS `ps_meta_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_meta_lang` ( + `id_meta` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `title` varchar(255) default NULL, + `description` varchar(255) default NULL, + `keywords` varchar(255) default NULL, + PRIMARY KEY (`id_meta`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_meta_lang` +-- + +LOCK TABLES `ps_meta_lang` WRITE; +/*!40000 ALTER TABLE `ps_meta_lang` DISABLE KEYS */; +INSERT INTO `ps_meta_lang` VALUES (1,1,'404 error','This page cannot be found','error, 404, not found'),(1,2,'Erreur 404','Cette page est introuvable','erreur, 404, introuvable'),(2,1,'Best sales','Our best sales','best sales'),(2,2,'Meilleures ventes','Liste de nos produits les mieux vendus','meilleures ventes'),(3,1,'Contact us','Use our form to contact us','contact, form, e-mail'),(3,2,'Contactez-nous','Utilisez notre formulaire pour nous contacter','contact, formulaire, e-mail'),(4,1,'','Shop powered by PrestaShop','shop, prestashop'),(4,2,'','Boutique propulsée par PrestaShop','boutique, prestashop'),(5,1,'Manufacturers','Manufacturers list','manufacturer'),(5,2,'Fabricants','Liste de nos fabricants','fabricants'),(6,1,'New products','Our new products','new, products'),(6,2,'Nouveaux produits','Liste de nos nouveaux produits','nouveau, produit'),(7,1,'Forgot your password','Enter your e-mail address used to register in goal to get e-mail with your new password','forgot, password, e-mail, new, reset'),(7,2,'Mot de passe oublié','Renseignez votre adresse e-mail afin de recevoir votre nouveau mot de passe.','mot de passe, oublié, e-mail, nouveau, regénération'),(8,1,'Specials','Our special products','special, prices drop'),(8,2,'Promotions','Nos produits en promotion','promotion, réduction'),(9,1,'Sitemap','Lost ? Find what your are looking for','sitemap'),(9,2,'Plan du site','Perdu ? Trouvez ce que vous cherchez','plan, site'),(10,1,'Suppliers','Suppliers list','supplier'),(10,2,'Fournisseurs','Liste de nos fournisseurs','fournisseurs'); +/*!40000 ALTER TABLE `ps_meta_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_module` +-- + +DROP TABLE IF EXISTS `ps_module`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_module` ( + `id_module` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) NOT NULL, + `active` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_module`), + KEY `name` (`name`) +) ENGINE=MyISAM AUTO_INCREMENT=52 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_module` +-- + +LOCK TABLES `ps_module` WRITE; +/*!40000 ALTER TABLE `ps_module` DISABLE KEYS */; +INSERT INTO `ps_module` VALUES (1,'homefeatured',1),(2,'gsitemap',1),(3,'cheque',1),(4,'paypal',1),(5,'editorial',1),(6,'bankwire',1),(7,'blockadvertising',1),(8,'blockbestsellers',1),(9,'blockcart',1),(10,'blockcategories',1),(11,'blockcurrencies',1),(12,'blockinfos',1),(13,'blocklanguages',1),(14,'blockmanufacturer',1),(15,'blockmyaccount',1),(16,'blocknewproducts',1),(17,'blockpaymentlogo',1),(18,'blockpermanentlinks',1),(19,'blocksearch',1),(20,'blockspecials',1),(21,'blocktags',1),(22,'blockuserinfo',1),(23,'blockvariouslinks',1),(24,'blockviewed',1),(25,'statsdata',1),(26,'statsvisits',1),(27,'statssales',1),(28,'statsregistrations',1),(30,'statspersonalinfos',1),(31,'statslive',1),(32,'statsequipment',1),(33,'statscatalog',1),(34,'graphvisifire',1),(35,'graphxmlswfcharts',1),(36,'graphgooglechart',1),(37,'graphartichow',1),(38,'statshome',1),(39,'gridextjs',1),(40,'statsbestcustomers',1),(41,'statsorigin',1),(42,'pagesnotfound',1),(43,'sekeywords',1),(44,'statsproduct',1),(45,'statsbestproducts',1),(46,'statsbestcategories',1),(47,'statsbestvouchers',1),(48,'statsbestsuppliers',1),(49,'statscarrier',1),(50,'statsnewsletter',1),(51,'statssearch',1); +/*!40000 ALTER TABLE `ps_module` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_module_country` +-- + +DROP TABLE IF EXISTS `ps_module_country`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_module_country` ( + `id_module` int(10) unsigned NOT NULL, + `id_country` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_module`,`id_country`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_module_country` +-- + +LOCK TABLES `ps_module_country` WRITE; +/*!40000 ALTER TABLE `ps_module_country` DISABLE KEYS */; +INSERT INTO `ps_module_country` VALUES (3,1),(3,2),(3,3),(3,4),(3,5),(3,6),(3,7),(3,8),(3,9),(3,10),(3,11),(3,12),(3,13),(3,14),(3,15),(3,16),(3,17),(3,18),(3,19),(3,20),(3,21),(3,22),(3,23),(3,24),(3,25),(3,26),(3,27),(3,28),(3,29),(3,30),(3,31),(3,32),(3,33),(3,34),(4,1),(4,2),(4,3),(4,4),(4,5),(4,6),(4,7),(4,8),(4,9),(4,10),(4,11),(4,12),(4,13),(4,14),(4,15),(4,16),(4,17),(4,18),(4,19),(4,20),(4,21),(4,22),(4,23),(4,24),(4,25),(4,26),(4,27),(4,28),(4,29),(4,30),(4,31),(4,32),(4,33),(4,34),(6,1),(6,2),(6,3),(6,4),(6,5),(6,6),(6,7),(6,8),(6,9),(6,10),(6,11),(6,12),(6,13),(6,14),(6,15),(6,16),(6,17),(6,18),(6,19),(6,20),(6,21),(6,22),(6,23),(6,24),(6,25),(6,26),(6,27),(6,28),(6,29),(6,30),(6,31),(6,32),(6,33),(6,34); +/*!40000 ALTER TABLE `ps_module_country` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_module_currency` +-- + +DROP TABLE IF EXISTS `ps_module_currency`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_module_currency` ( + `id_module` int(10) unsigned NOT NULL, + `id_currency` int(11) NOT NULL, + PRIMARY KEY (`id_module`,`id_currency`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_module_currency` +-- + +LOCK TABLES `ps_module_currency` WRITE; +/*!40000 ALTER TABLE `ps_module_currency` DISABLE KEYS */; +INSERT INTO `ps_module_currency` VALUES (3,1),(3,2),(3,3),(4,-2),(6,1),(6,2),(6,3); +/*!40000 ALTER TABLE `ps_module_currency` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_module_group` +-- + +DROP TABLE IF EXISTS `ps_module_group`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_module_group` ( + `id_module` int(10) unsigned NOT NULL, + `id_group` int(11) NOT NULL, + PRIMARY KEY (`id_module`,`id_group`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_module_group` +-- + +LOCK TABLES `ps_module_group` WRITE; +/*!40000 ALTER TABLE `ps_module_group` DISABLE KEYS */; +INSERT INTO `ps_module_group` VALUES (3,1),(4,1),(6,1); +/*!40000 ALTER TABLE `ps_module_group` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_operating_system` +-- + +DROP TABLE IF EXISTS `ps_operating_system`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_operating_system` ( + `id_operating_system` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) default NULL, + PRIMARY KEY (`id_operating_system`) +) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_operating_system` +-- + +LOCK TABLES `ps_operating_system` WRITE; +/*!40000 ALTER TABLE `ps_operating_system` DISABLE KEYS */; +INSERT INTO `ps_operating_system` VALUES (1,'Windows XP'),(2,'Windows Vista'),(3,'MacOsX'),(4,'Linux'); +/*!40000 ALTER TABLE `ps_operating_system` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_order_detail` +-- + +DROP TABLE IF EXISTS `ps_order_detail`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_order_detail` ( + `id_order_detail` int(10) unsigned NOT NULL auto_increment, + `id_order` int(10) unsigned NOT NULL, + `product_id` int(10) unsigned NOT NULL, + `product_attribute_id` int(10) unsigned default NULL, + `product_name` varchar(255) NOT NULL, + `product_quantity` int(10) unsigned NOT NULL default '0', + `product_quantity_in_stock` int(10) unsigned NOT NULL default '0', + `product_quantity_refunded` int(10) unsigned NOT NULL default '0', + `product_quantity_return` int(10) unsigned NOT NULL default '0', + `product_quantity_reinjected` int(10) unsigned NOT NULL default '0', + `product_price` decimal(13,6) NOT NULL default '0.000000', + `product_quantity_discount` decimal(13,6) NOT NULL default '0.000000', + `product_ean13` varchar(13) default NULL, + `product_reference` varchar(32) default NULL, + `product_supplier_reference` varchar(32) default NULL, + `product_weight` float NOT NULL, + `tax_name` varchar(16) NOT NULL, + `tax_rate` decimal(10,2) NOT NULL default '0.00', + `ecotax` decimal(10,2) NOT NULL default '0.00', + `download_hash` varchar(255) default NULL, + `download_nb` int(10) unsigned default '0', + `download_deadline` datetime default '0000-00-00 00:00:00', + PRIMARY KEY (`id_order_detail`), + KEY `order_detail_order` (`id_order`), + KEY `product_id` (`product_id`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_order_detail` +-- + +LOCK TABLES `ps_order_detail` WRITE; +/*!40000 ALTER TABLE `ps_order_detail` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_order_detail` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_order_discount` +-- + +DROP TABLE IF EXISTS `ps_order_discount`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_order_discount` ( + `id_order_discount` int(10) unsigned NOT NULL auto_increment, + `id_order` int(10) unsigned NOT NULL, + `id_discount` int(10) unsigned NOT NULL, + `name` varchar(32) NOT NULL, + `value` decimal(10,2) NOT NULL default '0.00', + PRIMARY KEY (`id_order_discount`), + KEY `order_discount_order` (`id_order`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_order_discount` +-- + +LOCK TABLES `ps_order_discount` WRITE; +/*!40000 ALTER TABLE `ps_order_discount` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_order_discount` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_order_history` +-- + +DROP TABLE IF EXISTS `ps_order_history`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_order_history` ( + `id_order_history` int(10) unsigned NOT NULL auto_increment, + `id_employee` int(10) unsigned NOT NULL, + `id_order` int(10) unsigned NOT NULL, + `id_order_state` int(10) unsigned NOT NULL, + `date_add` datetime NOT NULL, + PRIMARY KEY (`id_order_history`), + KEY `order_history_order` (`id_order`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_order_history` +-- + +LOCK TABLES `ps_order_history` WRITE; +/*!40000 ALTER TABLE `ps_order_history` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_order_history` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_order_message` +-- + +DROP TABLE IF EXISTS `ps_order_message`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_order_message` ( + `id_order_message` int(10) unsigned NOT NULL auto_increment, + `date_add` datetime NOT NULL, + PRIMARY KEY (`id_order_message`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_order_message` +-- + +LOCK TABLES `ps_order_message` WRITE; +/*!40000 ALTER TABLE `ps_order_message` DISABLE KEYS */; +INSERT INTO `ps_order_message` VALUES (1,'2010-06-08 14:08:09'); +/*!40000 ALTER TABLE `ps_order_message` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_order_message_lang` +-- + +DROP TABLE IF EXISTS `ps_order_message_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_order_message_lang` ( + `id_order_message` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(128) NOT NULL, + `message` text NOT NULL, + PRIMARY KEY (`id_order_message`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_order_message_lang` +-- + +LOCK TABLES `ps_order_message_lang` WRITE; +/*!40000 ALTER TABLE `ps_order_message_lang` DISABLE KEYS */; +INSERT INTO `ps_order_message_lang` VALUES (1,1,'Delay','Hi,\n\nUnfortunately, an item on your order is currently out of stock. This may cause a slight delay in delivery.\nPlease accept our apologies and rest assured that we are working hard to rectify this.\n\nBest regards,\n'),(1,2,'Délai','Bonjour,\n\nUn des éléments de votre commande est actuellement en réapprovisionnement, ce qui peut légèrement retarder son envoi.\n\nMerci de votre compréhension.\n\nCordialement, \n'); +/*!40000 ALTER TABLE `ps_order_message_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_order_return` +-- + +DROP TABLE IF EXISTS `ps_order_return`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_order_return` ( + `id_order_return` int(10) unsigned NOT NULL auto_increment, + `id_customer` int(10) unsigned NOT NULL, + `id_order` int(10) unsigned NOT NULL, + `state` tinyint(1) unsigned NOT NULL default '1', + `question` text NOT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_order_return`), + KEY `order_return_customer` (`id_customer`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_order_return` +-- + +LOCK TABLES `ps_order_return` WRITE; +/*!40000 ALTER TABLE `ps_order_return` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_order_return` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_order_return_detail` +-- + +DROP TABLE IF EXISTS `ps_order_return_detail`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_order_return_detail` ( + `id_order_return` int(10) unsigned NOT NULL, + `id_order_detail` int(10) unsigned NOT NULL, + `id_customization` int(10) NOT NULL default '0', + `product_quantity` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`id_order_return`,`id_order_detail`,`id_customization`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_order_return_detail` +-- + +LOCK TABLES `ps_order_return_detail` WRITE; +/*!40000 ALTER TABLE `ps_order_return_detail` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_order_return_detail` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_order_return_state` +-- + +DROP TABLE IF EXISTS `ps_order_return_state`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_order_return_state` ( + `id_order_return_state` int(10) unsigned NOT NULL auto_increment, + `color` varchar(32) default NULL, + PRIMARY KEY (`id_order_return_state`) +) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_order_return_state` +-- + +LOCK TABLES `ps_order_return_state` WRITE; +/*!40000 ALTER TABLE `ps_order_return_state` DISABLE KEYS */; +INSERT INTO `ps_order_return_state` VALUES (1,'#ADD8E6'),(2,'#EEDDFF'),(3,'#DDFFAA'),(4,'#FFD3D3'),(5,'#FFFFBB'); +/*!40000 ALTER TABLE `ps_order_return_state` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_order_return_state_lang` +-- + +DROP TABLE IF EXISTS `ps_order_return_state_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_order_return_state_lang` ( + `id_order_return_state` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(64) NOT NULL, + UNIQUE KEY `order_state_lang_index` (`id_order_return_state`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_order_return_state_lang` +-- + +LOCK TABLES `ps_order_return_state_lang` WRITE; +/*!40000 ALTER TABLE `ps_order_return_state_lang` DISABLE KEYS */; +INSERT INTO `ps_order_return_state_lang` VALUES (1,1,'Waiting for confirmation'),(2,1,'Waiting for package'),(3,1,'Package received'),(4,1,'Return denied'),(5,1,'Return completed'),(1,2,'En attente de confirmation'),(2,2,'En attente du colis'),(3,2,'Colis reçu'),(4,2,'Retour refusé'),(5,2,'Retour terminé'); +/*!40000 ALTER TABLE `ps_order_return_state_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_order_slip` +-- + +DROP TABLE IF EXISTS `ps_order_slip`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_order_slip` ( + `id_order_slip` int(10) unsigned NOT NULL auto_increment, + `id_customer` int(10) unsigned NOT NULL, + `id_order` int(10) unsigned NOT NULL, + `shipping_cost` tinyint(3) unsigned NOT NULL default '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_order_slip`), + KEY `order_slip_customer` (`id_customer`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_order_slip` +-- + +LOCK TABLES `ps_order_slip` WRITE; +/*!40000 ALTER TABLE `ps_order_slip` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_order_slip` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_order_slip_detail` +-- + +DROP TABLE IF EXISTS `ps_order_slip_detail`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_order_slip_detail` ( + `id_order_slip` int(10) unsigned NOT NULL, + `id_order_detail` int(10) unsigned NOT NULL, + `product_quantity` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`id_order_slip`,`id_order_detail`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_order_slip_detail` +-- + +LOCK TABLES `ps_order_slip_detail` WRITE; +/*!40000 ALTER TABLE `ps_order_slip_detail` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_order_slip_detail` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_order_state` +-- + +DROP TABLE IF EXISTS `ps_order_state`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_order_state` ( + `id_order_state` int(10) unsigned NOT NULL auto_increment, + `invoice` tinyint(1) unsigned default '0', + `send_email` tinyint(1) unsigned NOT NULL default '0', + `color` varchar(32) default NULL, + `unremovable` tinyint(1) unsigned NOT NULL, + `hidden` tinyint(1) unsigned NOT NULL default '0', + `logable` tinyint(1) NOT NULL default '0', + `delivery` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_order_state`) +) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_order_state` +-- + +LOCK TABLES `ps_order_state` WRITE; +/*!40000 ALTER TABLE `ps_order_state` DISABLE KEYS */; +INSERT INTO `ps_order_state` VALUES (1,0,1,'lightblue',1,0,0,0),(2,1,1,'#DDEEFF',1,0,1,0),(3,1,1,'#FFDD99',1,0,1,1),(4,1,1,'#EEDDFF',1,0,1,1),(5,1,0,'#DDFFAA',1,0,1,1),(6,1,1,'#DADADA',1,0,0,0),(7,1,1,'#FFFFBB',1,0,0,0),(8,0,1,'#FFDFDF',1,0,0,0),(9,1,1,'#FFD3D3',1,0,0,0),(10,0,1,'lightblue',1,0,0,0),(11,0,0,'lightblue',1,0,0,0); +/*!40000 ALTER TABLE `ps_order_state` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_order_state_lang` +-- + +DROP TABLE IF EXISTS `ps_order_state_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_order_state_lang` ( + `id_order_state` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(64) NOT NULL, + `template` varchar(64) NOT NULL, + UNIQUE KEY `order_state_lang_index` (`id_order_state`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_order_state_lang` +-- + +LOCK TABLES `ps_order_state_lang` WRITE; +/*!40000 ALTER TABLE `ps_order_state_lang` DISABLE KEYS */; +INSERT INTO `ps_order_state_lang` VALUES (1,1,'Awaiting cheque payment','cheque'),(2,1,'Payment accepted','payment'),(3,1,'Preparation in progress','preparation'),(4,1,'Shipped','shipped'),(5,1,'Delivered',''),(6,1,'Canceled','order_canceled'),(7,1,'Refund','refund'),(8,1,'Payment error','payment_error'),(9,1,'Out of stock','outofstock'),(10,1,'Awaiting bank wire payment','bankwire'),(11,1,'Awaiting PayPal payment',''),(1,2,'En attente du paiement par chèque','cheque'),(2,2,'Paiement accepté','payment'),(3,2,'Préparation en cours','preparation'),(4,2,'En cours de livraison','shipped'),(5,2,'Livré',''),(6,2,'Annulé','order_canceled'),(7,2,'Remboursé','refund'),(8,2,'Erreur de paiement','payment_error'),(9,2,'Produit(s) indisponibles','outofstock'),(10,2,'En attente du paiement par virement bancaire','bankwire'),(11,2,'En attente du paiement par PayPal',''); +/*!40000 ALTER TABLE `ps_order_state_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_orders` +-- + +DROP TABLE IF EXISTS `ps_orders`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_orders` ( + `id_order` int(10) unsigned NOT NULL auto_increment, + `id_carrier` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `id_customer` int(10) unsigned NOT NULL, + `id_cart` int(10) unsigned NOT NULL, + `id_currency` int(10) unsigned NOT NULL, + `id_address_delivery` int(10) unsigned NOT NULL, + `id_address_invoice` int(10) unsigned NOT NULL, + `secure_key` varchar(32) NOT NULL default '-1', + `payment` varchar(255) NOT NULL, + `module` varchar(255) default NULL, + `recyclable` tinyint(1) unsigned NOT NULL default '0', + `gift` tinyint(1) unsigned NOT NULL default '0', + `gift_message` text, + `shipping_number` varchar(32) default NULL, + `total_discounts` decimal(10,2) NOT NULL default '0.00', + `total_paid` decimal(10,2) NOT NULL default '0.00', + `total_paid_real` decimal(10,2) NOT NULL default '0.00', + `total_products` decimal(10,2) NOT NULL default '0.00', + `total_shipping` decimal(10,2) NOT NULL default '0.00', + `total_wrapping` decimal(10,2) NOT NULL default '0.00', + `invoice_number` int(10) unsigned NOT NULL default '0', + `delivery_number` int(10) unsigned NOT NULL default '0', + `invoice_date` datetime NOT NULL, + `delivery_date` datetime NOT NULL, + `valid` int(1) unsigned NOT NULL default '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_order`), + KEY `id_customer` (`id_customer`), + KEY `id_cart` (`id_cart`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_orders` +-- + +LOCK TABLES `ps_orders` WRITE; +/*!40000 ALTER TABLE `ps_orders` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_orders` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_pack` +-- + +DROP TABLE IF EXISTS `ps_pack`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_pack` ( + `id_product_pack` int(10) unsigned NOT NULL, + `id_product_item` int(10) unsigned NOT NULL, + `quantity` int(10) unsigned NOT NULL default '1', + PRIMARY KEY (`id_product_pack`,`id_product_item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_pack` +-- + +LOCK TABLES `ps_pack` WRITE; +/*!40000 ALTER TABLE `ps_pack` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_pack` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_page` +-- + +DROP TABLE IF EXISTS `ps_page`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_page` ( + `id_page` int(10) unsigned NOT NULL auto_increment, + `id_page_type` int(10) unsigned NOT NULL, + `id_object` int(10) unsigned default NULL, + PRIMARY KEY (`id_page`), + KEY `id_page_type` (`id_page_type`), + KEY `id_object` (`id_object`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_page` +-- + +LOCK TABLES `ps_page` WRITE; +/*!40000 ALTER TABLE `ps_page` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_page` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_page_type` +-- + +DROP TABLE IF EXISTS `ps_page_type`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_page_type` ( + `id_page_type` int(10) unsigned NOT NULL auto_increment, + `name` varchar(255) NOT NULL, + PRIMARY KEY (`id_page_type`), + KEY `name` (`name`) +) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_page_type` +-- + +LOCK TABLES `ps_page_type` WRITE; +/*!40000 ALTER TABLE `ps_page_type` DISABLE KEYS */; +INSERT INTO `ps_page_type` VALUES (1,'product.php'),(2,'category.php'),(3,'order.php'),(4,'manufacturer.php'); +/*!40000 ALTER TABLE `ps_page_type` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_page_viewed` +-- + +DROP TABLE IF EXISTS `ps_page_viewed`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_page_viewed` ( + `id_page` int(10) unsigned NOT NULL, + `id_date_range` int(10) unsigned NOT NULL, + `counter` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_page`,`id_date_range`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_page_viewed` +-- + +LOCK TABLES `ps_page_viewed` WRITE; +/*!40000 ALTER TABLE `ps_page_viewed` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_page_viewed` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_pagenotfound` +-- + +DROP TABLE IF EXISTS `ps_pagenotfound`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_pagenotfound` ( + `id_pagenotfound` int(10) unsigned NOT NULL auto_increment, + `request_uri` varchar(256) NOT NULL, + `http_referer` varchar(256) NOT NULL, + `date_add` datetime NOT NULL, + PRIMARY KEY (`id_pagenotfound`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_pagenotfound` +-- + +LOCK TABLES `ps_pagenotfound` WRITE; +/*!40000 ALTER TABLE `ps_pagenotfound` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_pagenotfound` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_product` +-- + +DROP TABLE IF EXISTS `ps_product`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_product` ( + `id_product` int(10) unsigned NOT NULL auto_increment, + `id_supplier` int(10) unsigned default NULL, + `id_manufacturer` int(10) unsigned default NULL, + `id_tax` int(10) unsigned NOT NULL, + `id_category_default` int(10) unsigned default NULL, + `id_color_default` int(10) unsigned default NULL, + `on_sale` tinyint(1) unsigned NOT NULL default '0', + `ean13` varchar(13) default NULL, + `ecotax` decimal(10,2) NOT NULL default '0.00', + `quantity` int(10) unsigned NOT NULL default '0', + `price` decimal(13,6) NOT NULL default '0.000000', + `wholesale_price` decimal(13,6) NOT NULL default '0.000000', + `reduction_price` decimal(10,2) default NULL, + `reduction_percent` float default NULL, + `reduction_from` date default NULL, + `reduction_to` date default NULL, + `reference` varchar(32) default NULL, + `supplier_reference` varchar(32) default NULL, + `location` varchar(64) default NULL, + `weight` float NOT NULL default '0', + `out_of_stock` int(10) unsigned NOT NULL default '2', + `quantity_discount` tinyint(1) default '0', + `customizable` tinyint(2) NOT NULL default '0', + `uploadable_files` tinyint(4) NOT NULL default '0', + `text_fields` tinyint(4) NOT NULL default '0', + `active` tinyint(1) unsigned NOT NULL default '0', + `indexed` tinyint(1) NOT NULL default '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_product`), + KEY `product_supplier` (`id_supplier`), + KEY `product_manufacturer` (`id_manufacturer`) +) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_product` +-- + +LOCK TABLES `ps_product` WRITE; +/*!40000 ALTER TABLE `ps_product` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_product` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_product_attachment` +-- + +DROP TABLE IF EXISTS `ps_product_attachment`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_product_attachment` ( + `id_product` int(10) NOT NULL, + `id_attachment` int(10) NOT NULL, + PRIMARY KEY (`id_product`,`id_attachment`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_product_attachment` +-- + +LOCK TABLES `ps_product_attachment` WRITE; +/*!40000 ALTER TABLE `ps_product_attachment` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_product_attachment` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_product_attribute` +-- + +DROP TABLE IF EXISTS `ps_product_attribute`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_product_attribute` ( + `id_product_attribute` int(10) unsigned NOT NULL auto_increment, + `id_product` int(10) unsigned NOT NULL, + `reference` varchar(32) default NULL, + `supplier_reference` varchar(32) default NULL, + `location` varchar(64) default NULL, + `ean13` varchar(13) default NULL, + `wholesale_price` decimal(13,6) NOT NULL default '0.000000', + `price` decimal(10,2) NOT NULL default '0.00', + `ecotax` decimal(10,2) NOT NULL default '0.00', + `quantity` int(10) unsigned NOT NULL default '0', + `weight` float NOT NULL default '0', + `default_on` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_product_attribute`), + KEY `product_attribute_product` (`id_product`), + KEY `reference` (`reference`), + KEY `supplier_reference` (`supplier_reference`) +) ENGINE=MyISAM AUTO_INCREMENT=43 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_product_attribute` +-- + +LOCK TABLES `ps_product_attribute` WRITE; +/*!40000 ALTER TABLE `ps_product_attribute` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_product_attribute` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_product_attribute_combination` +-- + +DROP TABLE IF EXISTS `ps_product_attribute_combination`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_product_attribute_combination` ( + `id_attribute` int(10) unsigned NOT NULL, + `id_product_attribute` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_attribute`,`id_product_attribute`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_product_attribute_combination` +-- + +LOCK TABLES `ps_product_attribute_combination` WRITE; +/*!40000 ALTER TABLE `ps_product_attribute_combination` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_product_attribute_combination` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_product_attribute_image` +-- + +DROP TABLE IF EXISTS `ps_product_attribute_image`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_product_attribute_image` ( + `id_product_attribute` int(10) NOT NULL, + `id_image` int(10) NOT NULL, + PRIMARY KEY (`id_product_attribute`,`id_image`), + KEY `id_image` (`id_image`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_product_attribute_image` +-- + +LOCK TABLES `ps_product_attribute_image` WRITE; +/*!40000 ALTER TABLE `ps_product_attribute_image` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_product_attribute_image` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_product_download` +-- + +DROP TABLE IF EXISTS `ps_product_download`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_product_download` ( + `id_product_download` int(10) unsigned NOT NULL auto_increment, + `id_product` int(10) unsigned NOT NULL, + `display_filename` varchar(255) default NULL, + `physically_filename` varchar(255) default NULL, + `date_deposit` datetime NOT NULL, + `date_expiration` datetime default NULL, + `nb_days_accessible` int(10) unsigned default NULL, + `nb_downloadable` int(10) unsigned default '1', + `active` tinyint(1) unsigned NOT NULL default '1', + PRIMARY KEY (`id_product_download`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_product_download` +-- + +LOCK TABLES `ps_product_download` WRITE; +/*!40000 ALTER TABLE `ps_product_download` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_product_download` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_product_lang` +-- + +DROP TABLE IF EXISTS `ps_product_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_product_lang` ( + `id_product` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `description` text, + `description_short` text, + `link_rewrite` varchar(128) NOT NULL, + `meta_description` varchar(255) default NULL, + `meta_keywords` varchar(255) default NULL, + `meta_title` varchar(128) default NULL, + `name` varchar(128) NOT NULL, + `available_now` varchar(255) default NULL, + `available_later` varchar(255) default NULL, + UNIQUE KEY `product_lang_index` (`id_product`,`id_lang`), + KEY `id_lang` (`id_lang`), + KEY `name` (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_product_lang` +-- + +LOCK TABLES `ps_product_lang` WRITE; +/*!40000 ALTER TABLE `ps_product_lang` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_product_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_product_sale` +-- + +DROP TABLE IF EXISTS `ps_product_sale`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_product_sale` ( + `id_product` int(10) unsigned NOT NULL, + `quantity` int(10) unsigned NOT NULL default '0', + `sale_nbr` int(10) unsigned NOT NULL default '0', + `date_upd` date NOT NULL, + PRIMARY KEY (`id_product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_product_sale` +-- + +LOCK TABLES `ps_product_sale` WRITE; +/*!40000 ALTER TABLE `ps_product_sale` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_product_sale` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_product_tag` +-- + +DROP TABLE IF EXISTS `ps_product_tag`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_product_tag` ( + `id_product` int(10) unsigned NOT NULL, + `id_tag` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_product`,`id_tag`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_product_tag` +-- + +LOCK TABLES `ps_product_tag` WRITE; +/*!40000 ALTER TABLE `ps_product_tag` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_product_tag` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_profile` +-- + +DROP TABLE IF EXISTS `ps_profile`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_profile` ( + `id_profile` int(10) unsigned NOT NULL auto_increment, + PRIMARY KEY (`id_profile`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_profile` +-- + +LOCK TABLES `ps_profile` WRITE; +/*!40000 ALTER TABLE `ps_profile` DISABLE KEYS */; +INSERT INTO `ps_profile` VALUES (1); +/*!40000 ALTER TABLE `ps_profile` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_profile_lang` +-- + +DROP TABLE IF EXISTS `ps_profile_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_profile_lang` ( + `id_lang` int(10) unsigned NOT NULL, + `id_profile` int(10) unsigned NOT NULL, + `name` varchar(128) NOT NULL, + PRIMARY KEY (`id_profile`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_profile_lang` +-- + +LOCK TABLES `ps_profile_lang` WRITE; +/*!40000 ALTER TABLE `ps_profile_lang` DISABLE KEYS */; +INSERT INTO `ps_profile_lang` VALUES (1,1,'Administrator'),(2,1,'Administrateur'); +/*!40000 ALTER TABLE `ps_profile_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_quick_access` +-- + +DROP TABLE IF EXISTS `ps_quick_access`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_quick_access` ( + `id_quick_access` int(10) unsigned NOT NULL auto_increment, + `new_window` tinyint(1) NOT NULL default '0', + `link` varchar(128) NOT NULL, + PRIMARY KEY (`id_quick_access`) +) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_quick_access` +-- + +LOCK TABLES `ps_quick_access` WRITE; +/*!40000 ALTER TABLE `ps_quick_access` DISABLE KEYS */; +INSERT INTO `ps_quick_access` VALUES (1,0,'index.php'),(2,1,'../'),(3,0,'index.php?tab=AdminCatalog&addcategory'),(4,0,'index.php?tab=AdminCatalog&addproduct'),(5,0,'index.php?tab=AdminDiscounts&adddiscount'); +/*!40000 ALTER TABLE `ps_quick_access` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_quick_access_lang` +-- + +DROP TABLE IF EXISTS `ps_quick_access_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_quick_access_lang` ( + `id_quick_access` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(32) NOT NULL, + PRIMARY KEY (`id_quick_access`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_quick_access_lang` +-- + +LOCK TABLES `ps_quick_access_lang` WRITE; +/*!40000 ALTER TABLE `ps_quick_access_lang` DISABLE KEYS */; +INSERT INTO `ps_quick_access_lang` VALUES (1,1,'Home'),(1,2,'Accueil'),(2,1,'My Shop'),(2,2,'Ma boutique'),(3,1,'New category'),(3,2,'Nouvelle catégorie'),(4,1,'New product'),(4,2,'Nouveau produit'),(5,1,'New voucher'),(5,2,'Nouveau bon de réduction'); +/*!40000 ALTER TABLE `ps_quick_access_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_range_price` +-- + +DROP TABLE IF EXISTS `ps_range_price`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_range_price` ( + `id_range_price` int(10) unsigned NOT NULL auto_increment, + `id_carrier` int(10) unsigned NOT NULL, + `delimiter1` decimal(13,6) NOT NULL, + `delimiter2` decimal(13,6) NOT NULL, + PRIMARY KEY (`id_range_price`), + UNIQUE KEY `id_carrier` (`id_carrier`,`delimiter1`,`delimiter2`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_range_price` +-- + +LOCK TABLES `ps_range_price` WRITE; +/*!40000 ALTER TABLE `ps_range_price` DISABLE KEYS */; +INSERT INTO `ps_range_price` VALUES (1,2,'0.000000','10000.000000'); +/*!40000 ALTER TABLE `ps_range_price` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_range_weight` +-- + +DROP TABLE IF EXISTS `ps_range_weight`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_range_weight` ( + `id_range_weight` int(10) unsigned NOT NULL auto_increment, + `id_carrier` int(10) unsigned NOT NULL, + `delimiter1` decimal(13,6) NOT NULL, + `delimiter2` decimal(13,6) NOT NULL, + PRIMARY KEY (`id_range_weight`), + UNIQUE KEY `id_carrier` (`id_carrier`,`delimiter1`,`delimiter2`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_range_weight` +-- + +LOCK TABLES `ps_range_weight` WRITE; +/*!40000 ALTER TABLE `ps_range_weight` DISABLE KEYS */; +INSERT INTO `ps_range_weight` VALUES (1,2,'0.000000','10000.000000'); +/*!40000 ALTER TABLE `ps_range_weight` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_referrer` +-- + +DROP TABLE IF EXISTS `ps_referrer`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_referrer` ( + `id_referrer` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) NOT NULL, + `passwd` varchar(32) default NULL, + `http_referer_regexp` varchar(64) default NULL, + `http_referer_like` varchar(64) default NULL, + `request_uri_regexp` varchar(64) default NULL, + `request_uri_like` varchar(64) default NULL, + `http_referer_regexp_not` varchar(64) default NULL, + `http_referer_like_not` varchar(64) default NULL, + `request_uri_regexp_not` varchar(64) default NULL, + `request_uri_like_not` varchar(64) default NULL, + `base_fee` decimal(5,2) NOT NULL default '0.00', + `percent_fee` decimal(5,2) NOT NULL default '0.00', + `click_fee` decimal(5,2) NOT NULL default '0.00', + `cache_visitors` int(11) default NULL, + `cache_visits` int(11) default NULL, + `cache_pages` int(11) default NULL, + `cache_registrations` int(11) default NULL, + `cache_orders` int(11) default NULL, + `cache_sales` decimal(10,2) default NULL, + `cache_reg_rate` decimal(5,4) default NULL, + `cache_order_rate` decimal(5,4) default NULL, + `date_add` datetime NOT NULL, + PRIMARY KEY (`id_referrer`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_referrer` +-- + +LOCK TABLES `ps_referrer` WRITE; +/*!40000 ALTER TABLE `ps_referrer` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_referrer` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_referrer_cache` +-- + +DROP TABLE IF EXISTS `ps_referrer_cache`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_referrer_cache` ( + `id_connections_source` int(11) NOT NULL, + `id_referrer` int(11) NOT NULL, + PRIMARY KEY (`id_connections_source`,`id_referrer`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_referrer_cache` +-- + +LOCK TABLES `ps_referrer_cache` WRITE; +/*!40000 ALTER TABLE `ps_referrer_cache` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_referrer_cache` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_scene` +-- + +DROP TABLE IF EXISTS `ps_scene`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_scene` ( + `id_scene` int(10) unsigned NOT NULL auto_increment, + `active` tinyint(1) NOT NULL default '1', + PRIMARY KEY (`id_scene`) +) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_scene` +-- + +LOCK TABLES `ps_scene` WRITE; +/*!40000 ALTER TABLE `ps_scene` DISABLE KEYS */; +INSERT INTO `ps_scene` VALUES (1,1),(2,1),(3,1); +/*!40000 ALTER TABLE `ps_scene` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_scene_category` +-- + +DROP TABLE IF EXISTS `ps_scene_category`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_scene_category` ( + `id_scene` int(10) NOT NULL, + `id_category` int(10) NOT NULL, + PRIMARY KEY (`id_scene`,`id_category`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_scene_category` +-- + +LOCK TABLES `ps_scene_category` WRITE; +/*!40000 ALTER TABLE `ps_scene_category` DISABLE KEYS */; +INSERT INTO `ps_scene_category` VALUES (1,2),(2,2),(3,4); +/*!40000 ALTER TABLE `ps_scene_category` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_scene_lang` +-- + +DROP TABLE IF EXISTS `ps_scene_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_scene_lang` ( + `id_scene` int(10) NOT NULL, + `id_lang` int(10) NOT NULL, + `name` varchar(100) NOT NULL, + PRIMARY KEY (`id_scene`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_scene_lang` +-- + +LOCK TABLES `ps_scene_lang` WRITE; +/*!40000 ALTER TABLE `ps_scene_lang` DISABLE KEYS */; +INSERT INTO `ps_scene_lang` VALUES (1,1,'The iPods Nano'),(1,2,'Les iPods Nano'),(2,1,'The iPods'),(2,2,'Les iPods'),(3,1,'The MacBooks'),(3,2,'Les MacBooks'); +/*!40000 ALTER TABLE `ps_scene_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_scene_products` +-- + +DROP TABLE IF EXISTS `ps_scene_products`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_scene_products` ( + `id_scene` int(10) NOT NULL, + `id_product` int(10) NOT NULL, + `x_axis` int(4) NOT NULL, + `y_axis` int(4) NOT NULL, + `zone_width` int(3) NOT NULL, + `zone_height` int(3) NOT NULL, + PRIMARY KEY (`id_scene`,`id_product`,`x_axis`,`y_axis`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_scene_products` +-- + +LOCK TABLES `ps_scene_products` WRITE; +/*!40000 ALTER TABLE `ps_scene_products` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_scene_products` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_search_engine` +-- + +DROP TABLE IF EXISTS `ps_search_engine`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_search_engine` ( + `id_search_engine` int(10) unsigned NOT NULL auto_increment, + `server` varchar(64) NOT NULL, + `getvar` varchar(16) NOT NULL, + PRIMARY KEY (`id_search_engine`) +) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_search_engine` +-- + +LOCK TABLES `ps_search_engine` WRITE; +/*!40000 ALTER TABLE `ps_search_engine` DISABLE KEYS */; +INSERT INTO `ps_search_engine` VALUES (1,'google','q'),(2,'search.aol','query'),(3,'yandex.ru','text'),(4,'ask.com','q'),(5,'nhl.com','q'),(6,'search.yahoo','p'),(7,'baidu.com','wd'),(8,'search.lycos','query'),(9,'exalead','q'),(10,'search.live.com','q'),(11,'search.ke.voila','rdata'),(12,'altavista','q'),(13,'bing.com','q'); +/*!40000 ALTER TABLE `ps_search_engine` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_search_index` +-- + +DROP TABLE IF EXISTS `ps_search_index`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_search_index` ( + `id_product` int(11) NOT NULL, + `id_word` int(11) NOT NULL, + `weight` tinyint(4) NOT NULL default '1', + PRIMARY KEY (`id_word`,`id_product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_search_index` +-- + +LOCK TABLES `ps_search_index` WRITE; +/*!40000 ALTER TABLE `ps_search_index` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_search_index` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_search_word` +-- + +DROP TABLE IF EXISTS `ps_search_word`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_search_word` ( + `id_word` int(10) unsigned NOT NULL auto_increment, + `id_lang` int(10) unsigned NOT NULL, + `word` varchar(15) NOT NULL, + PRIMARY KEY (`id_word`), + UNIQUE KEY `id_lang` (`id_lang`,`word`) +) ENGINE=MyISAM AUTO_INCREMENT=1036 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_search_word` +-- + +LOCK TABLES `ps_search_word` WRITE; +/*!40000 ALTER TABLE `ps_search_word` DISABLE KEYS */; +INSERT INTO `ps_search_word` VALUES (1,1,'ipod'),(2,1,'nano'),(3,1,'design'),(4,1,'features'),(5,1,'16gb'),(6,1,'rocks'),(7,1,'like'),(8,1,'never'),(9,1,'before'),(10,1,'curved'),(11,1,'ahead'),(12,1,'curve'),(13,1,'those'),(14,1,'about'),(15,1,'rock,'),(16,1,'give'),(17,1,'nine'),(18,1,'amazing'),(19,1,'colors'),(20,1,'that'),(21,1,'only'),(22,1,'part'),(23,1,'story'),(24,1,'feel'),(25,1,'curved,'),(26,1,'allaluminum'),(27,1,'glass'),(28,1,'want'),(29,1,'down'),(30,1,'great'),(31,1,'looks'),(32,1,'brains,'),(33,1,'genius'),(34,1,'feature'),(35,1,'turns'),(36,1,'into'),(37,1,'your'),(38,1,'highly'),(39,1,'intelligent,'),(40,1,'personal'),(41,1,'creates'),(42,1,'playlists'),(43,1,'finding'),(44,1,'songs'),(45,1,'library'),(46,1,'together'),(47,1,'made'),(48,1,'move'),(49,1,'with'),(50,1,'moves'),(51,1,'accelerometer'),(52,1,'comes'),(53,1,'shake'),(54,1,'shuffle'),(55,1,'music'),(56,1,'turn'),(57,1,'sideways'),(58,1,'view'),(59,1,'cover'),(60,1,'flow'),(61,1,'play'),(62,1,'games'),(63,1,'designed'),(64,1,'mind'),(65,1,'ipods'),(66,1,'apple'),(67,1,'computer,'),(68,1,'metal'),(69,1,'16go'),(70,1,'yellow'),(71,1,'blue'),(72,1,'black'),(73,1,'orange'),(74,1,'pink'),(75,1,'green'),(76,1,'purple'),(77,1,'grams'),(78,1,'minijack'),(79,1,'stereo'),(80,2,'ipod'),(81,2,'nano'),(82,2,'nouveau'),(83,2,'design'),(84,2,'nouvelles'),(85,2,'fonctionnalités'),(86,2,'désormais'),(87,2,'nano,'),(88,2,'plus'),(89,2,'rock'),(90,2,'jamais'),(91,2,'courbes'),(92,2,'avantageuses'),(93,2,'pour'),(94,2,'amateurs'),(95,2,'sensations,'),(96,2,'voici'),(97,2,'neuf'),(98,2,'nouveaux'),(99,2,'coloris'),(100,2,'n\'est'),(101,2,'tout'),(102,2,'faites'),(103,2,'l\'expérience'),(104,2,'elliptique'),(105,2,'aluminum'),(106,2,'verre'),(107,2,'vous'),(108,2,'voudrez'),(109,2,'lâcher'),(110,2,'beau'),(111,2,'intelligent'),(112,2,'nouvelle'),(113,2,'fonctionnalité'),(114,2,'genius'),(115,2,'fait'),(116,2,'d\'ipod'),(117,2,'votre'),(118,2,'personnel'),(119,2,'crée'),(120,2,'listes'),(121,2,'lecture'),(122,2,'recherchant'),(123,2,'dans'),(124,2,'bibliothèque'),(125,2,'chansons'),(126,2,'vont'),(127,2,'bien'),(128,2,'ensemble'),(129,2,'bouger'),(130,2,'avec'),(131,2,'équipé'),(132,2,'l\'accéléromètre'),(133,2,'secouezle'),(134,2,'mélanger'),(135,2,'musique'),(136,2,'basculezle'),(137,2,'afficher'),(138,2,'cover'),(139,2,'flow'),(140,2,'découvrez'),(141,2,'jeux'),(142,2,'adaptés'),(143,2,'mouvements'),(144,2,'ipods'),(145,2,'apple'),(146,2,'computer,'),(147,2,'metal'),(148,2,'16go'),(149,2,'jaune'),(150,2,'bleu'),(151,2,'noir'),(152,2,'orange'),(153,2,'rose'),(154,2,'vert'),(155,2,'violet'),(156,2,'grammes'),(157,2,'minijack'),(158,2,'stéréo'),(159,1,'shuffle,'),(160,1,'world'),(161,1,'most'),(162,1,'wearable'),(163,1,'player,'),(164,1,'clips'),(165,1,'more'),(166,1,'vibrant'),(167,1,'blue,'),(168,1,'green,'),(169,1,'pink,'),(170,1,'instant'),(171,1,'attachment'),(172,1,'wear'),(173,1,'sleeve'),(174,1,'belt'),(175,1,'shorts'),(176,1,'badge'),(177,1,'musical'),(178,1,'devotion'),(179,1,'new,'),(180,1,'brilliant'),(181,1,'feed'),(182,1,'itunes'),(183,1,'entertainment'),(184,1,'superstore'),(185,1,'ultraorganized'),(186,1,'collection'),(187,1,'jukebox'),(188,1,'load'),(189,1,'click'),(190,1,'beauty'),(191,1,'beat'),(192,1,'intensely'),(193,1,'colorful'),(194,1,'anodized'),(195,1,'aluminum'),(196,1,'complements'),(197,1,'simple'),(198,1,'red,'),(199,1,'original'),(200,1,'silver'),(201,1,'(clip'),(202,1,'compris)'),(203,2,'shuffle'),(204,2,'shuffle,'),(205,2,'baladeur'),(206,2,'portable'),(207,2,'monde,'),(208,2,'clippe'),(209,2,'maintenant'),(210,2,'bleu,'),(211,2,'vert,'),(212,2,'rouge'),(213,2,'lien'),(214,2,'immédiat'),(215,2,'portez'),(217,2,'accrochées'),(218,2,'manche,'),(219,2,'ceinture'),(220,2,'short'),(221,2,'arborez'),(222,2,'comme'),(223,2,'signe'),(224,2,'extérieur'),(225,2,'passion'),(226,2,'existe'),(227,2,'quatre'),(228,2,'encore'),(229,2,'éclatants'),(230,2,'emplissez'),(231,2,'itunes'),(232,2,'immense'),(233,2,'magasin'),(234,2,'dédié'),(235,2,'divertissement,'),(236,2,'collection'),(237,2,'musicale'),(238,2,'parfaitement'),(239,2,'organisée'),(240,2,'jukebox'),(241,2,'pouvez'),(242,2,'seul'),(243,2,'clic'),(244,2,'remplir'),(245,2,'technicolor'),(246,2,'s\'affiche'),(247,2,'intenses'),(248,2,'rehaussent'),(249,2,'épuré'),(250,2,'boîtier'),(251,2,'aluminium'),(252,2,'anodisé'),(253,2,'choisissez'),(254,2,'parmi'),(255,2,'rose,'),(256,2,'l\'argenté'),(257,2,'d\'origine'),(258,2,'(clip'),(259,2,'compris)'),(260,1,'macbook'),(261,1,'ultrathin,'),(262,1,'ultraportable,'),(263,1,'ultra'),(264,1,'unlike'),(265,1,'anything'),(266,1,'else'),(267,1,'lose'),(268,1,'inches'),(269,1,'pounds'),(270,1,'overnight'),(271,1,'result'),(272,1,'rethinking'),(273,1,'conventions'),(274,1,'multiple'),(275,1,'wireless'),(276,1,'innovations'),(277,1,'breakthrough'),(278,1,'air,'),(279,1,'mobile'),(280,1,'computing'),(281,1,'suddenly'),(282,1,'standard'),(283,1,'nearly'),(284,1,'thin'),(285,1,'index'),(286,1,'finger'),(287,1,'practically'),(288,1,'every'),(289,1,'detail'),(290,1,'could'),(291,1,'streamlined'),(292,1,'been'),(293,1,'still'),(294,1,'133inch'),(295,1,'widescreen'),(296,1,'display,'),(297,1,'fullsize'),(298,1,'keyboard,'),(299,1,'large'),(300,1,'multitouch'),(301,1,'trackpad'),(302,1,'incomparably'),(303,1,'portable'),(304,1,'without'),(305,1,'usual'),(306,1,'ultraportable'),(307,1,'screen'),(308,1,'keyboard'),(309,1,'compromisesthe'),(310,1,'incredible'),(311,1,'thinness'),(312,1,'numerous'),(313,1,'size'),(314,1,'weightshaving'),(315,1,'from'),(316,1,'slimmer'),(317,1,'hard'),(318,1,'drive'),(319,1,'strategically'),(320,1,'hidden'),(321,1,'ports'),(322,1,'lowerprofile'),(323,1,'battery,'),(324,1,'everything'),(325,1,'considered'),(326,1,'reconsidered'),(327,1,'mindmacbook'),(328,1,'engineered'),(329,1,'take'),(330,1,'full'),(331,1,'advantage'),(332,1,'which'),(333,1,'80211n'),(334,1,'wifi'),(335,1,'fast'),(336,1,'available,'),(337,1,'people'),(338,1,'truly'),(339,1,'living'),(340,1,'untethered'),(341,1,'buying'),(342,1,'renting'),(343,1,'movies'),(344,1,'online,'),(345,1,'downloading'),(346,1,'software,'),(347,1,'sharing'),(348,1,'storing'),(349,1,'files'),(350,1,'laptops'),(351,1,'80gb'),(352,1,'parallel'),(353,1,'4200'),(354,1,'160ghz'),(355,1,'intel'),(356,1,'core'),(357,1,'optional'),(358,1,'64gb'),(359,1,'solidstate'),(360,1,'180ghz'),(361,2,'macbook'),(362,2,'ultra'),(363,2,'fin,'),(364,2,'différent'),(365,2,'reste'),(366,2,'mais'),(367,2,'perd'),(368,2,'kilos'),(369,2,'centimètres'),(370,2,'nuit'),(371,2,'c\'est'),(372,2,'résultat'),(373,2,'d\'une'),(374,2,'réinvention'),(375,2,'normes'),(376,2,'multitude'),(377,2,'d\'innovations'),(378,2,'sans'),(379,2,'révolution'),(380,2,'air,'),(381,2,'l\'informatique'),(382,2,'mobile'),(383,2,'prend'),(384,2,'soudain'),(385,2,'dimension'),(386,2,'presque'),(387,2,'aussi'),(388,2,'index'),(389,2,'pratiquement'),(390,2,'pouvait'),(391,2,'être'),(392,2,'simplifié'),(393,2,'n\'en'),(394,2,'dispose'),(395,2,'moins'),(396,2,'d\'un'),(397,2,'écran'),(398,2,'panoramique'),(399,2,'pouces,'),(400,2,'clavier'),(401,2,'complet'),(402,2,'vaste'),(403,2,'trackpad'),(404,2,'multitouch'),(405,2,'incomparablemen'),(406,2,'évite'),(407,2,'compromis'),(408,2,'habituels'),(409,2,'matière'),(410,2,'d\'écran'),(411,2,'ultraportablesl'),(412,2,'finesse'),(413,2,'grand'),(414,2,'nombre'),(415,2,'termes'),(416,2,'réduction'),(417,2,'taille'),(418,2,'poids'),(419,2,'disque'),(420,2,'ports'),(421,2,'habilement'),(422,2,'dissimulés'),(423,2,'passant'),(424,2,'batterie'),(425,2,'plate,'),(426,2,'chaque'),(427,2,'détail'),(428,2,'considéré'),(429,2,'reconsidéré'),(430,2,'l\'espritmacbook'),(431,2,'conçu'),(432,2,'élaboré'),(433,2,'profiter'),(434,2,'pleinement'),(435,2,'monde'),(436,2,'lequel'),(437,2,'norme'),(438,2,'wifi'),(439,2,'80211n'),(440,2,'rapide'),(441,2,'accessible'),(442,2,'qu\'elle'),(443,2,'permet'),(444,2,'véritablement'),(445,2,'libérer'),(446,2,'toute'),(447,2,'attache'),(448,2,'acheter'),(449,2,'vidéos'),(450,2,'ligne,'),(451,2,'télécharger'),(452,2,'logicééééiels,'),(453,2,'stocker'),(454,2,'partager'),(455,2,'fichiers'),(456,2,'portables'),(457,2,'macbookair'),(458,2,'pata'),(459,2,'intel'),(460,2,'core'),(461,2,'(solidstate'),(462,2,'drive)'),(463,1,'makes'),(464,1,'easy'),(465,1,'road'),(466,1,'thanks'),(467,1,'tough'),(468,1,'polycarbonate'),(469,1,'case,'),(470,1,'builtin'),(471,1,'technologies,'),(472,1,'innovative'),(473,1,'magsafe'),(474,1,'power'),(475,1,'adapter'),(476,1,'releases'),(477,1,'automatically'),(478,1,'someone'),(479,1,'accidentally'),(480,1,'trips'),(481,1,'cord'),(482,1,'larger'),(483,1,'drive,'),(484,1,'250gb,'),(485,1,'store'),(486,1,'growing'),(487,1,'media'),(488,1,'collections'),(489,1,'valuable'),(490,1,'datathe'),(491,1,'24ghz'),(492,1,'models'),(493,1,'include'),(494,1,'memory'),(495,1,'perfect'),(496,1,'running'),(497,1,'favorite'),(498,1,'applications'),(499,1,'smoothly'),(500,1,'superdrive'),(501,2,'offre'),(502,2,'liberté'),(503,2,'mouvement'),(504,2,'grâce'),(505,2,'résistant'),(506,2,'polycarbonate,'),(507,2,'technologies'),(508,2,'intégrées'),(509,2,'adaptateur'),(510,2,'secteur'),(511,2,'magsafe'),(512,2,'novateur'),(513,2,'déconnecte'),(514,2,'automatiquement'),(515,2,'quelqu\'un'),(516,2,'pieds'),(517,2,'spacieux,'),(518,2,'capacité'),(519,2,'atteignant'),(520,2,'collections'),(521,2,'multimédia'),(522,2,'expansion'),(523,2,'données'),(524,2,'précieusesle'),(525,2,'modèle'),(526,2,'intègre'),(527,2,'mémoire'),(528,2,'standard'),(529,2,'l\'idéal'),(530,2,'exécuter'),(531,2,'souplesse'),(532,2,'applications'),(533,2,'préférées'),(534,1,'touch'),(535,1,'revolutionary'),(536,1,'interface'),(537,1,'35inch'),(538,1,'color'),(539,1,'display'),(540,1,'(80211b'),(541,1,'safari,'),(542,1,'youtube,'),(543,1,'mail,'),(544,1,'stocks,'),(545,1,'weather,'),(546,1,'notes,'),(547,1,'store,'),(548,1,'maps'),(549,1,'five'),(550,1,'handson'),(551,1,'rich'),(552,1,'html'),(553,1,'email'),(554,1,'photos'),(555,1,'well'),(556,1,'pdf,'),(557,1,'word,'),(558,1,'excel'),(559,1,'attachments'),(560,1,'maps,'),(561,1,'directions,'),(562,1,'realtime'),(563,1,'traffic'),(564,1,'information'),(565,1,'notes'),(566,1,'read'),(567,1,'stock'),(568,1,'weather'),(569,1,'reports'),(570,1,'music,'),(571,1,'movies,'),(572,1,'technology'),(573,1,'built'),(574,1,'gorgeous'),(575,1,'lets'),(576,1,'pinch,'),(577,1,'zoom,'),(578,1,'scroll,'),(579,1,'flick'),(580,1,'fingers'),(581,1,'internet'),(582,1,'pocket'),(583,1,'safari'),(584,1,'browser,'),(585,1,'websites'),(586,1,'they'),(587,1,'were'),(588,1,'seen'),(589,1,'zoom'),(590,1,'tap2'),(591,1,'home'),(592,1,'quick'),(593,1,'access'),(594,1,'sites'),(595,1,'what'),(596,1,'earphones'),(597,1,'cable'),(598,1,'dock'),(599,1,'polishing'),(600,1,'cloth'),(601,1,'stand'),(602,1,'start'),(603,1,'guide'),(604,1,'32go'),(605,1,'jack'),(606,1,'120g'),(607,1,'70mm'),(608,1,'110mm'),(609,2,'touch'),(610,2,'interface'),(611,2,'révolutionnaire'),(612,2,'couleur'),(613,2,'pouceswifi'),(614,2,'(80211b'),(615,2,'d\'épaisseursafa'),(616,2,'youtube,'),(617,2,'music'),(618,2,'store,'),(619,2,'courrier,'),(620,2,'cartes,'),(621,2,'bourse,'),(622,2,'météo,'),(623,2,'notes'),(624,2,'titre'),(625,2,'paragraphe'),(626,2,'cinq'),(627,2,'sous'),(628,2,'main'),(629,2,'consultez'),(630,2,'emails'),(631,2,'format'),(632,2,'html'),(633,2,'enrichi,'),(634,2,'photos'),(635,2,'pieces'),(636,2,'jointes'),(637,2,'pdf,'),(638,2,'word'),(639,2,'excel'),(640,2,'obtenez'),(641,2,'itinéraires'),(642,2,'informations'),(643,2,'l\'état'),(644,2,'circulation'),(645,2,'temps'),(646,2,'réel'),(647,2,'rédigez'),(648,2,'cours'),(649,2,'bourse'),(650,2,'bulletins'),(651,2,'météo'),(652,2,'touchez'),(653,2,'doigt'),(654,2,'entre'),(655,2,'autres'),(656,2,'technologie'),(657,2,'intégrée'),(658,2,'superbe'),(659,2,'pouces'),(660,2,'d\'effectuer'),(661,2,'zooms'),(662,2,'avant'),(663,2,'arrière,'),(664,2,'faire'),(665,2,'défiler'),(666,2,'feuilleter'),(667,2,'pages'),(668,2,'l\'aide'),(669,2,'seuls'),(670,2,'doigts'),(671,2,'internet'),(672,2,'poche'),(673,2,'navigateur'),(674,2,'safari,'),(675,2,'consulter'),(676,2,'sites'),(677,2,'leur'),(678,2,'mise'),(679,2,'page'),(680,2,'effectuer'),(681,2,'zoom'),(682,2,'arrière'),(683,2,'simple'),(684,2,'pression'),(685,2,'l\'écran'),(686,2,'contenu'),(687,2,'coffret'),(688,2,'écouteurs'),(689,2,'câble'),(690,2,'dock'),(691,2,'chiffon'),(692,2,'nettoyage'),(693,2,'support'),(694,2,'guide'),(695,2,'démarrage'),(696,2,'tacticle'),(697,2,'32go'),(698,2,'jack'),(699,2,'120g'),(700,2,'70mm'),(701,2,'110mm'),(702,1,'housse'),(703,1,'portefeuille'),(704,1,'cuir'),(705,1,'belkin'),(706,1,'pour'),(707,1,'noir'),(708,1,'chocolat'),(709,1,'lorem'),(710,1,'ipsum'),(711,1,'accessories'),(712,2,'housse'),(713,2,'portefeuille'),(714,2,'cuir'),(715,2,'(ipod'),(716,2,'nano)'),(717,2,'chocolat'),(718,2,'étui'),(719,2,'tendance'),(720,2,'assure'),(721,2,'protection'),(722,2,'complète'),(723,2,'contre'),(724,2,'éraflures'),(725,2,'petits'),(726,2,'aléas'),(727,2,'quotidienne'),(728,2,'conception'),(729,2,'élégante'),(730,2,'compacte'),(731,2,'glisser'),(732,2,'directement'),(733,2,'caractéristique'),(734,2,'doux'),(735,2,'accès'),(736,2,'bouton'),(737,2,'hold'),(738,2,'fermeture'),(739,2,'magnétique'),(740,2,'connector'),(741,2,'protègeécran'),(742,2,'accessoires'),(743,1,'shure'),(744,1,'se210'),(745,1,'soundisolating'),(746,1,'iphone'),(747,1,'evolved'),(748,1,'monitor'),(749,1,'roadtested'),(750,1,'musicians'),(751,1,'perfected'),(752,1,'engineers,'),(753,1,'lightweight'),(754,1,'stylish'),(755,1,'delivers'),(756,1,'fullrange'),(757,1,'audio'),(758,1,'that\'s'),(759,1,'free'),(760,1,'outside'),(761,1,'noise'),(762,1,'using'),(763,1,'hidefinition'),(764,1,'microspeakers'),(765,1,'deliver'),(766,1,'audio,'),(767,1,'ergonomic'),(768,1,'ideal'),(769,1,'premium'),(770,1,'onthego'),(771,1,'listening'),(772,1,'offer'),(773,1,'accurate'),(774,1,'reproduction'),(775,1,'both'),(776,1,'sourcesfor'),(777,1,'ultimate'),(778,1,'precision'),(779,1,'highs'),(780,1,'addition,'),(781,1,'flexible'),(782,1,'allows'),(783,1,'choose'),(784,1,'comfortable'),(785,1,'variety'),(786,1,'wearing'),(787,1,'positions'),(788,1,'microspeaker'),(789,1,'single'),(790,1,'balanced'),(791,1,'armature'),(792,1,'driver'),(793,1,'detachable,'),(794,1,'modular'),(795,1,'make'),(796,1,'longer'),(797,1,'shorter'),(798,1,'depending'),(799,1,'activity'),(800,1,'connector'),(801,1,'compatible'),(802,1,'earphone'),(803,1,'specifications'),(804,1,'speaker'),(805,1,'type'),(806,1,'frequency'),(807,1,'range'),(808,1,'25hz185khz'),(809,1,'impedance'),(810,1,'(1khz)'),(811,1,'ohms'),(812,1,'sensitivity'),(813,1,'(1mw)'),(814,1,'length'),(815,1,'(with'),(816,1,'extension)'),(817,1,'(540'),(818,1,'1371'),(819,1,'extension'),(820,1,'(360'),(821,1,'three'),(822,1,'pairs'),(823,1,'foam'),(824,1,'earpiece'),(825,1,'sleeves'),(826,1,'(small,'),(827,1,'medium,'),(828,1,'large)'),(829,1,'soft'),(830,1,'flex'),(831,1,'pair'),(832,1,'tripleflange'),(833,1,'carrying'),(834,1,'case'),(835,1,'warranty'),(836,1,'twoyear'),(837,1,'limited'),(838,1,'(for'),(839,1,'details,'),(840,1,'please'),(841,1,'visit'),(842,1,'wwwshurecom'),(843,1,'personalaudio'),(844,1,'customersupport'),(845,1,'productreturnsa'),(846,1,'indexhtm)'),(847,1,'se210aefs'),(848,1,'note'),(849,1,'products'),(850,1,'sold'),(851,1,'through'),(852,1,'this'),(853,1,'website'),(854,1,'bear'),(855,1,'brand'),(856,1,'name'),(857,1,'serviced'),(858,1,'supported'),(859,1,'exclusively'),(860,1,'their'),(861,1,'manufacturers'),(862,1,'accordance'),(863,1,'terms'),(864,1,'conditions'),(865,1,'packaged'),(866,1,'apple\'s'),(867,1,'does'),(868,1,'apply'),(869,1,'applebranded,'),(870,1,'even'),(871,1,'contact'),(872,1,'manufacturer'),(873,1,'directly'),(874,1,'technical'),(875,1,'support'),(876,1,'customer'),(877,1,'service'),(878,1,'incorporated'),(879,2,'isolation'),(880,2,'sonore'),(881,2,'shure'),(882,2,'se210'),(883,2,'ergonomiques'),(884,2,'légers'),(885,2,'offrent'),(886,2,'reproduction'),(887,2,'audio'),(888,2,'fidèle'),(889,2,'provenance'),(890,2,'sources'),(891,2,'salon'),(892,2,'basés'),(893,2,'moniteurs'),(894,2,'personnels'),(895,2,'testée'),(896,2,'route'),(897,2,'musiciens'),(898,2,'professionnels'),(899,2,'perfectionnée'),(900,2,'ingénieurs'),(901,2,'shure,'),(902,2,'se210,'),(903,2,'élégants,'),(904,2,'fournissent'),(905,2,'sortie'),(906,2,'gamme'),(907,2,'étendue'),(908,2,'exempte'),(909,2,'bruit'),(910,2,'externe'),(911,2,'embouts'),(912,2,'fournis'),(913,2,'bloquent'),(914,2,'ambiant'),(915,2,'combinés'),(916,2,'ergonomique'),(917,2,'séduisant'),(918,2,'modulaire,'),(919,2,'minimisent'),(920,2,'intrusions'),(921,2,'extérieur,'),(922,2,'permettant'),(923,2,'concentrer'),(924,2,'conçus'),(925,2,'amoureux'),(926,2,'souhaitent'),(927,2,'évoluer'),(928,2,'appareil'),(929,2,'portable,'),(930,2,'permettent'),(931,2,'d\'emmener'),(932,2,'performance'),(933,2,'microtransducte'),(934,2,'haute'),(935,2,'définition'),(936,2,'développés'),(937,2,'écoute'),(938,2,'qualité'),(939,2,'supérieure'),(940,2,'déplacement,'),(941,2,'utilisent'),(942,2,'transducteur'),(943,2,'armature'),(944,2,'équilibrée'),(945,2,'bénéficier'),(946,2,'confort'),(947,2,'d\'écoute'),(948,2,'époustouflant'),(949,2,'restitue'),(950,2,'tous'),(951,2,'détails'),(952,2,'spectacle'),(953,2,'live'),(954,2,'universel'),(955,2,'deluxe'),(956,2,'comprend'),(957,2,'éléments'),(958,2,'suivants'),(959,2,'inclus'),(960,2,'double'),(961,2,'rôle'),(962,2,'bloquer'),(963,2,'bruits'),(964,2,'ambiants'),(965,2,'garantir'),(966,2,'maintien'),(967,2,'personnalisés'),(968,2,'oreille'),(969,2,'différente,'),(970,2,'trois'),(971,2,'tailles'),(972,2,'d\'embouts'),(973,2,'mousse'),(974,2,'flexibles'),(975,2,'style'),(976,2,'d\'embout'),(977,2,'conviennent'),(978,2,'mieux'),(979,2,'bonne'),(980,2,'étanchéité'),(981,2,'facteur'),(982,2,'optimiser'),(983,2,'l\'isolation'),(984,2,'réponse'),(985,2,'basses,'),(986,2,'ainsi'),(987,2,'accroître'),(988,2,'prolongée'),(989,2,'modulaire'),(990,2,'basant'),(991,2,'commentaires'),(992,2,'nombreux'),(993,2,'utilisateurs,'),(994,2,'développé'),(995,2,'solution'),(996,2,'détachable'),(997,2,'permettre'),(998,2,'degré'),(999,2,'personnalisatio'),(1000,2,'précédent'),(1001,2,'mètre'),(1002,2,'fourni'),(1003,2,'d\'adapter'),(1004,2,'fonction'),(1005,2,'l\'activité'),(1006,2,'l\'application'),(1007,2,'transport'),(1008,2,'outre'),(1009,2,'compact'),(1010,2,'ranger'),(1011,2,'manière'),(1012,2,'pratique'),(1013,2,'encombres'),(1014,2,'garantie'),(1015,2,'limitée'),(1016,2,'deux'),(1017,2,'achetée'),(1018,2,'couverte'),(1019,2,'maind\'Å“uvre'),(1020,2,'anscaractéristi'),(1021,2,'techniques'),(1022,2,'type'),(1023,2,'sensibilité'),(1024,2,'acoustique'),(1025,2,'impédance'),(1026,2,'khz)'),(1027,2,'fréquences'),(1028,2,'longueur'),(1029,2,'rallonge'),(1030,2,'(embouts'),(1031,2,'sonore,'),(1032,2,'transport)'),(1033,2,'incorporated'),(1034,2,'casque'),(1035,2,'marche'); +/*!40000 ALTER TABLE `ps_search_word` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_sekeyword` +-- + +DROP TABLE IF EXISTS `ps_sekeyword`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_sekeyword` ( + `id_sekeyword` int(10) unsigned NOT NULL auto_increment, + `keyword` varchar(256) NOT NULL, + `date_add` datetime NOT NULL, + PRIMARY KEY (`id_sekeyword`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_sekeyword` +-- + +LOCK TABLES `ps_sekeyword` WRITE; +/*!40000 ALTER TABLE `ps_sekeyword` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_sekeyword` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_state` +-- + +DROP TABLE IF EXISTS `ps_state`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_state` ( + `id_state` int(10) unsigned NOT NULL auto_increment, + `id_country` int(11) NOT NULL, + `id_zone` int(11) NOT NULL, + `name` varchar(64) NOT NULL, + `iso_code` char(4) NOT NULL, + `tax_behavior` smallint(1) NOT NULL default '0', + `active` tinyint(1) NOT NULL default '0', + PRIMARY KEY (`id_state`) +) ENGINE=MyISAM AUTO_INCREMENT=53 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_state` +-- + +LOCK TABLES `ps_state` WRITE; +/*!40000 ALTER TABLE `ps_state` DISABLE KEYS */; +INSERT INTO `ps_state` VALUES (1,21,2,'Alabama','AL',0,1),(2,21,2,'Alaska','AK',0,1),(3,21,2,'Arizona','AZ',0,1),(4,21,2,'Arkansas','AR',0,1),(5,21,2,'California','CA',0,1),(6,21,2,'Colorado','CO',0,1),(7,21,2,'Connecticut','CT',0,1),(8,21,2,'Delaware','DE',0,1),(9,21,2,'Florida','FL',0,1),(10,21,2,'Georgia','GA',0,1),(11,21,2,'Hawaii','HI',0,1),(12,21,2,'Idaho','ID',0,1),(13,21,2,'Illinois','IL',0,1),(14,21,2,'Indiana','IN',0,1),(15,21,2,'Iowa','IA',0,1),(16,21,2,'Kansas','KS',0,1),(17,21,2,'Kentucky','KY',0,1),(18,21,2,'Louisiana','LA',0,1),(19,21,2,'Maine','ME',0,1),(20,21,2,'Maryland','MD',0,1),(21,21,2,'Massachusetts','MA',0,1),(22,21,2,'Michigan','MI',0,1),(23,21,2,'Minnesota','MN',0,1),(24,21,2,'Mississippi','MS',0,1),(25,21,2,'Missouri','MO',0,1),(26,21,2,'Montana','MT',0,1),(27,21,2,'Nebraska','NE',0,1),(28,21,2,'Nevada','NV',0,1),(29,21,2,'New Hampshire','NH',0,1),(30,21,2,'New Jersey','NJ',0,1),(31,21,2,'New Mexico','NM',0,1),(32,21,2,'New York','NY',0,1),(33,21,2,'North Carolina','NC',0,1),(34,21,2,'North Dakota','ND',0,1),(35,21,2,'Ohio','OH',0,1),(36,21,2,'Oklahoma','OK',0,1),(37,21,2,'Oregon','OR',0,1),(38,21,2,'Pennsylvania','PA',0,1),(39,21,2,'Rhode Island','RI',0,1),(40,21,2,'South Carolina','SC',0,1),(41,21,2,'South Dakota','SD',0,1),(42,21,2,'Tennessee','TN',0,1),(43,21,2,'Texas','TX',0,1),(44,21,2,'Utah','UT',0,1),(45,21,2,'Vermont','VT',0,1),(46,21,2,'Virginia','VA',0,1),(47,21,2,'Washington','WA',0,1),(48,21,2,'West Virginia','WV',0,1),(49,21,2,'Wisconsin','WI',0,1),(50,21,2,'Wyoming','WY',0,1),(51,21,2,'Puerto Rico','PR',0,1),(52,21,2,'US Virgin Islands','VI',0,1); +/*!40000 ALTER TABLE `ps_state` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_statssearch` +-- + +DROP TABLE IF EXISTS `ps_statssearch`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_statssearch` ( + `id_statssearch` int(10) unsigned NOT NULL auto_increment, + `keywords` varchar(255) NOT NULL, + `results` int(6) NOT NULL default '0', + `date_add` datetime NOT NULL, + PRIMARY KEY (`id_statssearch`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_statssearch` +-- + +LOCK TABLES `ps_statssearch` WRITE; +/*!40000 ALTER TABLE `ps_statssearch` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_statssearch` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_subdomain` +-- + +DROP TABLE IF EXISTS `ps_subdomain`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_subdomain` ( + `id_subdomain` int(10) unsigned NOT NULL auto_increment, + `name` varchar(16) NOT NULL, + PRIMARY KEY (`id_subdomain`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_subdomain` +-- + +LOCK TABLES `ps_subdomain` WRITE; +/*!40000 ALTER TABLE `ps_subdomain` DISABLE KEYS */; +INSERT INTO `ps_subdomain` VALUES (1,'www'); +/*!40000 ALTER TABLE `ps_subdomain` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_supplier` +-- + +DROP TABLE IF EXISTS `ps_supplier`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_supplier` ( + `id_supplier` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) NOT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_supplier`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_supplier` +-- + +LOCK TABLES `ps_supplier` WRITE; +/*!40000 ALTER TABLE `ps_supplier` DISABLE KEYS */; +INSERT INTO `ps_supplier` VALUES (1,'AppleStore','2010-06-08 14:08:09','2010-06-08 14:08:09'),(2,'Shure Online Store','2010-06-08 14:08:09','2010-06-08 14:08:09'); +/*!40000 ALTER TABLE `ps_supplier` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_supplier_lang` +-- + +DROP TABLE IF EXISTS `ps_supplier_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_supplier_lang` ( + `id_supplier` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `description` text, + `meta_title` varchar(254) default NULL, + `meta_keywords` varchar(254) default NULL, + `meta_description` varchar(254) default NULL, + PRIMARY KEY (`id_supplier`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_supplier_lang` +-- + +LOCK TABLES `ps_supplier_lang` WRITE; +/*!40000 ALTER TABLE `ps_supplier_lang` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_supplier_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_tab` +-- + +DROP TABLE IF EXISTS `ps_tab`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_tab` ( + `id_tab` int(10) unsigned NOT NULL auto_increment, + `id_parent` int(11) NOT NULL, + `class_name` varchar(64) NOT NULL, + `module` varchar(64) default NULL, + `position` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_tab`) +) ENGINE=MyISAM AUTO_INCREMENT=69 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_tab` +-- + +LOCK TABLES `ps_tab` WRITE; +/*!40000 ALTER TABLE `ps_tab` DISABLE KEYS */; +INSERT INTO `ps_tab` VALUES (1,0,'AdminCatalog',NULL,1),(2,0,'AdminCustomers',NULL,2),(3,0,'AdminOrders',NULL,3),(4,0,'AdminPayment',NULL,4),(5,0,'AdminShipping',NULL,5),(6,0,'AdminStats',NULL,6),(7,0,'AdminModules',NULL,7),(29,0,'AdminEmployees',NULL,8),(8,0,'AdminPreferences',NULL,9),(9,0,'AdminTools',NULL,10),(60,1,'AdminTracking',NULL,1),(10,1,'AdminManufacturers',NULL,2),(34,1,'AdminSuppliers',NULL,3),(11,1,'AdminAttributesGroups',NULL,4),(36,1,'AdminFeatures',NULL,5),(58,1,'AdminScenes',NULL,6),(66,1,'AdminTags',NULL,7),(68,1,'AdminAttachments',NULL,7),(12,2,'AdminAddresses',NULL,1),(63,2,'AdminGroups',NULL,2),(65,2,'AdminCarts',NULL,3),(42,3,'AdminInvoices',NULL,1),(55,3,'AdminDeliverySlip',NULL,2),(47,3,'AdminReturn',NULL,3),(49,3,'AdminSlip',NULL,4),(59,3,'AdminMessages',NULL,5),(13,3,'AdminStatuses',NULL,6),(54,3,'AdminOrderMessage',NULL,7),(14,4,'AdminDiscounts',NULL,3),(15,4,'AdminCurrencies',NULL,1),(16,4,'AdminTaxes',NULL,2),(17,5,'AdminCarriers',NULL,1),(46,5,'AdminStates',NULL,2),(18,5,'AdminCountries',NULL,3),(19,5,'AdminZones',NULL,4),(20,5,'AdminRangePrice',NULL,5),(21,5,'AdminRangeWeight',NULL,6),(50,6,'AdminStatsModules',NULL,1),(51,6,'AdminStatsConf',NULL,2),(61,6,'AdminSearchEngines',NULL,3),(62,6,'AdminReferrers',NULL,4),(22,7,'AdminModulesPositions',NULL,1),(30,29,'AdminProfiles',NULL,1),(31,29,'AdminAccess',NULL,2),(28,29,'AdminContacts',NULL,3),(39,8,'AdminContact',NULL,1),(38,8,'AdminAppearance',NULL,2),(56,8,'AdminMeta',NULL,3),(27,8,'AdminPPreferences',NULL,4),(24,8,'AdminEmails',NULL,5),(26,8,'AdminImages',NULL,6),(23,8,'AdminDb',NULL,7),(48,8,'AdminPDF',NULL,8),(44,8,'AdminLocalization',NULL,9),(67,8,'AdminSearchConf',NULL,10),(32,9,'AdminLanguages',NULL,1),(33,9,'AdminTranslations',NULL,2),(35,9,'AdminTabs',NULL,3),(37,9,'AdminQuickAccesses',NULL,4),(40,9,'AdminAliases',NULL,5),(41,9,'AdminImport',NULL,6),(52,9,'AdminSubDomains',NULL,7),(53,9,'AdminBackup',NULL,8),(57,9,'AdminCMS',NULL,9),(64,9,'AdminGenerator',NULL,10),(43,-1,'AdminSearch',NULL,0); +/*!40000 ALTER TABLE `ps_tab` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_tab_lang` +-- + +DROP TABLE IF EXISTS `ps_tab_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_tab_lang` ( + `id_lang` int(10) unsigned NOT NULL, + `id_tab` int(10) unsigned NOT NULL, + `name` varchar(32) default NULL, + PRIMARY KEY (`id_tab`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_tab_lang` +-- + +LOCK TABLES `ps_tab_lang` WRITE; +/*!40000 ALTER TABLE `ps_tab_lang` DISABLE KEYS */; +INSERT INTO `ps_tab_lang` VALUES (1,1,'Catalog'),(1,2,'Customers'),(1,3,'Orders'),(1,4,'Payment'),(1,5,'Shipping'),(1,6,'Stats'),(1,7,'Modules'),(1,8,'Preferences'),(1,9,'Tools'),(1,10,'Manufacturers'),(1,11,'Attributes and groups'),(1,12,'Addresses'),(1,13,'Statuses'),(1,14,'Vouchers'),(1,15,'Currencies'),(1,16,'Taxes'),(1,17,'Carriers'),(1,18,'Countries'),(1,19,'Zones'),(1,20,'Price ranges'),(1,21,'Weight ranges'),(1,22,'Positions'),(1,23,'Database'),(1,24,'Email'),(1,26,'Image'),(1,27,'Products'),(1,28,'Contacts'),(1,29,'Employees'),(1,30,'Profiles'),(1,31,'Permissions'),(1,32,'Languages'),(1,33,'Translations'),(1,34,'Suppliers'),(1,35,'Tabs'),(1,36,'Features'),(1,37,'Quick Accesses'),(1,38,'Appearance'),(1,39,'Contact'),(1,40,'Aliases'),(1,41,'Import'),(1,42,'Invoices'),(1,43,'Search'),(1,44,'Localization'),(1,46,'States'),(1,47,'Merchandise return'),(1,48,'PDF'),(1,49,'Credit slips'),(1,50,'Modules'),(1,51,'Settings'),(1,52,'Subdomains'),(1,53,'DB backup'),(1,54,'Order Messages'),(1,55,'Delivery slips'),(1,56,'Meta-Tags'),(1,57,'CMS'),(1,58,'Image mapping'),(1,59,'Customer messages'),(1,60,'Tracking'),(1,61,'Search engines'),(1,62,'Referrers'),(1,63,'Groups'),(1,64,'Generators'),(1,65,'Carts'),(1,66,'Tags'),(1,67,'Search'),(1,68,'Attachments'),(2,1,'Catalogue'),(2,2,'Clients'),(2,3,'Commandes'),(2,4,'Paiement'),(2,5,'Transport'),(2,6,'Stats'),(2,7,'Modules'),(2,8,'Préférences'),(2,9,'Outils'),(2,10,'Fabricants'),(2,11,'Attributs et groupes'),(2,12,'Adresses'),(2,13,'Statuts'),(2,14,'Bons de réduction'),(2,15,'Devises'),(2,16,'Taxes'),(2,17,'Transporteurs'),(2,18,'Pays'),(2,19,'Zones'),(2,20,'Tranches de prix'),(2,21,'Tranches de poids'),(2,22,'Positions'),(2,23,'Base de données'),(2,24,'Emails'),(2,26,'Images'),(2,27,'Produits'),(2,28,'Contacts'),(2,29,'Employés'),(2,30,'Profils'),(2,31,'Permissions'),(2,32,'Langues'),(2,33,'Traductions'),(2,34,'Fournisseurs'),(2,35,'Onglets'),(2,36,'Caractéristiques'),(2,37,'Accès rapide'),(2,38,'Apparence'),(2,39,'Coordonnées'),(2,40,'Alias'),(2,41,'Import'),(2,42,'Factures'),(2,43,'Recherche'),(2,44,'Localisation'),(2,46,'Etats'),(2,47,'Retours produits'),(2,48,'PDF'),(2,49,'Avoirs'),(2,50,'Modules'),(2,51,'Configuration'),(2,52,'Sous domaines'),(2,53,'Sauvegarde BDD'),(2,54,'Messages prédéfinis'),(2,55,'Bons de livraison'),(2,56,'Méta-Tags'),(2,57,'CMS'),(2,58,'Scènes'),(2,59,'Messages clients'),(2,60,'Suivi'),(2,61,'Moteurs de recherche'),(2,62,'Sites affluents'),(2,63,'Groupes'),(2,64,'Générateurs'),(2,65,'Paniers'),(2,66,'Tags'),(2,67,'Recherche'),(2,68,'Documents joints'); +/*!40000 ALTER TABLE `ps_tab_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_tag` +-- + +DROP TABLE IF EXISTS `ps_tag`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_tag` ( + `id_tag` int(10) unsigned NOT NULL auto_increment, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(32) NOT NULL, + PRIMARY KEY (`id_tag`), + KEY `tag_name` (`name`) +) ENGINE=MyISAM AUTO_INCREMENT=28 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_tag` +-- + +LOCK TABLES `ps_tag` WRITE; +/*!40000 ALTER TABLE `ps_tag` DISABLE KEYS */; +INSERT INTO `ps_tag` VALUES (5,1,'apple'),(6,2,'ipod'),(7,2,'nano'),(8,2,'apple'),(18,2,'shuffle'),(19,2,'macbook'),(20,2,'macbookair'),(21,2,'air'),(22,1,'superdrive'),(27,2,'marche'),(26,2,'casque'),(25,2,'écouteurs'),(24,2,'ipod touch tacticle'),(23,1,'Ipod touch'); +/*!40000 ALTER TABLE `ps_tag` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_tax` +-- + +DROP TABLE IF EXISTS `ps_tax`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_tax` ( + `id_tax` int(10) unsigned NOT NULL auto_increment, + `rate` float NOT NULL, + PRIMARY KEY (`id_tax`) +) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_tax` +-- + +LOCK TABLES `ps_tax` WRITE; +/*!40000 ALTER TABLE `ps_tax` DISABLE KEYS */; +INSERT INTO `ps_tax` VALUES (1,19.6),(2,5.5),(3,17.5); +/*!40000 ALTER TABLE `ps_tax` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_tax_lang` +-- + +DROP TABLE IF EXISTS `ps_tax_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_tax_lang` ( + `id_tax` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(32) NOT NULL, + UNIQUE KEY `tax_lang_index` (`id_tax`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_tax_lang` +-- + +LOCK TABLES `ps_tax_lang` WRITE; +/*!40000 ALTER TABLE `ps_tax_lang` DISABLE KEYS */; +INSERT INTO `ps_tax_lang` VALUES (1,1,'VAT 19.6%'),(1,2,'TVA 19.6%'),(2,1,'VAT 5.5%'),(2,2,'TVA 5.5%'),(3,1,'VAT 17.5%'),(3,2,'TVA UK 17.5%'); +/*!40000 ALTER TABLE `ps_tax_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_tax_state` +-- + +DROP TABLE IF EXISTS `ps_tax_state`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_tax_state` ( + `id_tax` int(10) unsigned NOT NULL, + `id_state` int(10) unsigned NOT NULL, + KEY `tax_state_index` (`id_tax`,`id_state`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_tax_state` +-- + +LOCK TABLES `ps_tax_state` WRITE; +/*!40000 ALTER TABLE `ps_tax_state` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_tax_state` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_tax_zone` +-- + +DROP TABLE IF EXISTS `ps_tax_zone`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_tax_zone` ( + `id_tax` int(10) unsigned NOT NULL, + `id_zone` int(10) unsigned NOT NULL, + KEY `tax_zone_index` (`id_tax`,`id_zone`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_tax_zone` +-- + +LOCK TABLES `ps_tax_zone` WRITE; +/*!40000 ALTER TABLE `ps_tax_zone` DISABLE KEYS */; +INSERT INTO `ps_tax_zone` VALUES (1,1),(2,1); +/*!40000 ALTER TABLE `ps_tax_zone` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_timezone` +-- + +DROP TABLE IF EXISTS `ps_timezone`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_timezone` ( + `id_timezone` int(10) unsigned NOT NULL auto_increment, + `name` varchar(32) NOT NULL, + PRIMARY KEY (`id_timezone`) +) ENGINE=MyISAM AUTO_INCREMENT=561 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_timezone` +-- + +LOCK TABLES `ps_timezone` WRITE; +/*!40000 ALTER TABLE `ps_timezone` DISABLE KEYS */; +INSERT INTO `ps_timezone` VALUES (1,'Africa/Abidjan'),(2,'Africa/Accra'),(3,'Africa/Addis_Ababa'),(4,'Africa/Algiers'),(5,'Africa/Asmara'),(6,'Africa/Asmera'),(7,'Africa/Bamako'),(8,'Africa/Bangui'),(9,'Africa/Banjul'),(10,'Africa/Bissau'),(11,'Africa/Blantyre'),(12,'Africa/Brazzaville'),(13,'Africa/Bujumbura'),(14,'Africa/Cairo'),(15,'Africa/Casablanca'),(16,'Africa/Ceuta'),(17,'Africa/Conakry'),(18,'Africa/Dakar'),(19,'Africa/Dar_es_Salaam'),(20,'Africa/Djibouti'),(21,'Africa/Douala'),(22,'Africa/El_Aaiun'),(23,'Africa/Freetown'),(24,'Africa/Gaborone'),(25,'Africa/Harare'),(26,'Africa/Johannesburg'),(27,'Africa/Kampala'),(28,'Africa/Khartoum'),(29,'Africa/Kigali'),(30,'Africa/Kinshasa'),(31,'Africa/Lagos'),(32,'Africa/Libreville'),(33,'Africa/Lome'),(34,'Africa/Luanda'),(35,'Africa/Lubumbashi'),(36,'Africa/Lusaka'),(37,'Africa/Malabo'),(38,'Africa/Maputo'),(39,'Africa/Maseru'),(40,'Africa/Mbabane'),(41,'Africa/Mogadishu'),(42,'Africa/Monrovia'),(43,'Africa/Nairobi'),(44,'Africa/Ndjamena'),(45,'Africa/Niamey'),(46,'Africa/Nouakchott'),(47,'Africa/Ouagadougou'),(48,'Africa/Porto-Novo'),(49,'Africa/Sao_Tome'),(50,'Africa/Timbuktu'),(51,'Africa/Tripoli'),(52,'Africa/Tunis'),(53,'Africa/Windhoek'),(54,'America/Adak'),(55,'America/Anchorage '),(56,'America/Anguilla'),(57,'America/Antigua'),(58,'America/Araguaina'),(59,'America/Argentina/Buenos_Aires'),(60,'America/Argentina/Catamarca'),(61,'America/Argentina/ComodRivadavia'),(62,'America/Argentina/Cordoba'),(63,'America/Argentina/Jujuy'),(64,'America/Argentina/La_Rioja'),(65,'America/Argentina/Mendoza'),(66,'America/Argentina/Rio_Gallegos'),(67,'America/Argentina/Salta'),(68,'America/Argentina/San_Juan'),(69,'America/Argentina/San_Luis'),(70,'America/Argentina/Tucuman'),(71,'America/Argentina/Ushuaia'),(72,'America/Aruba'),(73,'America/Asuncion'),(74,'America/Atikokan'),(75,'America/Atka'),(76,'America/Bahia'),(77,'America/Barbados'),(78,'America/Belem'),(79,'America/Belize'),(80,'America/Blanc-Sablon'),(81,'America/Boa_Vista'),(82,'America/Bogota'),(83,'America/Boise'),(84,'America/Buenos_Aires'),(85,'America/Cambridge_Bay'),(86,'America/Campo_Grande'),(87,'America/Cancun'),(88,'America/Caracas'),(89,'America/Catamarca'),(90,'America/Cayenne'),(91,'America/Cayman'),(92,'America/Chicago'),(93,'America/Chihuahua'),(94,'America/Coral_Harbour'),(95,'America/Cordoba'),(96,'America/Costa_Rica'),(97,'America/Cuiaba'),(98,'America/Curacao'),(99,'America/Danmarkshavn'),(100,'America/Dawson'),(101,'America/Dawson_Creek'),(102,'America/Denver'),(103,'America/Detroit'),(104,'America/Dominica'),(105,'America/Edmonton'),(106,'America/Eirunepe'),(107,'America/El_Salvador'),(108,'America/Ensenada'),(109,'America/Fort_Wayne'),(110,'America/Fortaleza'),(111,'America/Glace_Bay'),(112,'America/Godthab'),(113,'America/Goose_Bay'),(114,'America/Grand_Turk'),(115,'America/Grenada'),(116,'America/Guadeloupe'),(117,'America/Guatemala'),(118,'America/Guayaquil'),(119,'America/Guyana'),(120,'America/Halifax'),(121,'America/Havana'),(122,'America/Hermosillo'),(123,'America/Indiana/Indianapolis'),(124,'America/Indiana/Knox'),(125,'America/Indiana/Marengo'),(126,'America/Indiana/Petersburg'),(127,'America/Indiana/Tell_City'),(128,'America/Indiana/Vevay'),(129,'America/Indiana/Vincennes'),(130,'America/Indiana/Winamac'),(131,'America/Indianapolis'),(132,'America/Inuvik'),(133,'America/Iqaluit'),(134,'America/Jamaica'),(135,'America/Jujuy'),(136,'America/Juneau'),(137,'America/Kentucky/Louisville'),(138,'America/Kentucky/Monticello'),(139,'America/Knox_IN'),(140,'America/La_Paz'),(141,'America/Lima'),(142,'America/Los_Angeles'),(143,'America/Louisville'),(144,'America/Maceio'),(145,'America/Managua'),(146,'America/Manaus'),(147,'America/Marigot'),(148,'America/Martinique'),(149,'America/Mazatlan'),(150,'America/Mendoza'),(151,'America/Menominee'),(152,'America/Merida'),(153,'America/Mexico_City'),(154,'America/Miquelon'),(155,'America/Moncton'),(156,'America/Monterrey'),(157,'America/Montevideo'),(158,'America/Montreal'),(159,'America/Montserrat'),(160,'America/Nassau'),(161,'America/New_York'),(162,'America/Nipigon'),(163,'America/Nome'),(164,'America/Noronha'),(165,'America/North_Dakota/Center'),(166,'America/North_Dakota/New_Salem'),(167,'America/Panama'),(168,'America/Pangnirtung'),(169,'America/Paramaribo'),(170,'America/Phoenix'),(171,'America/Port-au-Prince'),(172,'America/Port_of_Spain'),(173,'America/Porto_Acre'),(174,'America/Porto_Velho'),(175,'America/Puerto_Rico'),(176,'America/Rainy_River'),(177,'America/Rankin_Inlet'),(178,'America/Recife'),(179,'America/Regina'),(180,'America/Resolute'),(181,'America/Rio_Branco'),(182,'America/Rosario'),(183,'America/Santarem'),(184,'America/Santiago'),(185,'America/Santo_Domingo'),(186,'America/Sao_Paulo'),(187,'America/Scoresbysund'),(188,'America/Shiprock'),(189,'America/St_Barthelemy'),(190,'America/St_Johns'),(191,'America/St_Kitts'),(192,'America/St_Lucia'),(193,'America/St_Thomas'),(194,'America/St_Vincent'),(195,'America/Swift_Current'),(196,'America/Tegucigalpa'),(197,'America/Thule'),(198,'America/Thunder_Bay'),(199,'America/Tijuana'),(200,'America/Toronto'),(201,'America/Tortola'),(202,'America/Vancouver'),(203,'America/Virgin'),(204,'America/Whitehorse'),(205,'America/Winnipeg'),(206,'America/Yakutat'),(207,'America/Yellowknife'),(208,'Antarctica/Casey'),(209,'Antarctica/Davis'),(210,'Antarctica/DumontDUrville'),(211,'Antarctica/Mawson'),(212,'Antarctica/McMurdo'),(213,'Antarctica/Palmer'),(214,'Antarctica/Rothera'),(215,'Antarctica/South_Pole'),(216,'Antarctica/Syowa'),(217,'Antarctica/Vostok'),(218,'Arctic/Longyearbyen'),(219,'Asia/Aden'),(220,'Asia/Almaty'),(221,'Asia/Amman'),(222,'Asia/Anadyr'),(223,'Asia/Aqtau'),(224,'Asia/Aqtobe'),(225,'Asia/Ashgabat'),(226,'Asia/Ashkhabad'),(227,'Asia/Baghdad'),(228,'Asia/Bahrain'),(229,'Asia/Baku'),(230,'Asia/Bangkok'),(231,'Asia/Beirut'),(232,'Asia/Bishkek'),(233,'Asia/Brunei'),(234,'Asia/Calcutta'),(235,'Asia/Choibalsan'),(236,'Asia/Chongqing'),(237,'Asia/Chungking'),(238,'Asia/Colombo'),(239,'Asia/Dacca'),(240,'Asia/Damascus'),(241,'Asia/Dhaka'),(242,'Asia/Dili'),(243,'Asia/Dubai'),(244,'Asia/Dushanbe'),(245,'Asia/Gaza'),(246,'Asia/Harbin'),(247,'Asia/Ho_Chi_Minh'),(248,'Asia/Hong_Kong'),(249,'Asia/Hovd'),(250,'Asia/Irkutsk'),(251,'Asia/Istanbul'),(252,'Asia/Jakarta'),(253,'Asia/Jayapura'),(254,'Asia/Jerusalem'),(255,'Asia/Kabul'),(256,'Asia/Kamchatka'),(257,'Asia/Karachi'),(258,'Asia/Kashgar'),(259,'Asia/Kathmandu'),(260,'Asia/Katmandu'),(261,'Asia/Kolkata'),(262,'Asia/Krasnoyarsk'),(263,'Asia/Kuala_Lumpur'),(264,'Asia/Kuching'),(265,'Asia/Kuwait'),(266,'Asia/Macao'),(267,'Asia/Macau'),(268,'Asia/Magadan'),(269,'Asia/Makassar'),(270,'Asia/Manila'),(271,'Asia/Muscat'),(272,'Asia/Nicosia'),(273,'Asia/Novosibirsk'),(274,'Asia/Omsk'),(275,'Asia/Oral'),(276,'Asia/Phnom_Penh'),(277,'Asia/Pontianak'),(278,'Asia/Pyongyang'),(279,'Asia/Qatar'),(280,'Asia/Qyzylorda'),(281,'Asia/Rangoon'),(282,'Asia/Riyadh'),(283,'Asia/Saigon'),(284,'Asia/Sakhalin'),(285,'Asia/Samarkand'),(286,'Asia/Seoul'),(287,'Asia/Shanghai'),(288,'Asia/Singapore'),(289,'Asia/Taipei'),(290,'Asia/Tashkent'),(291,'Asia/Tbilisi'),(292,'Asia/Tehran'),(293,'Asia/Tel_Aviv'),(294,'Asia/Thimbu'),(295,'Asia/Thimphu'),(296,'Asia/Tokyo'),(297,'Asia/Ujung_Pandang'),(298,'Asia/Ulaanbaatar'),(299,'Asia/Ulan_Bator'),(300,'Asia/Urumqi'),(301,'Asia/Vientiane'),(302,'Asia/Vladivostok'),(303,'Asia/Yakutsk'),(304,'Asia/Yekaterinburg'),(305,'Asia/Yerevan'),(306,'Atlantic/Azores'),(307,'Atlantic/Bermuda'),(308,'Atlantic/Canary'),(309,'Atlantic/Cape_Verde'),(310,'Atlantic/Faeroe'),(311,'Atlantic/Faroe'),(312,'Atlantic/Jan_Mayen'),(313,'Atlantic/Madeira'),(314,'Atlantic/Reykjavik'),(315,'Atlantic/South_Georgia'),(316,'Atlantic/St_Helena'),(317,'Atlantic/Stanley'),(318,'Australia/ACT'),(319,'Australia/Adelaide'),(320,'Australia/Brisbane'),(321,'Australia/Broken_Hill'),(322,'Australia/Canberra'),(323,'Australia/Currie'),(324,'Australia/Darwin'),(325,'Australia/Eucla'),(326,'Australia/Hobart'),(327,'Australia/LHI'),(328,'Australia/Lindeman'),(329,'Australia/Lord_Howe'),(330,'Australia/Melbourne'),(331,'Australia/North'),(332,'Australia/NSW'),(333,'Australia/Perth'),(334,'Australia/Queensland'),(335,'Australia/South'),(336,'Australia/Sydney'),(337,'Australia/Tasmania'),(338,'Australia/Victoria'),(339,'Australia/West'),(340,'Australia/Yancowinna'),(341,'Europe/Amsterdam'),(342,'Europe/Andorra'),(343,'Europe/Athens'),(344,'Europe/Belfast'),(345,'Europe/Belgrade'),(346,'Europe/Berlin'),(347,'Europe/Bratislava'),(348,'Europe/Brussels'),(349,'Europe/Bucharest'),(350,'Europe/Budapest'),(351,'Europe/Chisinau'),(352,'Europe/Copenhagen'),(353,'Europe/Dublin'),(354,'Europe/Gibraltar'),(355,'Europe/Guernsey'),(356,'Europe/Helsinki'),(357,'Europe/Isle_of_Man'),(358,'Europe/Istanbul'),(359,'Europe/Jersey'),(360,'Europe/Kaliningrad'),(361,'Europe/Kiev'),(362,'Europe/Lisbon'),(363,'Europe/Ljubljana'),(364,'Europe/London'),(365,'Europe/Luxembourg'),(366,'Europe/Madrid'),(367,'Europe/Malta'),(368,'Europe/Mariehamn'),(369,'Europe/Minsk'),(370,'Europe/Monaco'),(371,'Europe/Moscow'),(372,'Europe/Nicosia'),(373,'Europe/Oslo'),(374,'Europe/Paris'),(375,'Europe/Podgorica'),(376,'Europe/Prague'),(377,'Europe/Riga'),(378,'Europe/Rome'),(379,'Europe/Samara'),(380,'Europe/San_Marino'),(381,'Europe/Sarajevo'),(382,'Europe/Simferopol'),(383,'Europe/Skopje'),(384,'Europe/Sofia'),(385,'Europe/Stockholm'),(386,'Europe/Tallinn'),(387,'Europe/Tirane'),(388,'Europe/Tiraspol'),(389,'Europe/Uzhgorod'),(390,'Europe/Vaduz'),(391,'Europe/Vatican'),(392,'Europe/Vienna'),(393,'Europe/Vilnius'),(394,'Europe/Volgograd'),(395,'Europe/Warsaw'),(396,'Europe/Zagreb'),(397,'Europe/Zaporozhye'),(398,'Europe/Zurich'),(399,'Indian/Antananarivo'),(400,'Indian/Chagos'),(401,'Indian/Christmas'),(402,'Indian/Cocos'),(403,'Indian/Comoro'),(404,'Indian/Kerguelen'),(405,'Indian/Mahe'),(406,'Indian/Maldives'),(407,'Indian/Mauritius'),(408,'Indian/Mayotte'),(409,'Indian/Reunion'),(410,'Pacific/Apia'),(411,'Pacific/Auckland'),(412,'Pacific/Chatham'),(413,'Pacific/Easter'),(414,'Pacific/Efate'),(415,'Pacific/Enderbury'),(416,'Pacific/Fakaofo'),(417,'Pacific/Fiji'),(418,'Pacific/Funafuti'),(419,'Pacific/Galapagos'),(420,'Pacific/Gambier'),(421,'Pacific/Guadalcanal'),(422,'Pacific/Guam'),(423,'Pacific/Honolulu'),(424,'Pacific/Johnston'),(425,'Pacific/Kiritimati'),(426,'Pacific/Kosrae'),(427,'Pacific/Kwajalein'),(428,'Pacific/Majuro'),(429,'Pacific/Marquesas'),(430,'Pacific/Midway'),(431,'Pacific/Nauru'),(432,'Pacific/Niue'),(433,'Pacific/Norfolk'),(434,'Pacific/Noumea'),(435,'Pacific/Pago_Pago'),(436,'Pacific/Palau'),(437,'Pacific/Pitcairn'),(438,'Pacific/Ponape'),(439,'Pacific/Port_Moresby'),(440,'Pacific/Rarotonga'),(441,'Pacific/Saipan'),(442,'Pacific/Samoa'),(443,'Pacific/Tahiti'),(444,'Pacific/Tarawa'),(445,'Pacific/Tongatapu'),(446,'Pacific/Truk'),(447,'Pacific/Wake'),(448,'Pacific/Wallis'),(449,'Pacific/Yap'),(450,'Brazil/Acre'),(451,'Brazil/DeNoronha'),(452,'Brazil/East'),(453,'Brazil/West'),(454,'Canada/Atlantic'),(455,'Canada/Central'),(456,'Canada/East-Saskatchewan'),(457,'Canada/Eastern'),(458,'Canada/Mountain'),(459,'Canada/Newfoundland'),(460,'Canada/Pacific'),(461,'Canada/Saskatchewan'),(462,'Canada/Yukon'),(463,'CET'),(464,'Chile/Continental'),(465,'Chile/EasterIsland'),(466,'CST6CDT'),(467,'Cuba'),(468,'EET'),(469,'Egypt'),(470,'Eire'),(471,'EST'),(472,'EST5EDT'),(473,'Etc/GMT'),(474,'Etc/GMT+0'),(475,'Etc/GMT+1'),(476,'Etc/GMT+10'),(477,'Etc/GMT+11'),(478,'Etc/GMT+12'),(479,'Etc/GMT+2'),(480,'Etc/GMT+3'),(481,'Etc/GMT+4'),(482,'Etc/GMT+5'),(483,'Etc/GMT+6'),(484,'Etc/GMT+7'),(485,'Etc/GMT+8'),(486,'Etc/GMT+9'),(487,'Etc/GMT-0'),(488,'Etc/GMT-1'),(489,'Etc/GMT-10'),(490,'Etc/GMT-11'),(491,'Etc/GMT-12'),(492,'Etc/GMT-13'),(493,'Etc/GMT-14'),(494,'Etc/GMT-2'),(495,'Etc/GMT-3'),(496,'Etc/GMT-4'),(497,'Etc/GMT-5'),(498,'Etc/GMT-6'),(499,'Etc/GMT-7'),(500,'Etc/GMT-8'),(501,'Etc/GMT-9'),(502,'Etc/GMT0'),(503,'Etc/Greenwich'),(504,'Etc/UCT'),(505,'Etc/Universal'),(506,'Etc/UTC'),(507,'Etc/Zulu'),(508,'Factory'),(509,'GB'),(510,'GB-Eire'),(511,'GMT'),(512,'GMT+0'),(513,'GMT-0'),(514,'GMT0'),(515,'Greenwich'),(516,'Hongkong'),(517,'HST'),(518,'Iceland'),(519,'Iran'),(520,'Israel'),(521,'Jamaica'),(522,'Japan'),(523,'Kwajalein'),(524,'Libya'),(525,'MET'),(526,'Mexico/BajaNorte'),(527,'Mexico/BajaSur'),(528,'Mexico/General'),(529,'MST'),(530,'MST7MDT'),(531,'Navajo'),(532,'NZ'),(533,'NZ-CHAT'),(534,'Poland'),(535,'Portugal'),(536,'PRC'),(537,'PST8PDT'),(538,'ROC'),(539,'ROK'),(540,'Singapore'),(541,'Turkey'),(542,'UCT'),(543,'Universal'),(544,'US/Alaska'),(545,'US/Aleutian'),(546,'US/Arizona'),(547,'US/Central'),(548,'US/East-Indiana'),(549,'US/Eastern'),(550,'US/Hawaii'),(551,'US/Indiana-Starke'),(552,'US/Michigan'),(553,'US/Mountain'),(554,'US/Pacific'),(555,'US/Pacific-New'),(556,'US/Samoa'),(557,'UTC'),(558,'W-SU'),(559,'WET'),(560,'Zulu'); +/*!40000 ALTER TABLE `ps_timezone` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_web_browser` +-- + +DROP TABLE IF EXISTS `ps_web_browser`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_web_browser` ( + `id_web_browser` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) default NULL, + PRIMARY KEY (`id_web_browser`) +) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_web_browser` +-- + +LOCK TABLES `ps_web_browser` WRITE; +/*!40000 ALTER TABLE `ps_web_browser` DISABLE KEYS */; +INSERT INTO `ps_web_browser` VALUES (1,'Safari'),(2,'Firefox 2.x'),(3,'Firefox 3.x'),(4,'Opera'),(5,'IE 6.x'),(6,'IE 7.x'),(7,'IE 8.x'),(8,'Google Chrome'); +/*!40000 ALTER TABLE `ps_web_browser` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_zone` +-- + +DROP TABLE IF EXISTS `ps_zone`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_zone` ( + `id_zone` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) NOT NULL, + `active` tinyint(1) unsigned NOT NULL default '0', + `enabled` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_zone`) +) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_zone` +-- + +LOCK TABLES `ps_zone` WRITE; +/*!40000 ALTER TABLE `ps_zone` DISABLE KEYS */; +INSERT INTO `ps_zone` VALUES (1,'Europe',1,1),(2,'US',1,1),(3,'Asia',1,1),(4,'Africa',1,1),(5,'Oceania',1,1); +/*!40000 ALTER TABLE `ps_zone` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2010-06-08 14:09:22 diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_01_person.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_01_person.sql new file mode 100644 index 0000000000000000000000000000000000000000..2426e4194156ad0fe22200413c8596deaa9f75b8 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_01_person.sql @@ -0,0 +1,346 @@ +-- MySQL dump 10.13 Distrib 5.1.34, for mandriva-linux-gnu (x86_64) +-- +-- Host: localhost Database: dump_test +-- ------------------------------------------------------ +-- Server version 5.1.34-Max + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `ps_address` +-- + +DROP TABLE IF EXISTS `ps_address`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_address` ( + `id_address` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_country` int(10) unsigned NOT NULL, + `id_state` int(10) unsigned DEFAULT NULL, + `id_customer` int(10) unsigned NOT NULL DEFAULT '0', + `id_manufacturer` int(10) unsigned NOT NULL DEFAULT '0', + `id_supplier` int(10) unsigned NOT NULL DEFAULT '0', + `alias` varchar(32) NOT NULL, + `company` varchar(32) DEFAULT NULL, + `lastname` varchar(32) NOT NULL, + `firstname` varchar(32) NOT NULL, + `address1` varchar(128) NOT NULL, + `address2` varchar(128) DEFAULT NULL, + `postcode` varchar(12) DEFAULT NULL, + `city` varchar(64) NOT NULL, + `other` text, + `phone` varchar(16) DEFAULT NULL, + `phone_mobile` varchar(16) DEFAULT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + `active` tinyint(1) unsigned NOT NULL DEFAULT '1', + `deleted` tinyint(1) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id_address`), + KEY `address_customer` (`id_customer`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_address` +-- + +LOCK TABLES `ps_address` WRITE; +/*!40000 ALTER TABLE `ps_address` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_address` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_country` +-- + +DROP TABLE IF EXISTS `ps_country`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_country` ( + `id_country` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_zone` int(10) unsigned NOT NULL, + `iso_code` varchar(3) NOT NULL, + `active` tinyint(1) unsigned NOT NULL DEFAULT '0', + `contains_states` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id_country`), + KEY `country_iso_code` (`iso_code`), + KEY `country_` (`id_zone`) +) ENGINE=MyISAM AUTO_INCREMENT=35 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_country` +-- + +LOCK TABLES `ps_country` WRITE; +/*!40000 ALTER TABLE `ps_country` DISABLE KEYS */; +INSERT INTO `ps_country` VALUES (1,1,'DE',1,0),(2,1,'AT',1,0),(3,1,'BE',1,0),(4,2,'CA',1,0),(5,3,'CN',1,0),(6,1,'ES',1,0),(7,1,'FI',1,0),(8,1,'FR',1,0),(9,1,'GR',1,0),(10,1,'IT',1,0),(11,3,'JP',1,0),(12,1,'LU',1,0),(13,1,'NL',1,0),(14,1,'PL',1,0),(15,1,'PT',1,0),(16,1,'CZ',1,0),(17,1,'GB',1,0),(18,1,'SE',1,0),(19,1,'CH',1,0),(20,1,'DK',1,0),(21,2,'US',1,1),(22,3,'HK',1,0),(23,1,'NO',1,0),(24,5,'AU',1,0),(25,3,'SG',1,0),(26,1,'IE',1,0),(27,5,'NZ',1,0),(28,3,'KR',1,0),(29,3,'IL',1,0),(30,4,'ZA',1,0),(31,4,'NG',1,0),(32,4,'CI',1,0),(33,4,'TG',1,0),(34,2,'BO',1,0); +/*!40000 ALTER TABLE `ps_country` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_country_lang` +-- + +DROP TABLE IF EXISTS `ps_country_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_country_lang` ( + `id_country` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(64) NOT NULL, + UNIQUE KEY `country_lang_index` (`id_country`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_country_lang` +-- + +LOCK TABLES `ps_country_lang` WRITE; +/*!40000 ALTER TABLE `ps_country_lang` DISABLE KEYS */; +INSERT INTO `ps_country_lang` VALUES (1,1,'Germany'),(1,2,'Allemagne'),(2,1,'Austria'),(2,2,'Autriche'),(3,1,'Belgium'),(3,2,'Belgique'),(4,1,'Canada'),(4,2,'Canada'),(5,1,'China'),(5,2,'Chine'),(6,1,'Spain'),(6,2,'Espagne'),(7,1,'Finland'),(7,2,'Finlande'),(8,1,'France'),(8,2,'France'),(9,1,'Greece'),(9,2,'Grèce'),(10,1,'Italy'),(10,2,'Italie'),(11,1,'Japan'),(11,2,'Japon'),(12,1,'Luxemburg'),(12,2,'Luxembourg'),(13,1,'Netherlands'),(13,2,'Pays-bas'),(14,1,'Poland'),(14,2,'Pologne'),(15,1,'Portugal'),(15,2,'Portugal'),(16,1,'Czech Republic'),(16,2,'République Tchèque'),(17,1,'United Kingdom'),(17,2,'Royaume-Uni'),(18,1,'Sweden'),(18,2,'Suède'),(19,1,'Switzerland'),(19,2,'Suisse'),(20,1,'Denmark'),(20,2,'Danemark'),(21,1,'USA'),(21,2,'USA'),(22,1,'HongKong'),(22,2,'Hong-Kong'),(23,1,'Norway'),(23,2,'Norvège'),(24,1,'Australia'),(24,2,'Australie'),(25,1,'Singapore'),(25,2,'Singapour'),(26,1,'Ireland'),(26,2,'Eire'),(27,1,'New Zealand'),(27,2,'Nouvelle-Zélande'),(28,1,'South Korea'),(28,2,'Corée du Sud'),(29,1,'Israel'),(29,2,'Israël'),(30,1,'South Africa'),(30,2,'Afrique du Sud'),(31,1,'Nigeria'),(31,2,'Nigeria'),(32,1,'Ivory Coast'),(32,2,'Côte d\'Ivoire'),(33,1,'Togo'),(33,2,'Togo'),(34,1,'Bolivia'),(34,2,'Bolivie'); +/*!40000 ALTER TABLE `ps_country_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_customer` +-- + +DROP TABLE IF EXISTS `ps_customer`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_customer` ( + `id_customer` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_gender` int(10) unsigned NOT NULL, + `secure_key` varchar(32) NOT NULL DEFAULT '-1', + `email` varchar(128) NOT NULL, + `passwd` varchar(32) NOT NULL, + `last_passwd_gen` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `birthday` date DEFAULT NULL, + `lastname` varchar(32) NOT NULL, + `newsletter` tinyint(1) unsigned NOT NULL DEFAULT '0', + `ip_registration_newsletter` varchar(15) DEFAULT NULL, + `newsletter_date_add` datetime DEFAULT NULL, + `optin` tinyint(1) unsigned NOT NULL DEFAULT '0', + `firstname` varchar(32) NOT NULL, + `active` tinyint(1) unsigned NOT NULL DEFAULT '0', + `deleted` tinyint(1) NOT NULL DEFAULT '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_customer`), + UNIQUE KEY `customer_email` (`email`), + KEY `customer_login` (`email`,`passwd`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_customer` +-- + +LOCK TABLES `ps_customer` WRITE; +/*!40000 ALTER TABLE `ps_customer` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_customer` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_lang` +-- + +DROP TABLE IF EXISTS `ps_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_lang` ( + `id_lang` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(32) NOT NULL, + `active` tinyint(3) unsigned NOT NULL DEFAULT '0', + `iso_code` char(2) NOT NULL, + PRIMARY KEY (`id_lang`), + KEY `lang_iso_code` (`iso_code`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_lang` +-- + +LOCK TABLES `ps_lang` WRITE; +/*!40000 ALTER TABLE `ps_lang` DISABLE KEYS */; +INSERT INTO `ps_lang` VALUES (1,'English (English)',1,'en'),(2,'Français (French)',1,'fr'); +/*!40000 ALTER TABLE `ps_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_manufacturer` +-- + +DROP TABLE IF EXISTS `ps_manufacturer`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_manufacturer` ( + `id_manufacturer` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(64) NOT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_manufacturer`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_manufacturer` +-- + +LOCK TABLES `ps_manufacturer` WRITE; +/*!40000 ALTER TABLE `ps_manufacturer` DISABLE KEYS */; +INSERT INTO `ps_manufacturer` VALUES (1,'Apple Computer, Inc','2009-06-09 11:36:02','2009-06-09 11:36:02'),(2,'Shure Incorporated','2009-06-09 11:36:02','2009-06-09 11:36:02'); +/*!40000 ALTER TABLE `ps_manufacturer` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_manufacturer_lang` +-- + +DROP TABLE IF EXISTS `ps_manufacturer_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_manufacturer_lang` ( + `id_manufacturer` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `description` text, + PRIMARY KEY (`id_manufacturer`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_manufacturer_lang` +-- + +LOCK TABLES `ps_manufacturer_lang` WRITE; +/*!40000 ALTER TABLE `ps_manufacturer_lang` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_manufacturer_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_state` +-- + +DROP TABLE IF EXISTS `ps_state`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_state` ( + `id_state` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_country` int(11) NOT NULL, + `id_zone` int(11) NOT NULL, + `name` varchar(64) NOT NULL, + `iso_code` varchar(3) NOT NULL, + `tax_behavior` smallint(1) NOT NULL DEFAULT '0', + `active` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id_state`) +) ENGINE=MyISAM AUTO_INCREMENT=53 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_state` +-- + +LOCK TABLES `ps_state` WRITE; +/*!40000 ALTER TABLE `ps_state` DISABLE KEYS */; +INSERT INTO `ps_state` VALUES (1,21,2,'Alabama','AL',0,1),(2,21,2,'Alaska','AK',0,1),(3,21,2,'Arizona','AZ',0,1),(4,21,2,'Arkansas','AR',0,1),(5,21,2,'California','CA',0,1),(6,21,2,'Colorado','CO',0,1),(7,21,2,'Connecticut','CT',0,1),(8,21,2,'Delaware','DE',0,1),(9,21,2,'Florida','FL',0,1),(10,21,2,'Georgia','GA',0,1),(11,21,2,'Hawaii','HI',0,1),(12,21,2,'Idaho','ID',0,1),(13,21,2,'Illinois','IL',0,1),(14,21,2,'Indiana','IN',0,1),(15,21,2,'Iowa','IA',0,1),(16,21,2,'Kansas','KS',0,1),(17,21,2,'Kentucky','KY',0,1),(18,21,2,'Louisiana','LA',0,1),(19,21,2,'Maine','ME',0,1),(20,21,2,'Maryland','MD',0,1),(21,21,2,'Massachusetts','MA',0,1),(22,21,2,'Michigan','MI',0,1),(23,21,2,'Minnesota','MN',0,1),(24,21,2,'Mississippi','MS',0,1),(25,21,2,'Missouri','MO',0,1),(26,21,2,'Montana','MT',0,1),(27,21,2,'Nebraska','NE',0,1),(28,21,2,'Nevada','NV',0,1),(29,21,2,'New Hampshire','NH',0,1),(30,21,2,'New Jersey','NJ',0,1),(31,21,2,'New Mexico','NM',0,1),(32,21,2,'New York','NY',0,1),(33,21,2,'North Carolina','NC',0,1),(34,21,2,'North Dakota','ND',0,1),(35,21,2,'Ohio','OH',0,1),(36,21,2,'Oklahoma','OK',0,1),(37,21,2,'Oregon','OR',0,1),(38,21,2,'Pennsylvania','PA',0,1),(39,21,2,'Rhode Island','RI',0,1),(40,21,2,'South Carolina','SC',0,1),(41,21,2,'South Dakota','SD',0,1),(42,21,2,'Tennessee','TN',0,1),(43,21,2,'Texas','TX',0,1),(44,21,2,'Utah','UT',0,1),(45,21,2,'Vermont','VT',0,1),(46,21,2,'Virginia','VA',0,1),(47,21,2,'Washington','WA',0,1),(48,21,2,'West Virginia','WV',0,1),(49,21,2,'Wisconsin','WI',0,1),(50,21,2,'Wyoming','WY',0,1),(51,21,2,'Puerto Rico','PR',0,1),(52,21,2,'US Virgin Islands','VI',0,1); +/*!40000 ALTER TABLE `ps_state` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_supplier` +-- + +DROP TABLE IF EXISTS `ps_supplier`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_supplier` ( + `id_supplier` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(64) NOT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_supplier`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_supplier` +-- + +LOCK TABLES `ps_supplier` WRITE; +/*!40000 ALTER TABLE `ps_supplier` DISABLE KEYS */; +INSERT INTO `ps_supplier` VALUES (1,'AppleStore','2009-06-09 11:36:02','2009-06-09 11:36:02'),(2,'Shure Online Store','2009-06-09 11:36:02','2009-06-09 11:36:02'); +/*!40000 ALTER TABLE `ps_supplier` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_supplier_lang` +-- + +DROP TABLE IF EXISTS `ps_supplier_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_supplier_lang` ( + `id_supplier` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `description` text, + PRIMARY KEY (`id_supplier`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_supplier_lang` +-- + +LOCK TABLES `ps_supplier_lang` WRITE; +/*!40000 ALTER TABLE `ps_supplier_lang` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_supplier_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_zone` +-- + +DROP TABLE IF EXISTS `ps_zone`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_zone` ( + `id_zone` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(64) NOT NULL, + `active` tinyint(1) unsigned NOT NULL DEFAULT '0', + `enabled` tinyint(1) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id_zone`) +) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_zone` +-- + +LOCK TABLES `ps_zone` WRITE; +/*!40000 ALTER TABLE `ps_zone` DISABLE KEYS */; +INSERT INTO `ps_zone` VALUES (1,'Europe',1,1),(2,'US',1,1),(3,'Asia',1,1),(4,'Africa',1,1),(5,'Oceania',1,1); +/*!40000 ALTER TABLE `ps_zone` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2009-10-15 8:39:34 diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_02_01_product.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_02_01_product.sql new file mode 100644 index 0000000000000000000000000000000000000000..4adead29d3a5eae9067f17a352cc236e83c6e7a6 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_02_01_product.sql @@ -0,0 +1,4 @@ +INSERT INTO `ps_product` (id_product, id_tax, ean13, reference, active, date_add, date_upd) VALUES (1, 1, '1234567890128', 'myShort123', 1, '2009-09-1414:00:00', '2009-09-1414:00:00'); +INSERT INTO `ps_product_lang` (id_product, id_lang, description, link_rewrite, name) VALUES (1, 1, 'This is a magnificient tee-shirt Tux', 'tee-shirt', 'Tee-Shirt Tux'), (1, 2, 'Voici un sublime tee-shirt Tux', 'tee-shirt', 'Tee-Shirt Tux'); +INSERT INTO `ps_category_product` (id_category, id_product, position) VALUES (1, 1, 1); + diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_02_product.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_02_product.sql new file mode 100644 index 0000000000000000000000000000000000000000..0bddf4116f00c239d21638bfbd30296b45c44e00 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_02_product.sql @@ -0,0 +1,497 @@ +-- MySQL dump 10.13 Distrib 5.1.34, for mandriva-linux-gnu (x86_64) +-- +-- Host: localhost Database: dump_test +-- ------------------------------------------------------ +-- Server version 5.1.34-Max + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `ps_attribute` +-- + +DROP TABLE IF EXISTS `ps_attribute`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_attribute` ( + `id_attribute` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_attribute_group` int(10) unsigned NOT NULL, + `color` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id_attribute`), + KEY `attribute_group` (`id_attribute_group`) +) ENGINE=MyISAM AUTO_INCREMENT=26 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_attribute` +-- + +LOCK TABLES `ps_attribute` WRITE; +/*!40000 ALTER TABLE `ps_attribute` DISABLE KEYS */; +INSERT INTO `ps_attribute` VALUES (1,1,NULL),(2,1,NULL),(3,2,'#D2D6D5'),(4,2,'#008CB7'),(5,2,'#F3349E'),(6,2,'#93D52D'),(7,2,'#FD9812'),(8,1,NULL),(9,1,NULL),(10,3,NULL),(11,3,NULL),(12,1,NULL),(13,1,NULL),(14,2,NULL),(15,1,''),(16,1,''),(17,1,''),(18,2,'#7800F0'),(19,2,'#F6EF04'),(20,2,'#F60409'),(21,5,'#000000'),(22,5,'#000000'),(23,5,'#000000'),(24,5,'#000000'),(25,5,'#000000'); +/*!40000 ALTER TABLE `ps_attribute` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_attribute_group` +-- + +DROP TABLE IF EXISTS `ps_attribute_group`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_attribute_group` ( + `id_attribute_group` int(10) unsigned NOT NULL AUTO_INCREMENT, + `is_color_group` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id_attribute_group`) +) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_attribute_group` +-- + +LOCK TABLES `ps_attribute_group` WRITE; +/*!40000 ALTER TABLE `ps_attribute_group` DISABLE KEYS */; +INSERT INTO `ps_attribute_group` VALUES (1,0),(2,1),(3,0),(5,0); +/*!40000 ALTER TABLE `ps_attribute_group` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_attribute_group_lang` +-- + +DROP TABLE IF EXISTS `ps_attribute_group_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_attribute_group_lang` ( + `id_attribute_group` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(128) NOT NULL, + `public_name` varchar(64) NOT NULL, + PRIMARY KEY (`id_attribute_group`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_attribute_group_lang` +-- + +LOCK TABLES `ps_attribute_group_lang` WRITE; +/*!40000 ALTER TABLE `ps_attribute_group_lang` DISABLE KEYS */; +INSERT INTO `ps_attribute_group_lang` VALUES (1,1,'Disk space','Disk space'),(1,2,'Capacité','Capacité'),(2,1,'Color','Color'),(2,2,'Couleur','Couleur'),(3,1,'ICU','Processor'),(3,2,'ICU','Processeur'),(5,2,'size','Taille'),(5,1,'size','Taille'); +/*!40000 ALTER TABLE `ps_attribute_group_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_attribute_lang` +-- + +DROP TABLE IF EXISTS `ps_attribute_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_attribute_lang` ( + `id_attribute` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(128) NOT NULL, + UNIQUE KEY `attribute_lang_index` (`id_attribute`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_attribute_lang` +-- + +LOCK TABLES `ps_attribute_lang` WRITE; +/*!40000 ALTER TABLE `ps_attribute_lang` DISABLE KEYS */; +INSERT INTO `ps_attribute_lang` VALUES (1,1,'2GB'),(1,2,'2Go'),(2,1,'4GB'),(2,2,'4Go'),(3,1,'Metal'),(3,2,'Metal'),(4,1,'Blue'),(4,2,'Bleu'),(5,1,'Pink'),(5,2,'Rose'),(6,1,'Green'),(6,2,'Vert'),(7,1,'Orange'),(7,2,'Orange'),(8,1,'Optional 64GB solid-state drive'),(8,2,'Disque dur SSD (solid-state drive) de 64 Go '),(9,1,'80GB Parallel ATA Drive @ 4200 rpm'),(9,2,'Disque dur PATA de 80 Go Ã| 4 200 tr/min'),(10,1,'1.60GHz Intel Core 2 Duo'),(10,2,'Intel Core 2 Duo Ã| 1,6 GHz'),(11,1,'1.80GHz Intel Core 2 Duo'),(11,2,'Intel Core 2 Duo Ã| 1,8 GHz'),(12,1,'80GB: 20,000 Songs'),(12,2,'80 Go : 20 000 chansons'),(13,1,'160GB: 40,000 Songs'),(13,2,'160 Go : 40 000 chansons'),(14,2,'Noir'),(14,1,'Black'),(15,1,'8Go'),(15,2,'8Go'),(16,1,'16Go'),(16,2,'16Go'),(17,1,'32Go'),(17,2,'32Go'),(18,1,'Purple'),(18,2,'Violet'),(19,1,'Yellow'),(19,2,'Jaune'),(20,1,'Red'),(20,2,'Rouge'),(21,1,'S'),(21,2,'S'),(22,1,'M'),(22,2,'M'),(23,1,'L'),(23,2,'L'),(24,1,'XL'),(24,2,'XL'),(25,1,'XXL'),(25,2,'XXL'); +/*!40000 ALTER TABLE `ps_attribute_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_category_product` +-- + +DROP TABLE IF EXISTS `ps_category_product`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_category_product` ( + `id_category` int(10) unsigned NOT NULL, + `id_product` int(10) unsigned NOT NULL, + `position` int(10) unsigned NOT NULL DEFAULT '0', + KEY `category_product_index` (`id_category`,`id_product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_category_product` +-- + +LOCK TABLES `ps_category_product` WRITE; +/*!40000 ALTER TABLE `ps_category_product` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_category_product` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_image` +-- + +DROP TABLE IF EXISTS `ps_image`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_image` ( + `id_image` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_product` int(10) unsigned NOT NULL, + `position` tinyint(2) unsigned NOT NULL DEFAULT '0', + `cover` tinyint(1) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id_image`), + KEY `image_product` (`id_product`) +) ENGINE=MyISAM AUTO_INCREMENT=58 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_image` +-- + +LOCK TABLES `ps_image` WRITE; +/*!40000 ALTER TABLE `ps_image` DISABLE KEYS */; +INSERT INTO `ps_image` VALUES (40,1,4,0),(39,1,3,0),(38,1,2,0),(37,1,1,1),(48,2,3,0),(47,2,2,0),(49,2,4,0),(46,2,1,1),(15,5,1,1),(16,5,2,0),(17,5,3,0),(18,6,4,0),(19,6,5,0),(20,6,1,1),(24,7,1,1),(33,8,1,1),(27,7,3,0),(26,7,2,0),(29,7,4,0),(30,7,5,0),(32,7,6,0),(36,9,1,1),(41,1,5,0),(42,1,6,0),(44,1,7,0),(45,1,8,0),(50,51,1,1),(51,53,1,1),(54,59,1,1),(53,58,1,1),(56,174,1,1),(57,173,1,1); +/*!40000 ALTER TABLE `ps_image` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_lang` +-- + +DROP TABLE IF EXISTS `ps_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_lang` ( + `id_lang` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(32) NOT NULL, + `active` tinyint(3) unsigned NOT NULL DEFAULT '0', + `iso_code` char(2) NOT NULL, + PRIMARY KEY (`id_lang`), + KEY `lang_iso_code` (`iso_code`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_lang` +-- + +LOCK TABLES `ps_lang` WRITE; +/*!40000 ALTER TABLE `ps_lang` DISABLE KEYS */; +INSERT INTO `ps_lang` VALUES (1,'English (English)',1,'en'),(2,'Français (French)',1,'fr'); +/*!40000 ALTER TABLE `ps_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_manufacturer` +-- + +DROP TABLE IF EXISTS `ps_manufacturer`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_manufacturer` ( + `id_manufacturer` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(64) NOT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_manufacturer`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_manufacturer` +-- + +LOCK TABLES `ps_manufacturer` WRITE; +/*!40000 ALTER TABLE `ps_manufacturer` DISABLE KEYS */; +INSERT INTO `ps_manufacturer` VALUES (1,'Apple Computer, Inc','2009-06-09 11:36:02','2009-06-09 11:36:02'),(2,'Shure Incorporated','2009-06-09 11:36:02','2009-06-09 11:36:02'); +/*!40000 ALTER TABLE `ps_manufacturer` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_manufacturer_lang` +-- + +DROP TABLE IF EXISTS `ps_manufacturer_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_manufacturer_lang` ( + `id_manufacturer` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `description` text, + PRIMARY KEY (`id_manufacturer`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_manufacturer_lang` +-- + +LOCK TABLES `ps_manufacturer_lang` WRITE; +/*!40000 ALTER TABLE `ps_manufacturer_lang` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_manufacturer_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_product` +-- + +DROP TABLE IF EXISTS `ps_product`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_product` ( + `id_product` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_supplier` int(10) unsigned DEFAULT NULL, + `id_manufacturer` int(10) unsigned DEFAULT NULL, + `id_tax` int(10) unsigned NOT NULL, + `id_category_default` int(10) unsigned DEFAULT NULL, + `id_color_default` int(10) unsigned DEFAULT NULL, + `on_sale` tinyint(1) unsigned NOT NULL DEFAULT '0', + `ean13` varchar(13) DEFAULT NULL, + `ecotax` decimal(10,2) NOT NULL DEFAULT '0.00', + `quantity` int(10) unsigned NOT NULL DEFAULT '0', + `price` decimal(13,6) NOT NULL DEFAULT '0.000000', + `wholesale_price` decimal(13,6) NOT NULL DEFAULT '0.000000', + `reduction_price` decimal(10,2) DEFAULT NULL, + `reduction_percent` float DEFAULT NULL, + `reduction_from` date DEFAULT NULL, + `reduction_to` date DEFAULT NULL, + `reference` varchar(32) DEFAULT NULL, + `supplier_reference` varchar(32) DEFAULT NULL, + `location` varchar(64) DEFAULT NULL, + `weight` float NOT NULL DEFAULT '0', + `out_of_stock` int(10) unsigned NOT NULL DEFAULT '2', + `quantity_discount` tinyint(1) DEFAULT '0', + `customizable` tinyint(2) NOT NULL DEFAULT '0', + `uploadable_files` tinyint(4) NOT NULL DEFAULT '0', + `text_fields` tinyint(4) NOT NULL DEFAULT '0', + `active` tinyint(1) unsigned NOT NULL DEFAULT '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_product`), + KEY `product_supplier` (`id_supplier`), + KEY `product_manufacturer` (`id_manufacturer`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_product` +-- + +LOCK TABLES `ps_product` WRITE; +/*!40000 ALTER TABLE `ps_product` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_product` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_product_attribute` +-- + +DROP TABLE IF EXISTS `ps_product_attribute`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_product_attribute` ( + `id_product_attribute` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_image` int(10) unsigned DEFAULT NULL, + `id_product` int(10) unsigned NOT NULL, + `reference` varchar(32) DEFAULT NULL, + `supplier_reference` varchar(32) DEFAULT NULL, + `location` varchar(64) DEFAULT NULL, + `ean13` varchar(13) DEFAULT NULL, + `wholesale_price` decimal(13,6) NOT NULL DEFAULT '0.000000', + `price` decimal(10,2) NOT NULL DEFAULT '0.00', + `ecotax` decimal(10,2) NOT NULL DEFAULT '0.00', + `quantity` int(10) unsigned NOT NULL DEFAULT '0', + `weight` float NOT NULL DEFAULT '0', + `default_on` tinyint(1) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id_product_attribute`), + KEY `product_attribute_product` (`id_product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_product_attribute` +-- + +LOCK TABLES `ps_product_attribute` WRITE; +/*!40000 ALTER TABLE `ps_product_attribute` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_product_attribute` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_product_attribute_combination` +-- + +DROP TABLE IF EXISTS `ps_product_attribute_combination`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_product_attribute_combination` ( + `id_attribute` int(10) unsigned NOT NULL, + `id_product_attribute` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_attribute`,`id_product_attribute`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_product_attribute_combination` +-- + +LOCK TABLES `ps_product_attribute_combination` WRITE; +/*!40000 ALTER TABLE `ps_product_attribute_combination` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_product_attribute_combination` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_product_lang` +-- + +DROP TABLE IF EXISTS `ps_product_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_product_lang` ( + `id_product` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `description` text, + `description_short` text, + `link_rewrite` varchar(128) NOT NULL, + `meta_description` varchar(255) DEFAULT NULL, + `meta_keywords` varchar(255) DEFAULT NULL, + `meta_title` varchar(128) DEFAULT NULL, + `name` varchar(128) NOT NULL, + `available_now` varchar(255) DEFAULT NULL, + `available_later` varchar(255) DEFAULT NULL, + UNIQUE KEY `product_lang_index` (`id_product`,`id_lang`), + FULLTEXT KEY `fts` (`name`,`description_short`,`description`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_product_lang` +-- + +LOCK TABLES `ps_product_lang` WRITE; +/*!40000 ALTER TABLE `ps_product_lang` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_product_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_supplier` +-- + +DROP TABLE IF EXISTS `ps_supplier`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_supplier` ( + `id_supplier` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(64) NOT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_supplier`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_supplier` +-- + +LOCK TABLES `ps_supplier` WRITE; +/*!40000 ALTER TABLE `ps_supplier` DISABLE KEYS */; +INSERT INTO `ps_supplier` VALUES (1,'AppleStore','2009-06-09 11:36:02','2009-06-09 11:36:02'),(2,'Shure Online Store','2009-06-09 11:36:02','2009-06-09 11:36:02'); +/*!40000 ALTER TABLE `ps_supplier` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_supplier_lang` +-- + +DROP TABLE IF EXISTS `ps_supplier_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_supplier_lang` ( + `id_supplier` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `description` text, + PRIMARY KEY (`id_supplier`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_supplier_lang` +-- + +LOCK TABLES `ps_supplier_lang` WRITE; +/*!40000 ALTER TABLE `ps_supplier_lang` DISABLE KEYS */; +/*!40000 ALTER TABLE `ps_supplier_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_tax` +-- + +DROP TABLE IF EXISTS `ps_tax`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_tax` ( + `id_tax` int(10) unsigned NOT NULL AUTO_INCREMENT, + `rate` float NOT NULL, + PRIMARY KEY (`id_tax`) +) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_tax` +-- + +LOCK TABLES `ps_tax` WRITE; +/*!40000 ALTER TABLE `ps_tax` DISABLE KEYS */; +INSERT INTO `ps_tax` VALUES (1,19.6),(2,5.5),(3,17.5); +/*!40000 ALTER TABLE `ps_tax` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ps_tax_lang` +-- + +DROP TABLE IF EXISTS `ps_tax_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ps_tax_lang` ( + `id_tax` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(32) NOT NULL, + UNIQUE KEY `tax_lang_index` (`id_tax`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ps_tax_lang` +-- + +LOCK TABLES `ps_tax_lang` WRITE; +/*!40000 ALTER TABLE `ps_tax_lang` DISABLE KEYS */; +INSERT INTO `ps_tax_lang` VALUES (1,1,'VAT 19.6%'),(1,2,'TVA 19.6%'),(2,1,'VAT 5.5%'),(2,2,'TVA 5.5%'),(3,1,'VAT 17.5%'),(3,2,'TVA UK 17.5%'); +/*!40000 ALTER TABLE `ps_tax_lang` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2009-10-15 8:44:23 diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_03_sale_order.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_03_sale_order.sql new file mode 100644 index 0000000000000000000000000000000000000000..a3ded771a1692473220ed605496070fd4d99c8bf --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_03_sale_order.sql @@ -0,0 +1,984 @@ +DROP TABLE IF EXISTS `ps_address`; +CREATE TABLE `ps_address` ( + `id_address` int(10) unsigned NOT NULL auto_increment, + `id_country` int(10) unsigned NOT NULL, + `id_state` int(10) unsigned default NULL, + `id_customer` int(10) unsigned NOT NULL default '0', + `id_manufacturer` int(10) unsigned NOT NULL default '0', + `id_supplier` int(10) unsigned NOT NULL default '0', + `alias` varchar(32) NOT NULL, + `company` varchar(32) default NULL, + `lastname` varchar(32) NOT NULL, + `firstname` varchar(32) NOT NULL, + `address1` varchar(128) NOT NULL, + `address2` varchar(128) default NULL, + `postcode` varchar(12) default NULL, + `city` varchar(64) NOT NULL, + `other` text, + `phone` varchar(16) default NULL, + `phone_mobile` varchar(16) default NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + `active` tinyint(1) unsigned NOT NULL default '1', + `deleted` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_address`), + KEY `address_customer` (`id_customer`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_address` WRITE; +INSERT INTO `ps_address` VALUES (1,21,5,0,1,0,'manufacturer',NULL,'JOBS','STEVE','1 Infinite Loop',NULL,'95014','Cupertino',NULL,'(800) 275-2273',NULL,'2009-09-17 09:48:51','2009-09-17 09:48:51',1,0),(2,8,0,1,0,0,'Mon adresse','My Company','DOE','John','16, Main street','2nd floor','75000','Paris ',NULL,'0102030405',NULL,'2009-09-17 09:48:51','2009-09-17 09:48:51',1,0); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_attribute`; +CREATE TABLE `ps_attribute` ( + `id_attribute` int(10) unsigned NOT NULL auto_increment, + `id_attribute_group` int(10) unsigned NOT NULL, + `color` varchar(32) default NULL, + PRIMARY KEY (`id_attribute`), + KEY `attribute_group` (`id_attribute_group`) +) ENGINE=MyISAM AUTO_INCREMENT=26 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_attribute` WRITE; +INSERT INTO `ps_attribute` VALUES (1,1,NULL),(2,1,NULL),(3,2,'#D2D6D5'),(4,2,'#008CB7'),(5,2,'#F3349E'),(6,2,'#93D52D'),(7,2,'#FD9812'),(8,1,NULL),(9,1,NULL),(10,3,NULL),(11,3,NULL),(12,1,NULL),(13,1,NULL),(14,2,NULL),(15,1,''),(16,1,''),(17,1,''),(18,2,'#7800F0'),(19,2,'#F6EF04'),(20,2,'#F60409'),(21,4,'#000000'),(22,4,'#000000'),(23,4,'#000000'),(24,4,'#000000'),(25,4,'#000000'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_attribute_group`; +CREATE TABLE `ps_attribute_group` ( + `id_attribute_group` int(10) unsigned NOT NULL auto_increment, + `is_color_group` tinyint(1) NOT NULL default '0', + PRIMARY KEY (`id_attribute_group`) +) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_attribute_group` WRITE; +INSERT INTO `ps_attribute_group` VALUES (1,0),(2,1),(3,0),(4,0); +UNLOCK TABLES; + +DROP TABLE IF EXISTS `ps_attribute_group_lang`; +CREATE TABLE `ps_attribute_group_lang` ( + `id_attribute_group` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(128) NOT NULL, + `public_name` varchar(64) NOT NULL, + PRIMARY KEY (`id_attribute_group`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_attribute_group_lang` WRITE; +INSERT INTO `ps_attribute_group_lang` VALUES (1,1,'Disk space','Disk space'),(1,2,'Capacite','Capacite'),(2,1,'Color','Color'),(2,2,'Couleur','Couleur'),(3,1,'ICU','Processor'),(3,2,'ICU','Processeur'),(4,1,'Size','Size'),(4,2,'Size','Size'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_attribute_impact`; +CREATE TABLE `ps_attribute_impact` ( + `id_attribute_impact` int(10) unsigned NOT NULL auto_increment, + `id_product` int(11) NOT NULL, + `id_attribute` int(11) NOT NULL, + `weight` float NOT NULL, + `price` decimal(10,2) NOT NULL, + PRIMARY KEY (`id_attribute_impact`), + UNIQUE KEY `id_product` (`id_product`,`id_attribute`) +) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_attribute_impact` WRITE; +INSERT INTO `ps_attribute_impact` VALUES (1,1,2,0,'60.00'),(2,1,5,0,'0.00'),(3,1,16,0,'50.00'),(4,1,15,0,'0.00'),(5,1,4,0,'0.00'),(6,1,19,0,'0.00'),(7,1,3,0,'0.00'),(8,1,14,0,'0.00'),(9,1,7,0,'0.00'),(10,1,20,0,'0.00'),(11,1,6,0,'0.00'),(12,1,18,0,'0.00'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_attribute_lang`; +CREATE TABLE `ps_attribute_lang` ( + `id_attribute` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(128) NOT NULL, + PRIMARY KEY (`id_attribute`,`id_lang`), + KEY `id_lang` (`id_lang`,`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_attribute_lang` WRITE; +INSERT INTO `ps_attribute_lang` VALUES (1,1,'2GB'),(1,2,'2Go'),(2,1,'4GB'),(2,2,'4Go'),(3,1,'Metal'),(3,2,'Metal'),(4,1,'Blue'),(4,2,'Bleu'),(5,1,'Pink'),(5,2,'Rose'),(6,1,'Green'),(6,2,'Vert'),(7,1,'Orange'),(7,2,'Orange'),(8,1,'Optional 64GB solid-state drive'),(8,2,'Disque dur SSD (solid-state drive) de 64 Go '),(9,1,'80GB Parallel ATA Drive @ 4200 rpm'),(9,2,'Disque dur PATA de 80 Go a 4 200 tr/min'),(10,1,'1.60GHz Intel Core 2 Duo'),(10,2,'Intel Core 2 Duo a 1,6 GHz'),(11,1,'1.80GHz Intel Core 2 Duo'),(11,2,'Intel Core 2 Duo a 1,8 GHz'),(12,1,'80GB: 20,000 Songs'),(12,2,'80 Go : 20 000 chansons'),(13,1,'160GB: 40,000 Songs'),(13,2,'160 Go : 40 000 chansons'),(14,2,'Noir'),(14,1,'Black'),(15,1,'8Go'),(15,2,'8Go'),(16,1,'16Go'),(16,2,'16Go'),(17,1,'32Go'),(17,2,'32Go'),(18,1,'Purple'),(18,2,'Violet'),(19,1,'Yellow'),(19,2,'Jaune'),(20,1,'Red'),(20,2,'Rouge'),(21,1,'S'),(21,2,'S'),(22,1,'M'),(22,2,'M'),(23,1,'L'),(23,2,'L'),(24,1,'L'),(24,2,'XL'),(25,1,'XS'),(25,2,'XS'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_carrier`; +CREATE TABLE `ps_carrier` ( + `id_carrier` int(10) unsigned NOT NULL auto_increment, + `id_tax` int(10) unsigned default '0', + `name` varchar(64) NOT NULL, + `url` varchar(255) default NULL, + `active` tinyint(1) unsigned NOT NULL default '0', + `deleted` tinyint(1) unsigned NOT NULL default '0', + `shipping_handling` tinyint(1) unsigned NOT NULL default '1', + `range_behavior` tinyint(1) unsigned NOT NULL default '0', + `is_module` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_carrier`), + KEY `deleted` (`deleted`,`active`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_carrier` WRITE; +INSERT INTO `ps_carrier` VALUES (1,0,'0',NULL,1,0,0,0,0),(2,1,'My carrier',NULL,1,0,1,0,0); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_carrier_lang`; +CREATE TABLE `ps_carrier_lang` ( + `id_carrier` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `delay` varchar(128) default NULL, + UNIQUE KEY `shipper_lang_index` (`id_lang`,`id_carrier`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_carrier_lang` WRITE; +INSERT INTO `ps_carrier_lang` VALUES (1,1,'Pick up in-store'),(1,2,'Retrait au magasin'),(2,1,'Delivery next day!'),(2,2,'Livraison le lendemain !'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_carrier_zone`; +CREATE TABLE `ps_carrier_zone` ( + `id_carrier` int(10) unsigned NOT NULL, + `id_zone` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_carrier`,`id_zone`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_carrier_zone` WRITE; +INSERT INTO `ps_carrier_zone` VALUES (1,1),(2,1),(2,2); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_category`; +CREATE TABLE `ps_category` ( + `id_category` int(10) unsigned NOT NULL auto_increment, + `id_parent` int(10) unsigned NOT NULL, + `level_depth` tinyint(3) unsigned NOT NULL default '0', + `active` tinyint(1) unsigned NOT NULL default '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_category`), + KEY `category_parent` (`id_parent`) +) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_category` WRITE; +INSERT INTO `ps_category` VALUES (1,0,0,1,'2009-09-17 09:48:51','2009-09-17 09:48:51'),(2,1,1,1,'2009-09-17 09:48:51','2009-09-17 09:48:51'),(3,1,1,1,'2009-09-17 09:48:51','2009-09-17 09:48:51'),(4,1,1,1,'2009-09-17 09:48:51','2009-09-17 09:48:51'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_category_group`; +CREATE TABLE `ps_category_group` ( + `id_category` int(10) unsigned NOT NULL, + `id_group` int(10) unsigned NOT NULL, + KEY `category_group_index` (`id_category`,`id_group`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_category_group` WRITE; +INSERT INTO `ps_category_group` VALUES (1,1),(2,1),(3,1),(4,1); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_category_lang`; +CREATE TABLE `ps_category_lang` ( + `id_category` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(128) NOT NULL, + `description` text, + `link_rewrite` varchar(128) NOT NULL, + `meta_title` varchar(128) default NULL, + `meta_keywords` varchar(128) default NULL, + `meta_description` varchar(128) default NULL, + UNIQUE KEY `category_lang_index` (`id_category`,`id_lang`), + KEY `category_name` (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_category_lang` WRITE; +INSERT INTO `ps_category_lang` VALUES (1,1,'Home','','home',NULL,NULL,NULL),(1,2,'Accueil','','home',NULL,NULL,NULL),(2,1,'iPods','Now that you can buy movies from the iTunes Store and sync them to your iPod, the whole world is your theater.','music-ipods','','',''),(2,2,'iPods','Il est temps, pour le meilleur lecteur de musique, de remonter sur scene pour un rappel. Avec le nouvel iPod, le monde est votre scene.','musique-ipods','','',''),(3,1,'Accessories','Wonderful accessories for your iPod','accessories-ipod','','',''),(3,2,'Accessoires','Tous les accessoires a la mode pour votre iPod','accessoires-ipod','','',''),(4,1,'Laptops','The latest Intel processor, a bigger hard drive, plenty of memory, and even more new features all fit inside just one liberating inch. The new Mac laptops have the performance, power, and connectivity of a desktop computer. Without the desk part.','laptops','Apple laptops','Apple laptops MacBook Air','Powerful and chic Apple laptops'),(4,2,'Portables','Le tout dernier processeur Intel, un disque dur plus spacieux, de la memoire a profusion et d\'autres nouveautes. Le tout, dans a peine 2,59 cm qui vous liberent de toute entrave. Les nouveaux portables Mac reunissent les performances, la puissance et la connectivite d\'un ordinateur de bureau. Sans la partie bureau.','portables-apple','Portables Apple','portables apple macbook air','portables apple puissants et design'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_category_product`; +CREATE TABLE `ps_category_product` ( + `id_category` int(10) unsigned NOT NULL, + `id_product` int(10) unsigned NOT NULL, + `position` int(10) unsigned NOT NULL default '0', + KEY `category_product_index` (`id_category`,`id_product`), + KEY `id_product` (`id_product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + + +LOCK TABLES `ps_category_product` WRITE; +INSERT INTO `ps_category_product` VALUES (1,1,0),(1,2,1),(1,6,2),(1,7,3),(2,1,0),(2,2,1),(2,7,2),(3,8,0),(3,9,1),(4,5,0),(4,6,1),(1,10,4),(1,11,5); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_country`; +CREATE TABLE `ps_country` ( + `id_country` int(10) unsigned NOT NULL auto_increment, + `id_zone` int(10) unsigned NOT NULL, + `iso_code` varchar(3) NOT NULL, + `active` tinyint(1) unsigned NOT NULL default '0', + `contains_states` tinyint(1) NOT NULL default '0', + PRIMARY KEY (`id_country`), + KEY `country_iso_code` (`iso_code`), + KEY `country_` (`id_zone`) +) ENGINE=MyISAM AUTO_INCREMENT=245 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_country` WRITE; +INSERT INTO `ps_country` VALUES (1,1,'DE',1,0),(2,1,'AT',1,0),(3,1,'BE',1,0),(4,2,'CA',1,0),(5,3,'CN',1,0),(6,1,'ES',1,0),(7,1,'FI',1,0),(8,1,'FR',1,0),(9,1,'GR',1,0),(10,1,'IT',1,0),(11,3,'JP',1,0),(12,1,'LU',1,0),(13,1,'NL',1,0),(14,1,'PL',1,0),(15,1,'PT',1,0),(16,1,'CZ',1,0),(17,1,'GB',1,0),(18,1,'SE',1,0),(19,1,'CH',1,0),(20,1,'DK',1,0),(21,2,'US',1,1),(22,3,'HK',1,0),(23,1,'NO',1,0),(24,5,'AU',1,0),(25,3,'SG',1,0),(26,1,'IE',1,0),(27,5,'NZ',1,0),(28,3,'KR',1,0),(29,3,'IL',1,0),(30,4,'ZA',1,0),(31,4,'NG',1,0),(32,4,'CI',1,0),(33,4,'TG',1,0),(34,2,'BO',1,0),(35,4,'MU',1,0),(143,1,'HU',1,0),(36,1,'RO',1,0),(37,1,'SK',1,0),(38,4,'DZ',1,0),(39,2,'AS',1,0),(40,1,'AD',1,0),(41,4,'AO',1,0),(42,2,'AI',1,0),(43,2,'AG',1,0),(44,2,'AR',1,0),(45,3,'AM',1,0),(46,2,'AW',1,0),(47,3,'AZ',1,0),(48,2,'BS',1,0),(49,3,'BH',1,0),(50,3,'BD',1,0),(51,2,'BB',1,0),(52,1,'BY',1,0),(53,2,'BZ',1,0),(54,4,'BJ',1,0),(55,2,'BM',1,0),(56,3,'BT',1,0),(57,4,'BW',1,0),(58,2,'BR',1,0),(59,3,'BN',1,0),(60,4,'BF',1,0),(61,3,'MM',1,0),(62,4,'BI',1,0),(63,3,'KH',1,0),(64,4,'CM',1,0),(65,4,'CV',1,0),(66,4,'CF',1,0),(67,4,'TD',1,0),(68,2,'CL',1,0),(69,2,'CO',1,0),(70,4,'KM',1,0),(71,4,'CD',1,0),(72,4,'CG',1,0),(73,2,'CR',1,0),(74,1,'HR',1,0),(75,2,'CU',1,0),(76,1,'CY',1,0),(77,4,'DJ',1,0),(78,2,'DM',1,0),(79,2,'DO',1,0),(80,3,'TL',1,0),(81,2,'EC',1,0),(82,4,'EG',1,0),(83,2,'SV',1,0),(84,4,'GQ',1,0),(85,4,'ER',1,0),(86,1,'EE',1,0),(87,4,'ET',1,0),(88,2,'FK',1,0),(89,1,'FO',1,0),(90,5,'FJ',1,0),(91,4,'GA',1,0),(92,4,'GM',1,0),(93,3,'GE',1,0),(94,4,'GH',1,0),(95,2,'GD',1,0),(96,1,'GL',1,0),(97,1,'GI',1,0),(98,2,'GP',1,0),(99,2,'GU',1,0),(100,2,'GT',1,0),(101,1,'GG',1,0),(102,4,'GN',1,0),(103,4,'GW',1,0),(104,2,'GY',1,0),(105,2,'HT',1,0),(106,5,'HM',1,0),(107,1,'VA',1,0),(108,2,'HN',1,0),(109,1,'IS',1,0),(110,3,'IN',1,0),(111,3,'ID',1,0),(112,3,'IR',1,0),(113,3,'IQ',1,0),(114,1,'IM',1,0),(115,2,'JM',1,0),(116,1,'JE',1,0),(117,3,'JO',1,0),(118,3,'KZ',1,0),(119,4,'KE',1,0),(120,1,'KI',1,0),(121,3,'KP',1,0),(122,3,'KW',1,0),(123,3,'KG',1,0),(124,3,'LA',1,0),(125,1,'LV',1,0),(126,3,'LB',1,0),(127,4,'LS',1,0),(128,4,'LR',1,0),(129,4,'LY',1,0),(130,1,'LI',1,0),(131,1,'LT',1,0),(132,3,'MO',1,0),(133,1,'MK',1,0),(134,4,'MG',1,0),(135,4,'MW',1,0),(136,3,'MY',1,0),(137,3,'MV',1,0),(138,4,'ML',1,0),(139,1,'MT',1,0),(140,5,'MH',1,0),(141,2,'MQ',1,0),(142,4,'MR',1,0),(144,4,'YT',1,0),(145,2,'MX',1,0),(146,5,'FM',1,0),(147,1,'MD',1,0),(148,1,'MC',1,0),(149,3,'MN',1,0),(150,1,'ME',1,0),(151,2,'MS',1,0),(152,4,'MA',1,0),(153,4,'MZ',1,0),(154,4,'NA',1,0),(155,5,'NR',1,0),(156,3,'NP',1,0),(157,2,'AN',1,0),(158,5,'NC',1,0),(159,2,'NI',1,0),(160,4,'NE',1,0),(161,5,'NU',1,0),(162,5,'NF',1,0),(163,5,'MP',1,0),(164,3,'OM',1,0),(165,3,'PK',1,0),(166,5,'PW',1,0),(167,3,'PS',1,0),(168,2,'PA',1,0),(169,5,'PG',1,0),(170,2,'PY',1,0),(171,2,'PE',1,0),(172,3,'PH',1,0),(173,5,'PN',1,0),(174,2,'PR',1,0),(175,3,'QA',1,0),(176,4,'RE',1,0),(177,1,'RU',1,0),(178,4,'RW',1,0),(179,2,'BL',1,0),(180,2,'KN',1,0),(181,2,'LC',1,0),(182,2,'MF',1,0),(183,2,'PM',1,0),(184,2,'VC',1,0),(185,5,'WS',1,0),(186,1,'SM',1,0),(187,4,'ST',1,0),(188,3,'SA',1,0),(189,4,'SN',1,0),(190,1,'RS',1,0),(191,4,'SC',1,0),(192,4,'SL',1,0),(193,1,'SI',1,0),(194,5,'SB',1,0),(195,4,'SO',1,0),(196,2,'GS',1,0),(197,3,'LK',1,0),(198,4,'SD',1,0),(199,2,'SR',1,0),(200,1,'SJ',1,0),(201,4,'SZ',1,0),(202,3,'SY',1,0),(203,3,'TW',1,0),(204,3,'TJ',1,0),(205,4,'TZ',1,0),(206,3,'TH',1,0),(207,5,'TK',1,0),(208,5,'TO',1,0),(209,2,'TT',1,0),(210,4,'TN',1,0),(211,1,'TR',1,0),(212,3,'TM',1,0),(213,2,'TC',1,0),(214,5,'TV',1,0),(215,4,'UG',1,0),(216,1,'UA',1,0),(217,3,'AE',1,0),(218,2,'UY',1,0),(219,3,'UZ',1,0),(220,5,'VU',1,0),(221,2,'VE',1,0),(222,3,'VN',1,0),(223,2,'VG',1,0),(224,2,'VI',1,0),(225,5,'WF',1,0),(226,4,'EH',1,0),(227,3,'YE',1,0),(228,4,'ZM',1,0),(229,4,'ZW',1,0),(230,1,'AL',1,0),(231,3,'AF',1,0),(232,5,'AQ',1,0),(233,1,'BA',1,0),(234,5,'BV',1,0),(235,5,'IO',1,0),(236,1,'BG',1,0),(237,2,'KY',1,0),(238,3,'CX',1,0),(239,3,'CC',1,0),(240,5,'CK',1,0),(241,2,'GF',1,0),(242,5,'PF',1,0),(243,5,'TF',1,0),(244,1,'AX',1,0); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_country_lang`; +CREATE TABLE `ps_country_lang` ( + `id_country` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(64) NOT NULL, + UNIQUE KEY `country_lang_index` (`id_country`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_country_lang` WRITE; +INSERT INTO `ps_country_lang` VALUES (1,1,'Germany'),(1,2,'Allemagne'),(2,1,'Austria'),(2,2,'Autriche'),(3,1,'Belgium'),(3,2,'Belgique'),(4,1,'Canada'),(4,2,'Canada'),(5,1,'China'),(5,2,'Chine'),(6,1,'Spain'),(6,2,'Espagne'),(7,1,'Finland'),(7,2,'Finlande'),(8,1,'France'),(8,2,'France'),(9,1,'Greece'),(9,2,'Grece'),(10,1,'Italy'),(10,2,'Italie'),(11,1,'Japan'),(11,2,'Japon'),(12,1,'Luxemburg'),(12,2,'Luxembourg'),(13,1,'Netherlands'),(13,2,'Pays-bas'),(14,1,'Poland'),(14,2,'Pologne'),(15,1,'Portugal'),(15,2,'Portugal'),(16,1,'Czech Republic'),(16,2,'Republique Tcheque'),(17,1,'United Kingdom'),(17,2,'Royaume-Uni'),(18,1,'Sweden'),(18,2,'Suede'),(19,1,'Switzerland'),(19,2,'Suisse'),(20,1,'Denmark'),(20,2,'Danemark'),(21,1,'USA'),(21,2,'USA'),(22,1,'HongKong'),(22,2,'Hong-Kong'),(23,1,'Norway'),(23,2,'Norvege'),(24,1,'Australia'),(24,2,'Australie'),(25,1,'Singapore'),(25,2,'Singapour'),(26,1,'Ireland'),(26,2,'Eire'),(27,1,'New Zealand'),(27,2,'Nouvelle-Zelande'),(28,1,'South Korea'),(28,2,'Coree du Sud'),(29,1,'Israel'),(29,2,'Israel'),(30,1,'South Africa'),(30,2,'Afrique du Sud'),(31,1,'Nigeria'),(31,2,'Nigeria'),(32,1,'Ivory Coast'),(32,2,'Cote d\'Ivoire'),(33,1,'Togo'),(33,2,'Togo'),(34,1,'Bolivia'),(34,2,'Bolivie'),(35,1,'Mauritius'),(35,2,'Ile Maurice'),(143,1,'Hungary'),(143,2,'Hongrie'),(36,1,'Romania'),(36,2,'Roumanie'),(37,1,'Slovakia'),(37,2,'Slovaquie'),(38,1,'Algeria'),(38,2,'Algerie'),(39,1,'American Samoa'),(39,2,'Samoa Americaines'),(40,1,'Andorra'),(40,2,'Andorre'),(41,1,'Angola'),(41,2,'Angola'),(42,1,'Anguilla'),(42,2,'Anguilla'),(43,1,'Antigua and Barbuda'),(43,2,'Antigua et Barbuda'),(44,1,'Argentina'),(44,2,'Argentine'),(45,1,'Armenia'),(45,2,'Armenie'),(46,1,'Aruba'),(46,2,'Aruba'),(47,1,'Azerbaijan'),(47,2,'Azerbaidjan'),(48,1,'Bahamas'),(48,2,'Bahamas'),(49,1,'Bahrain'),(49,2,'Bahrein'),(50,1,'Bangladesh'),(50,2,'Bangladesh'),(51,1,'Barbados'),(51,2,'Barbade'),(52,1,'Belarus'),(52,2,'Belarus'),(53,1,'Belize'),(53,2,'Belize'),(54,1,'Benin'),(54,2,'Benin'),(55,1,'Bermuda'),(55,2,'Bermudes'),(56,1,'Bhutan'),(56,2,'Bhoutan'),(57,1,'Botswana'),(57,2,'Botswana'),(58,1,'Brazil'),(58,2,'Bresil'),(59,1,'Brunei'),(59,2,'Brunei Darussalam'),(60,1,'Burkina Faso'),(60,2,'Burkina Faso'),(61,1,'Burma (Myanmar)'),(61,2,'Burma (Myanmar)'),(62,1,'Burundi'),(62,2,'Burundi'),(63,1,'Cambodia'),(63,2,'Cambodge'),(64,1,'Cameroon'),(64,2,'Cameroun'),(65,1,'Cape Verde'),(65,2,'Cap-Vert'),(66,1,'Central African Republic'),(66,2,'Centrafricaine, Republique'),(67,1,'Chad'),(67,2,'Tchad'),(68,1,'Chile'),(68,2,'Chili'),(69,1,'Colombia'),(69,2,'Colombie'),(70,1,'Comoros'),(70,2,'Comores'),(71,1,'Congo, Dem. Republic'),(71,2,'Congo, Rep. Dem.'),(72,1,'Congo, Republic'),(72,2,'Congo, Rep.'),(73,1,'Costa Rica'),(73,2,'Costa Rica'),(74,1,'Croatia'),(74,2,'Croatie'),(75,1,'Cuba'),(75,2,'Cuba'),(76,1,'Cyprus'),(76,2,'Chypre'),(77,1,'Djibouti'),(77,2,'Djibouti'),(78,1,'Dominica'),(78,2,'Dominica'),(79,1,'Dominican Republic'),(79,2,'Republique Dominicaine'),(80,1,'East Timor'),(80,2,'Timor oriental'),(81,1,'Ecuador'),(81,2,'Equateur'),(82,1,'Egypt'),(82,2,'Egypte'),(83,1,'El Salvador'),(83,2,'El Salvador'),(84,1,'Equatorial Guinea'),(84,2,'Guinee Equatoriale'),(85,1,'Eritrea'),(85,2,'Erythree'),(86,1,'Estonia'),(86,2,'Estonie'),(87,1,'Ethiopia'),(87,2,'Ethiopie'),(88,1,'Falkland Islands'),(88,2,'Falkland, Iles'),(89,1,'Faroe Islands'),(89,2,'Feroe, Iles'),(90,1,'Fiji'),(90,2,'Fidji'),(91,1,'Gabon'),(91,2,'Gabon'),(92,1,'Gambia'),(92,2,'Gambie'),(93,1,'Georgia'),(93,2,'Georgie'),(94,1,'Ghana'),(94,2,'Ghana'),(95,1,'Grenada'),(95,2,'Grenade'),(96,1,'Greenland'),(96,2,'Groenland'),(97,1,'Gibraltar'),(97,2,'Gibraltar'),(98,1,'Guadeloupe'),(98,2,'Guadeloupe'),(99,1,'Guam'),(99,2,'Guam'),(100,1,'Guatemala'),(100,2,'Guatemala'),(101,1,'Guernsey'),(101,2,'Guernesey'),(102,1,'Guinea'),(102,2,'Guinee'),(103,1,'Guinea-Bissau'),(103,2,'Guinee-Bissau'),(104,1,'Guyana'),(104,2,'Guyana'),(105,1,'Haiti'),(105,2,'Haiti'),(106,1,'Heard Island and McDonald Islands'),(106,2,'Heard, Ile et Mcdonald, Iles'),(107,1,'Vatican City State'),(107,2,'Saint-Siege (Etat de la Cite du Vatican)'),(108,1,'Honduras'),(108,2,'Honduras'),(109,1,'Iceland'),(109,2,'Islande'),(110,1,'India'),(110,2,'Indie'),(111,1,'Indonesia'),(111,2,'Indonesie'),(112,1,'Iran'),(112,2,'Iran'),(113,1,'Iraq'),(113,2,'Iraq'),(114,1,'Isle of Man'),(114,2,'Ile de Man'),(115,1,'Jamaica'),(115,2,'Jamaique'),(116,1,'Jersey'),(116,2,'Jersey'),(117,1,'Jordan'),(117,2,'Jordanie'),(118,1,'Kazakhstan'),(118,2,'Kazakhstan'),(119,1,'Kenya'),(119,2,'Kenya'),(120,1,'Kiribati'),(120,2,'Kiribati'),(121,1,'Korea, Dem. Republic of'),(121,2,'Coree, Rep. Populaire Dem. de'),(122,1,'Kuwait'),(122,2,'Koweit'),(123,1,'Kyrgyzstan'),(123,2,'Kirghizistan'),(124,1,'Laos'),(124,2,'Laos'),(125,1,'Latvia'),(125,2,'Lettonie'),(126,1,'Lebanon'),(126,2,'Liban'),(127,1,'Lesotho'),(127,2,'Lesotho'),(128,1,'Liberia'),(128,2,'Liberia'),(129,1,'Libya'),(129,2,'Libyenne, Jamahiriya Arabe'),(130,1,'Liechtenstein'),(130,2,'Liechtenstein'),(131,1,'Lithuania'),(131,2,'Lituanie'),(132,1,'Macau'),(132,2,'Macao'),(133,1,'Macedonia'),(133,2,'Macedoine'),(134,1,'Madagascar'),(134,2,'Madagascar'),(135,1,'Malawi'),(135,2,'Malawi'),(136,1,'Malaysia'),(136,2,'Malaisie'),(137,1,'Maldives'),(137,2,'Maldives'),(138,1,'Mali'),(138,2,'Mali'),(139,1,'Malta'),(139,2,'Malte'),(140,1,'Marshall Islands'),(140,2,'Marshall, Iles'),(141,1,'Martinique'),(141,2,'Martinique'),(142,1,'Mauritania'),(142,2,'Mauritanie'),(144,1,'Mayotte'),(144,2,'Mayotte'),(145,1,'Mexico'),(145,2,'Mexique'),(146,1,'Micronesia'),(146,2,'Micronesie'),(147,1,'Moldova'),(147,2,'Moldova'),(148,1,'Monaco'),(148,2,'Monaco'),(149,1,'Mongolia'),(149,2,'Mongolie'),(150,1,'Montenegro'),(150,2,'Montenegro'),(151,1,'Montserrat'),(151,2,'Montserrat'),(152,1,'Morocco'),(152,2,'Maroc'),(153,1,'Mozambique'),(153,2,'Mozambique'),(154,1,'Namibia'),(154,2,'Namibie'),(155,1,'Nauru'),(155,2,'Nauru'),(156,1,'Nepal'),(156,2,'Nepal'),(157,1,'Netherlands Antilles'),(157,2,'Antilles Neerlandaises'),(158,1,'New Caledonia'),(158,2,'Nouvelle-Caledonie'),(159,1,'Nicaragua'),(159,2,'Nicaragua'),(160,1,'Niger'),(160,2,'Niger'),(161,1,'Niue'),(161,2,'Niue'),(162,1,'Norfolk Island'),(162,2,'Norfolk, Ile'),(163,1,'Northern Mariana Islands'),(163,2,'Mariannes du Nord, Iles'),(164,1,'Oman'),(164,2,'Oman'),(165,1,'Pakistan'),(165,2,'Pakistan'),(166,1,'Palau'),(166,2,'Palaos'),(167,1,'Palestinian Territories'),(167,2,'Palestinien Occupe, Territoire'),(168,1,'Panama'),(168,2,'Panama'),(169,1,'Papua New Guinea'),(169,2,'Papouasie-Nouvelle-Guinee'),(170,1,'Paraguay'),(170,2,'Paraguay'),(171,1,'Peru'),(171,2,'Perou'),(172,1,'Philippines'),(172,2,'Philippines'),(173,1,'Pitcairn'),(173,2,'Pitcairn'),(174,1,'Puerto Rico'),(174,2,'Porto Rico'),(175,1,'Qatar'),(175,2,'Qatar'),(176,1,'Reunion'),(176,2,'Reunion'),(177,1,'Russian Federation'),(177,2,'Russie, Federation de'),(178,1,'Rwanda'),(178,2,'Rwanda'),(179,1,'Saint Barthelemy'),(179,2,'Saint-Barthelemy'),(180,1,'Saint Kitts and Nevis'),(180,2,'Saint-Kitts-et-Nevis'),(181,1,'Saint Lucia'),(181,2,'Sainte-Lucie'),(182,1,'Saint Martin'),(182,2,'Saint-Martin'),(183,1,'Saint Pierre and Miquelon'),(183,2,'Saint-Pierre-et-Miquelon'),(184,1,'Saint Vincent and the Grenadines'),(184,2,'Saint-Vincent-et-Les Grenadines'),(185,1,'Samoa'),(185,2,'Samoa'),(186,1,'San Marino'),(186,2,'Saint-Marin'),(187,1,'São Tome and PrÃncipe'),(187,2,'Sao Tome-et-Principe'),(188,1,'Saudi Arabia'),(188,2,'Arabie Saoudite'),(189,1,'Senegal'),(189,2,'Senegal'),(190,1,'Serbia'),(190,2,'Serbie'),(191,1,'Seychelles'),(191,2,'Seychelles'),(192,1,'Sierra Leone'),(192,2,'Sierra Leone'),(193,1,'Slovenia'),(193,2,'Slovenie'),(194,1,'Solomon Islands'),(194,2,'Salomon, Iles'),(195,1,'Somalia'),(195,2,'Somalie'),(196,1,'South Georgia and the South Sandwich Islands'),(196,2,'Georgie du Sud et les Iles Sandwich du Sud'),(197,1,'Sri Lanka'),(197,2,'Sri Lanka'),(198,1,'Sudan'),(198,2,'Soudan'),(199,1,'Suriname'),(199,2,'Suriname'),(200,1,'Svalbard and Jan Mayen'),(200,2,'Svalbard et Ile Jan Mayen'),(201,1,'Swaziland'),(201,2,'Swaziland'),(202,1,'Syria'),(202,2,'Syrienne'),(203,1,'Taiwan'),(203,2,'Taiwan'),(204,1,'Tajikistan'),(204,2,'Tadjikistan'),(205,1,'Tanzania'),(205,2,'Tanzanie'),(206,1,'Thailand'),(206,2,'Thailande'),(207,1,'Tokelau'),(207,2,'Tokelau'),(208,1,'Tonga'),(208,2,'Tonga'),(209,1,'Trinidad and Tobago'),(209,2,'Trinite-et-Tobago'),(210,1,'Tunisia'),(210,2,'Tunisie'),(211,1,'Turkey'),(211,2,'Turquie'),(212,1,'Turkmenistan'),(212,2,'Turkmenistan'),(213,1,'Turks and Caicos Islands'),(213,2,'Turks et Caiques, Iles'),(214,1,'Tuvalu'),(214,2,'Tuvalu'),(215,1,'Uganda'),(215,2,'Ouganda'),(216,1,'Ukraine'),(216,2,'Ukraine'),(217,1,'United Arab Emirates'),(217,2,'Emirats Arabes Unis'),(218,1,'Uruguay'),(218,2,'Uruguay'),(219,1,'Uzbekistan'),(219,2,'Ouzbekistan'),(220,1,'Vanuatu'),(220,2,'Vanuatu'),(221,1,'Venezuela'),(221,2,'Venezuela'),(222,1,'Vietnam'),(222,2,'Vietnam'),(223,1,'Virgin Islands (British)'),(223,2,'Iles Vierges Britanniques'),(224,1,'Virgin Islands (U.S.)'),(224,2,'Iles Vierges des Etats-Unis'),(225,1,'Wallis and Futuna'),(225,2,'Wallis et Futuna'),(226,1,'Western Sahara'),(226,2,'Sahara Occidental'),(227,1,'Yemen'),(227,2,'Yemen'),(228,1,'Zambia'),(228,2,'Zambie'),(229,1,'Zimbabwe'),(229,2,'Zimbabwe'),(230,1,'Albania'),(230,2,'Albanie'),(231,1,'Afghanistan'),(231,2,'Afghanistan'),(232,1,'Antarctica'),(232,2,'Antarctique'),(233,1,'Bosnia and Herzegovina'),(233,2,'Bosnie-Herzegovine'),(234,1,'Bouvet Island'),(234,2,'Bouvet, Ile'),(235,1,'British Indian Ocean Territory'),(235,2,'Ocean Indien, Territoire Britannique de L\''),(236,1,'Bulgaria'),(236,2,'Bulgarie'),(237,1,'Cayman Islands'),(237,2,'Caimans, Iles'),(238,1,'Christmas Island'),(238,2,'Christmas, Ile'),(239,1,'Cocos (Keeling) Islands'),(239,2,'Cocos (Keeling), Iles'),(240,1,'Cook Islands'),(240,2,'Cook, Iles'),(241,1,'French Guiana'),(241,2,'Guyane Francaise'),(242,1,'French Polynesia'),(242,2,'Polynesie Francaise'),(243,1,'French Southern Territories'),(243,2,'Terres Australes Francaises'),(244,1,'Ã…land Islands'),(244,2,'Ã…land, Iles'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_currency`; +CREATE TABLE `ps_currency` ( + `id_currency` int(10) unsigned NOT NULL auto_increment, + `name` varchar(32) NOT NULL, + `iso_code` varchar(3) NOT NULL default '0', + `sign` varchar(8) NOT NULL, + `blank` tinyint(1) unsigned NOT NULL default '0', + `format` tinyint(1) unsigned NOT NULL default '0', + `decimals` tinyint(1) unsigned NOT NULL default '1', + `conversion_rate` decimal(13,6) NOT NULL, + `deleted` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_currency`) +) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_currency` WRITE; +INSERT INTO `ps_currency` VALUES (1,'Euro','EUR','€',1,2,1,'1.000000',0),(2,'Dollar','USD','$',0,1,1,'1.470000',0),(3,'Pound','GBP','£',0,1,1,'0.800000',0); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_customer`; +CREATE TABLE `ps_customer` ( + `id_customer` int(10) unsigned NOT NULL auto_increment, + `id_gender` int(10) unsigned NOT NULL, + `secure_key` varchar(32) NOT NULL default '-1', + `email` varchar(128) NOT NULL, + `passwd` varchar(32) NOT NULL, + `last_passwd_gen` timestamp NOT NULL default CURRENT_TIMESTAMP, + `birthday` date default NULL, + `lastname` varchar(32) NOT NULL, + `newsletter` tinyint(1) unsigned NOT NULL default '0', + `ip_registration_newsletter` varchar(15) default NULL, + `newsletter_date_add` datetime default NULL, + `optin` tinyint(1) unsigned NOT NULL default '0', + `firstname` varchar(32) NOT NULL, + `active` tinyint(1) unsigned NOT NULL default '0', + `deleted` tinyint(1) NOT NULL default '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_customer`), + UNIQUE KEY `customer_email` (`email`), + KEY `customer_login` (`email`,`passwd`) +) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_customer` WRITE; +INSERT INTO `ps_customer` VALUES (1,1,'47ce86627c1f3c792a80773c5d2deaf8','john@doe.com','4717e0bdb6970abede946f45ae0c1c6d','2009-09-17 07:48:51','1970-01-15','DOE',1,NULL,'2009-09-17 09:54:53',1,'John',1,0,'2009-09-17 09:48:51','2009-09-17 09:54:53'),(2,9,'02d849254b0dd5a0ed20082ec54d9c4a','prestashop@prestashop.com','154c31ed01c2317e6fee607bb99b68a7','2009-09-17 01:55:26',NULL,'SITE',0,NULL,NULL,0,'Prestashop',1,0,'2009-09-17 09:55:26','2009-09-17 09:55:26'),(3,2,'898d9b1eca5f2115b4f256fd5a5bf272','jane@doe.com','9c29952d9a02ece31771cad1c97b3b2a','2009-09-17 01:56:30','1975-01-01','DOE',0,NULL,NULL,0,'Jane',1,0,'2009-09-17 09:56:30','2009-09-17 09:56:42'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_customer_group`; +CREATE TABLE `ps_customer_group` ( + `id_customer` int(10) unsigned NOT NULL, + `id_group` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_customer`,`id_group`), + KEY `customer_login` (`id_group`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_customer_group` WRITE; +INSERT INTO `ps_customer_group` VALUES (1,1),(2,1),(3,1); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_group`; +CREATE TABLE `ps_group` ( + `id_group` int(10) unsigned NOT NULL auto_increment, + `reduction` decimal(10,2) NOT NULL default '0.00', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_group`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_group` WRITE; +INSERT INTO `ps_group` VALUES (1,'0.00','2009-09-17 09:48:51','2009-09-17 09:48:51'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_group_lang`; +CREATE TABLE `ps_group_lang` ( + `id_group` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(32) NOT NULL, + UNIQUE KEY `attribute_lang_index` (`id_group`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_group_lang` WRITE; +INSERT INTO `ps_group_lang` VALUES (1,1,'Default'),(1,2,'Defaut'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_image`; +CREATE TABLE `ps_image` ( + `id_image` int(10) unsigned NOT NULL auto_increment, + `id_product` int(10) unsigned NOT NULL, + `position` tinyint(2) unsigned NOT NULL default '0', + `cover` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_image`), + KEY `image_product` (`id_product`) +) ENGINE=MyISAM AUTO_INCREMENT=52 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_image` WRITE; +INSERT INTO `ps_image` VALUES (40,1,4,0),(39,1,3,0),(38,1,2,0),(37,1,1,1),(48,2,3,0),(47,2,2,0),(49,2,4,0),(46,2,1,1),(15,5,1,1),(16,5,2,0),(17,5,3,0),(18,6,4,0),(19,6,5,0),(20,6,1,1),(24,7,1,1),(33,8,1,1),(27,7,3,0),(26,7,2,0),(29,7,4,0),(30,7,5,0),(32,7,6,0),(36,9,1,1),(41,1,5,0),(42,1,6,0),(44,1,7,0),(45,1,8,0),(50,10,1,1),(51,11,1,1); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_image_lang`; +CREATE TABLE `ps_image_lang` ( + `id_image` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `legend` varchar(128) default NULL, + UNIQUE KEY `image_lang_index` (`id_image`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_image_lang` WRITE; +INSERT INTO `ps_image_lang` VALUES (40,2,'iPod Nano'),(40,1,'iPod Nano'),(39,2,'iPod Nano'),(39,1,'iPod Nano'),(38,2,'iPod Nano'),(38,1,'iPod Nano'),(37,2,'iPod Nano'),(37,1,'iPod Nano'),(48,2,'iPod shuffle'),(48,1,'iPod shuffle'),(47,2,'iPod shuffle'),(47,1,'iPod shuffle'),(49,2,'iPod shuffle'),(49,1,'iPod shuffle'),(46,2,'iPod shuffle'),(46,1,'iPod shuffle'),(10,1,'luxury-cover-for-ipod-video'),(10,2,'housse-luxe-pour-ipod-video'),(11,1,'cover'),(11,2,'housse'),(12,1,'myglove-ipod-nano'),(12,2,'myglove-ipod-nano'),(13,1,'myglove-ipod-nano'),(13,2,'myglove-ipod-nano'),(14,1,'myglove-ipod-nano'),(14,2,'myglove-ipod-nano'),(15,1,'MacBook Air'),(15,2,'macbook-air-1'),(16,1,'MacBook Air'),(16,2,'macbook-air-2'),(17,1,'MacBook Air'),(17,2,'macbook-air-3'),(18,1,'MacBook Air'),(18,2,'macbook-air-4'),(19,1,'MacBook Air'),(19,2,'macbook-air-5'),(20,1,' MacBook Air SuperDrive'),(20,2,'superdrive-pour-macbook-air-1'),(24,2,'iPod touch'),(24,1,'iPod touch'),(33,1,'housse-portefeuille-en-cuir'),(26,1,'iPod touch'),(26,2,'iPod touch'),(27,1,'iPod touch'),(27,2,'iPod touch'),(29,1,'iPod touch'),(29,2,'iPod touch'),(30,1,'iPod touch'),(30,2,'iPod touch'),(32,1,'iPod touch'),(32,2,'iPod touch'),(33,2,'housse-portefeuille-en-cuir-ipod-nano'),(36,2,'Ecouteurs a isolation sonore Shure SE210'),(36,1,'Shure SE210 Sound-Isolating Earphones for iPod and iPhone'),(41,1,'iPod Nano'),(41,2,'iPod Nano'),(42,1,'iPod Nano'),(42,2,'iPod Nano'),(44,1,'iPod Nano'),(44,2,'iPod Nano'),(45,1,'iPod Nano'),(45,2,'iPod Nano'),(50,1,'Maillot de Bain'),(50,2,'Maillot de Bain'),(51,1,'Short'),(51,2,'Short'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_image_type`; +CREATE TABLE `ps_image_type` ( + `id_image_type` int(10) unsigned NOT NULL auto_increment, + `name` varchar(16) NOT NULL, + `width` int(10) unsigned NOT NULL, + `height` int(10) unsigned NOT NULL, + `products` tinyint(1) NOT NULL default '1', + `categories` tinyint(1) NOT NULL default '1', + `manufacturers` tinyint(1) NOT NULL default '1', + `suppliers` tinyint(1) NOT NULL default '1', + `scenes` tinyint(1) NOT NULL default '1', + PRIMARY KEY (`id_image_type`), + KEY `image_type_name` (`name`) +) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_image_type` WRITE; +INSERT INTO `ps_image_type` VALUES (1,'small',45,45,1,1,1,1,0),(2,'medium',80,80,1,1,1,1,0),(3,'large',300,300,1,1,1,1,0),(4,'thickbox',600,600,1,0,0,0,0),(5,'category',500,150,0,1,0,0,0),(6,'home',129,129,1,0,0,0,0),(7,'large_scene',556,200,0,0,0,0,1),(8,'thumb_scene',161,58,0,0,0,0,1); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_lang`; +CREATE TABLE `ps_lang` ( + `id_lang` int(10) unsigned NOT NULL auto_increment, + `name` varchar(32) NOT NULL, + `active` tinyint(3) unsigned NOT NULL default '0', + `iso_code` char(2) NOT NULL, + PRIMARY KEY (`id_lang`), + KEY `lang_iso_code` (`iso_code`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_lang` WRITE; +INSERT INTO `ps_lang` VALUES (1,'English (English)',1,'en'),(2,'Francais (French)',1,'fr'); + + +DROP TABLE IF EXISTS `ps_manufacturer`; +CREATE TABLE `ps_manufacturer` ( + `id_manufacturer` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) NOT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_manufacturer`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_manufacturer` WRITE; +INSERT INTO `ps_manufacturer` VALUES (1,'Apple Computer, Inc','2009-09-17 09:48:51','2009-09-17 09:48:51'),(2,'Shure Incorporated','2009-09-17 09:48:51','2009-09-17 09:48:51'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_manufacturer_lang`; +CREATE TABLE `ps_manufacturer_lang` ( + `id_manufacturer` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `description` text, + `short_description` varchar(254) default NULL, + `meta_title` varchar(254) default NULL, + `meta_keywords` varchar(254) default NULL, + `meta_description` varchar(254) default NULL, + PRIMARY KEY (`id_manufacturer`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + + +DROP TABLE IF EXISTS `ps_module`; +CREATE TABLE `ps_module` ( + `id_module` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) NOT NULL, + `active` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_module`), + KEY `name` (`name`) +) ENGINE=MyISAM AUTO_INCREMENT=52 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_module` WRITE; +INSERT INTO `ps_module` VALUES (1,'homefeatured',1),(2,'gsitemap',1),(3,'cheque',1),(4,'paypal',1),(5,'editorial',1),(6,'bankwire',1),(7,'blockadvertising',1),(8,'blockbestsellers',1),(9,'blockcart',1),(10,'blockcategories',1),(11,'blockcurrencies',1),(12,'blockinfos',1),(13,'blocklanguages',1),(14,'blockmanufacturer',1),(15,'blockmyaccount',1),(16,'blocknewproducts',1),(17,'blockpaymentlogo',1),(18,'blockpermanentlinks',1),(19,'blocksearch',1),(20,'blockspecials',1),(21,'blocktags',1),(22,'blockuserinfo',1),(23,'blockvariouslinks',1),(24,'blockviewed',1),(25,'statsdata',1),(26,'statsvisits',1),(27,'statssales',1),(28,'statsregistrations',1),(30,'statspersonalinfos',1),(31,'statslive',1),(32,'statsequipment',1),(33,'statscatalog',1),(34,'graphvisifire',1),(35,'graphxmlswfcharts',1),(36,'graphgooglechart',1),(37,'graphartichow',1),(38,'statshome',1),(39,'gridextjs',1),(40,'statsbestcustomers',1),(41,'statsorigin',1),(42,'pagesnotfound',1),(43,'sekeywords',1),(44,'statsproduct',1),(45,'statsbestproducts',1),(46,'statsbestcategories',1),(47,'statsbestvouchers',1),(48,'statsbestsuppliers',1),(49,'statscarrier',1),(50,'statsnewsletter',1),(51,'statssearch',1); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_module_country`; +CREATE TABLE `ps_module_country` ( + `id_module` int(10) unsigned NOT NULL, + `id_country` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_module`,`id_country`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_module_country` WRITE; +INSERT INTO `ps_module_country` VALUES (3,1),(3,2),(3,3),(3,4),(3,5),(3,6),(3,7),(3,8),(3,9),(3,10),(3,11),(3,12),(3,13),(3,14),(3,15),(3,16),(3,17),(3,18),(3,19),(3,20),(3,21),(3,22),(3,23),(3,24),(3,25),(3,26),(3,27),(3,28),(3,29),(3,30),(3,31),(3,32),(3,33),(3,34),(4,1),(4,2),(4,3),(4,4),(4,5),(4,6),(4,7),(4,8),(4,9),(4,10),(4,11),(4,12),(4,13),(4,14),(4,15),(4,16),(4,17),(4,18),(4,19),(4,20),(4,21),(4,22),(4,23),(4,24),(4,25),(4,26),(4,27),(4,28),(4,29),(4,30),(4,31),(4,32),(4,33),(4,34),(6,1),(6,2),(6,3),(6,4),(6,5),(6,6),(6,7),(6,8),(6,9),(6,10),(6,11),(6,12),(6,13),(6,14),(6,15),(6,16),(6,17),(6,18),(6,19),(6,20),(6,21),(6,22),(6,23),(6,24),(6,25),(6,26),(6,27),(6,28),(6,29),(6,30),(6,31),(6,32),(6,33),(6,34); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_module_currency`; +CREATE TABLE `ps_module_currency` ( + `id_module` int(10) unsigned NOT NULL, + `id_currency` int(11) NOT NULL, + PRIMARY KEY (`id_module`,`id_currency`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_module_currency` WRITE; +INSERT INTO `ps_module_currency` VALUES (3,1),(3,2),(3,3),(4,-2),(6,1),(6,2),(6,3); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_module_group`; +CREATE TABLE `ps_module_group` ( + `id_module` int(10) unsigned NOT NULL, + `id_group` int(11) NOT NULL, + PRIMARY KEY (`id_module`,`id_group`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_module_group` WRITE; +INSERT INTO `ps_module_group` VALUES (3,1),(4,1),(6,1); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_order_detail`; +CREATE TABLE `ps_order_detail` ( + `id_order_detail` int(10) unsigned NOT NULL auto_increment, + `id_order` int(10) unsigned NOT NULL, + `product_id` int(10) unsigned NOT NULL, + `product_attribute_id` int(10) unsigned default NULL, + `product_name` varchar(255) NOT NULL, + `product_quantity` int(10) unsigned NOT NULL default '0', + `product_quantity_in_stock` int(10) unsigned NOT NULL default '0', + `product_quantity_refunded` int(10) unsigned NOT NULL default '0', + `product_quantity_return` int(10) unsigned NOT NULL default '0', + `product_quantity_reinjected` int(10) unsigned NOT NULL default '0', + `product_price` decimal(13,6) NOT NULL default '0.000000', + `product_quantity_discount` decimal(13,6) NOT NULL default '0.000000', + `product_ean13` varchar(13) default NULL, + `product_reference` varchar(32) default NULL, + `product_supplier_reference` varchar(32) default NULL, + `product_weight` float NOT NULL, + `tax_name` varchar(16) NOT NULL, + `tax_rate` decimal(10,2) NOT NULL default '0.00', + `ecotax` decimal(10,2) NOT NULL default '0.00', + `download_hash` varchar(255) default NULL, + `download_nb` int(10) unsigned default '0', + `download_deadline` datetime default '0000-00-00 00:00:00', + PRIMARY KEY (`id_order_detail`), + KEY `order_detail_order` (`id_order`), + KEY `product_id` (`product_id`) +) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_order_detail` WRITE; +INSERT INTO `ps_order_detail` VALUES (1,1,7,23,'iPod touch - Capacite: 32Go',1,0,0,0,0,'392.140500','0.000000',NULL,NULL,NULL,0,'TVA 19.6%','19.60','0.00','',0,'0000-00-00 00:00:00'),(2,1,9,0,'Ecouteurs a isolation sonore Shure SE210',1,0,0,0,0,'124.581900','0.000000',NULL,NULL,NULL,0,'TVA 19.6%','19.60','0.00','',0,'0000-00-00 00:00:00'),(3,2,11,0,'Short',5,5,0,0,0,'12.123746','0.000000','9876543210982','9876short5432',NULL,0,'TVA 19.6%','19.60','0.00','',0,'0000-00-00 00:00:00'),(4,3,10,49,'Maillot de Bain - Couleur : Rouge, Size : L',1,1,0,0,0,'16.722408','0.000000','1234567890128','123mdb321',NULL,0,'TVA 19.6%','19.60','0.00','',0,'0000-00-00 00:00:00'),(5,4,10,43,'Maillot de Bain - Couleur : Bleu, Size : L',1,1,0,0,0,'16.722408','0.000000','1234567890128','123mdb321',NULL,0,'TVA 19.6%','19.60','0.00','',0,'0000-00-00 00:00:00'),(6,4,10,44,'Maillot de Bain - Couleur : Bleu, Size : M',2,2,0,0,0,'16.722408','0.000000','1234567890128','123mdb321',NULL,0,'TVA 19.6%','19.60','0.00','',0,'0000-00-00 00:00:00'),(7,4,10,47,'Maillot de Bain - Couleur : Noir, Size : M',3,3,0,0,0,'16.722408','0.000000','1234567890128','123mdb321',NULL,0,'TVA 19.6%','19.60','0.00','',0,'0000-00-00 00:00:00'),(8,4,10,48,'Maillot de Bain - Couleur : Noir, Size : S',4,4,0,0,0,'16.722408','0.000000','1234567890128','123mdb321',NULL,0,'TVA 19.6%','19.60','0.00','',0,'0000-00-00 00:00:00'),(9,4,10,49,'Maillot de Bain - Couleur : Rouge, Size : L',5,5,0,0,0,'16.722408','0.000000','1234567890128','123mdb321',NULL,0,'TVA 19.6%','19.60','0.00','',0,'0000-00-00 00:00:00'),(10,4,10,50,'Maillot de Bain - Couleur : Rouge, Size : M',6,6,0,0,0,'16.722408','0.000000','1234567890128','123mdb321',NULL,0,'TVA 19.6%','19.60','0.00','',0,'0000-00-00 00:00:00'),(11,4,10,51,'Maillot de Bain - Couleur : Rouge, Size : S',7,7,0,0,0,'16.722408','0.000000','1234567890128','123mdb321',NULL,0,'TVA 19.6%','19.60','0.00','',0,'0000-00-00 00:00:00'),(12,4,11,0,'Short',8,8,0,0,0,'12.123746','0.000000','9876543210982','9876short5432',NULL,0,'TVA 19.6%','19.60','0.00','',0,'0000-00-00 00:00:00'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_order_discount`; +CREATE TABLE `ps_order_discount` ( + `id_order_discount` int(10) unsigned NOT NULL auto_increment, + `id_order` int(10) unsigned NOT NULL, + `id_discount` int(10) unsigned NOT NULL, + `name` varchar(32) NOT NULL, + `value` decimal(10,2) NOT NULL default '0.00', + PRIMARY KEY (`id_order_discount`), + KEY `order_discount_order` (`id_order`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + + +DROP TABLE IF EXISTS `ps_order_history`; +CREATE TABLE `ps_order_history` ( + `id_order_history` int(10) unsigned NOT NULL auto_increment, + `id_employee` int(10) unsigned NOT NULL, + `id_order` int(10) unsigned NOT NULL, + `id_order_state` int(10) unsigned NOT NULL, + `date_add` datetime NOT NULL, + PRIMARY KEY (`id_order_history`), + KEY `order_history_order` (`id_order`) +) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_order_history` WRITE; +INSERT INTO `ps_order_history` VALUES (1,0,1,1,'2009-09-17 09:48:51'),(2,0,2,1,'2009-09-17 10:34:39'),(3,0,3,1,'2009-09-17 10:35:44'),(4,0,4,1,'2009-09-17 10:36:58'),(5,1,2,2,'2009-09-17 10:37:48'),(6,1,2,4,'2009-09-17 10:37:53'),(7,1,3,2,'2009-09-17 10:38:04'),(8,1,3,4,'2009-09-17 10:38:09'),(9,1,4,2,'2009-09-17 10:39:26'),(10,1,4,4,'2009-09-17 10:39:30'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_order_message`; +CREATE TABLE `ps_order_message` ( + `id_order_message` int(10) unsigned NOT NULL auto_increment, + `date_add` datetime NOT NULL, + PRIMARY KEY (`id_order_message`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_order_message` WRITE; +INSERT INTO `ps_order_message` VALUES (1,'2009-09-17 09:48:51'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_order_message_lang`; +CREATE TABLE `ps_order_message_lang` ( + `id_order_message` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(128) NOT NULL, + `message` text NOT NULL, + PRIMARY KEY (`id_order_message`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_order_message_lang` WRITE; +INSERT INTO `ps_order_message_lang` VALUES (1,1,'Delay','Hi,\n\nUnfortunately, an item on your order is currently out of stock. This may cause a slight delay in delivery.\nPlease accept our apologies and rest assured that we are working hard to rectify this.\n\nBest regards,\n'),(1,2,'Delai','Bonjour,\n\nUn des elements de votre commande est actuellement en reapprovisionnement, ce qui peut legerement retarder son envoi.\n\nMerci de votre comprehension.\n\nCordialement, \n'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_order_return`; +CREATE TABLE `ps_order_return` ( + `id_order_return` int(10) unsigned NOT NULL auto_increment, + `id_customer` int(10) unsigned NOT NULL, + `id_order` int(10) unsigned NOT NULL, + `state` tinyint(1) unsigned NOT NULL default '1', + `question` text NOT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_order_return`), + KEY `order_return_customer` (`id_customer`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + + +DROP TABLE IF EXISTS `ps_order_return_detail`; +CREATE TABLE `ps_order_return_detail` ( + `id_order_return` int(10) unsigned NOT NULL, + `id_order_detail` int(10) unsigned NOT NULL, + `id_customization` int(10) NOT NULL default '0', + `product_quantity` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`id_order_return`,`id_order_detail`,`id_customization`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + + +DROP TABLE IF EXISTS `ps_order_return_state`; +CREATE TABLE `ps_order_return_state` ( + `id_order_return_state` int(10) unsigned NOT NULL auto_increment, + `color` varchar(32) default NULL, + PRIMARY KEY (`id_order_return_state`) +) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_order_return_state` WRITE; +INSERT INTO `ps_order_return_state` VALUES (1,'#ADD8E6'),(2,'#EEDDFF'),(3,'#DDFFAA'),(4,'#FFD3D3'),(5,'#FFFFBB'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_order_return_state_lang`; +CREATE TABLE `ps_order_return_state_lang` ( + `id_order_return_state` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(64) NOT NULL, + UNIQUE KEY `order_state_lang_index` (`id_order_return_state`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_order_return_state_lang` WRITE; +INSERT INTO `ps_order_return_state_lang` VALUES (1,1,'Waiting for confirmation'),(2,1,'Waiting for package'),(3,1,'Package received'),(4,1,'Return denied'),(5,1,'Return completed'),(1,2,'En attente de confirmation'),(2,2,'En attente du colis'),(3,2,'Colis recu'),(4,2,'Retour refuse'),(5,2,'Retour termine'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_order_slip`; +CREATE TABLE `ps_order_slip` ( + `id_order_slip` int(10) unsigned NOT NULL auto_increment, + `id_customer` int(10) unsigned NOT NULL, + `id_order` int(10) unsigned NOT NULL, + `shipping_cost` tinyint(3) unsigned NOT NULL default '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_order_slip`), + KEY `order_slip_customer` (`id_customer`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + + +DROP TABLE IF EXISTS `ps_order_slip_detail`; +CREATE TABLE `ps_order_slip_detail` ( + `id_order_slip` int(10) unsigned NOT NULL, + `id_order_detail` int(10) unsigned NOT NULL, + `product_quantity` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`id_order_slip`,`id_order_detail`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + + +DROP TABLE IF EXISTS `ps_order_state`; +CREATE TABLE `ps_order_state` ( + `id_order_state` int(10) unsigned NOT NULL auto_increment, + `invoice` tinyint(1) unsigned default '0', + `send_email` tinyint(1) unsigned NOT NULL default '0', + `color` varchar(32) default NULL, + `unremovable` tinyint(1) unsigned NOT NULL, + `hidden` tinyint(1) unsigned NOT NULL default '0', + `logable` tinyint(1) NOT NULL default '0', + `delivery` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_order_state`) +) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_order_state` WRITE; +INSERT INTO `ps_order_state` VALUES (1,0,1,'lightblue',1,0,0,0),(2,1,1,'#DDEEFF',1,0,1,0),(3,1,1,'#FFDD99',1,0,1,1),(4,1,1,'#EEDDFF',1,0,1,1),(5,1,0,'#DDFFAA',1,0,1,1),(6,1,1,'#DADADA',1,0,0,0),(7,1,1,'#FFFFBB',1,0,0,0),(8,0,1,'#FFDFDF',1,0,0,0),(9,1,1,'#FFD3D3',1,0,0,0),(10,0,1,'lightblue',1,0,0,0),(11,0,0,'lightblue',1,0,0,0); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_order_state_lang`; +CREATE TABLE `ps_order_state_lang` ( + `id_order_state` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(64) NOT NULL, + `template` varchar(64) NOT NULL, + UNIQUE KEY `order_state_lang_index` (`id_order_state`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_order_state_lang` WRITE; +INSERT INTO `ps_order_state_lang` VALUES (1,1,'Awaiting cheque payment','cheque'),(2,1,'Payment accepted','payment'),(3,1,'Preparation in progress','preparation'),(4,1,'Shipped','shipped'),(5,1,'Delivered',''),(6,1,'Canceled','order_canceled'),(7,1,'Refund','refund'),(8,1,'Payment error','payment_error'),(9,1,'Out of stock','outofstock'),(10,1,'Awaiting bank wire payment','bankwire'),(11,1,'Awaiting PayPal payment',''),(1,2,'En attente du paiement par cheque','cheque'),(2,2,'Paiement accepte','payment'),(3,2,'Preparation en cours','preparation'),(4,2,'En cours de livraison','shipped'),(5,2,'Livre',''),(6,2,'Annule','order_canceled'),(7,2,'Rembourse','refund'),(8,2,'Erreur de paiement','payment_error'),(9,2,'Produit(s) indisponibles','outofstock'),(10,2,'En attente du paiement par virement bancaire','bankwire'),(11,2,'En attente du paiement par PayPal',''); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_orders`; +CREATE TABLE `ps_orders` ( + `id_order` int(10) unsigned NOT NULL auto_increment, + `id_carrier` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `id_customer` int(10) unsigned NOT NULL, + `id_cart` int(10) unsigned NOT NULL, + `id_currency` int(10) unsigned NOT NULL, + `id_address_delivery` int(10) unsigned NOT NULL, + `id_address_invoice` int(10) unsigned NOT NULL, + `secure_key` varchar(32) NOT NULL default '-1', + `payment` varchar(255) NOT NULL, + `module` varchar(255) default NULL, + `recyclable` tinyint(1) unsigned NOT NULL default '0', + `gift` tinyint(1) unsigned NOT NULL default '0', + `gift_message` text, + `shipping_number` varchar(32) default NULL, + `total_discounts` decimal(10,2) NOT NULL default '0.00', + `total_paid` decimal(10,2) NOT NULL default '0.00', + `total_paid_real` decimal(10,2) NOT NULL default '0.00', + `total_products` decimal(10,2) NOT NULL default '0.00', + `total_shipping` decimal(10,2) NOT NULL default '0.00', + `total_wrapping` decimal(10,2) NOT NULL default '0.00', + `invoice_number` int(10) unsigned NOT NULL default '0', + `delivery_number` int(10) unsigned NOT NULL default '0', + `invoice_date` datetime NOT NULL, + `delivery_date` datetime NOT NULL, + `valid` int(1) unsigned NOT NULL default '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_order`), + KEY `id_customer` (`id_customer`), + KEY `id_cart` (`id_cart`) +) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_orders` WRITE; +INSERT INTO `ps_orders` VALUES (1,2,2,1,1,1,2,2,'47ce86627c1f3c792a80773c5d2deaf8','Cheque','cheque',1,0,'','','0.00','625.98','625.98','516.72','7.98','0.00',1,0,'2008-09-10 15:30:44','0000-00-00 00:00:00',0,'2009-09-17 09:48:51','2009-09-17 09:48:51'),(2,2,2,1,2,1,2,2,'47ce86627c1f3c792a80773c5d2deaf8','Cheque','cheque',1,0,'','','0.00','80.48','80.48','60.62','7.98','0.00',2,1,'2009-09-17 10:37:48','2009-09-17 10:37:53',1,'2009-09-17 10:34:39','2009-09-17 10:37:53'),(3,2,2,1,3,1,2,2,'47ce86627c1f3c792a80773c5d2deaf8','Cheque','cheque',1,0,'','','0.00','27.98','27.98','16.72','7.98','0.00',3,2,'2009-09-17 10:38:04','2009-09-17 10:38:09',1,'2009-09-17 10:35:44','2009-09-17 10:38:09'),(4,2,2,1,4,1,2,2,'47ce86627c1f3c792a80773c5d2deaf8','Cheque','cheque',1,0,'','','0.00','676.00','676.00','565.22','0.00','0.00',4,3,'2009-09-17 10:39:26','2009-09-17 10:39:30',1,'2009-09-17 10:36:58','2009-09-17 10:39:30'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_pack`; +CREATE TABLE `ps_pack` ( + `id_product_pack` int(10) unsigned NOT NULL, + `id_product_item` int(10) unsigned NOT NULL, + `quantity` int(10) unsigned NOT NULL default '1', + PRIMARY KEY (`id_product_pack`,`id_product_item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + + +DROP TABLE IF EXISTS `ps_product`; +CREATE TABLE `ps_product` ( + `id_product` int(10) unsigned NOT NULL auto_increment, + `id_supplier` int(10) unsigned default NULL, + `id_manufacturer` int(10) unsigned default NULL, + `id_tax` int(10) unsigned NOT NULL, + `id_category_default` int(10) unsigned default NULL, + `id_color_default` int(10) unsigned default NULL, + `on_sale` tinyint(1) unsigned NOT NULL default '0', + `ean13` varchar(13) default NULL, + `ecotax` decimal(10,2) NOT NULL default '0.00', + `quantity` int(10) unsigned NOT NULL default '0', + `price` decimal(13,6) NOT NULL default '0.000000', + `wholesale_price` decimal(13,6) NOT NULL default '0.000000', + `reduction_price` decimal(10,2) default NULL, + `reduction_percent` float default NULL, + `reduction_from` date default NULL, + `reduction_to` date default NULL, + `reference` varchar(32) default NULL, + `supplier_reference` varchar(32) default NULL, + `location` varchar(64) default NULL, + `weight` float NOT NULL default '0', + `out_of_stock` int(10) unsigned NOT NULL default '2', + `quantity_discount` tinyint(1) default '0', + `customizable` tinyint(2) NOT NULL default '0', + `uploadable_files` tinyint(4) NOT NULL default '0', + `text_fields` tinyint(4) NOT NULL default '0', + `active` tinyint(1) unsigned NOT NULL default '0', + `indexed` tinyint(1) NOT NULL default '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_product`), + KEY `product_supplier` (`id_supplier`), + KEY `product_manufacturer` (`id_manufacturer`) +) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_product` WRITE; +INSERT INTO `ps_product` VALUES (1,1,1,1,2,2,0,'0','0.00',800,'124.581940','70.000000','0.00',5,'2009-09-17','2009-09-17','','',NULL,0.5,2,0,0,0,0,1,1,'2009-09-17 09:48:51','2009-09-17 09:48:51'),(2,1,1,1,2,0,0,'0','0.00',100,'66.053500','33.000000','0.00',0,'2009-09-17','2009-09-17','','',NULL,0,2,0,0,0,0,1,1,'2009-09-17 09:48:51','2009-09-17 09:48:51'),(5,1,1,1,4,0,0,'0','0.00',274,'1504.180602','1000.000000','0.00',0,'2009-09-17','2009-09-17','',NULL,NULL,1.36,2,0,0,0,0,1,1,'2009-09-17 09:48:51','2009-09-17 09:48:51'),(6,1,1,1,4,0,0,'0','0.00',250,'1170.568561','0.000000','0.00',0,'2009-09-17','2009-09-17','',NULL,NULL,0.75,2,0,0,0,0,1,1,'2009-09-17 09:48:51','2009-09-17 09:48:51'),(7,0,0,1,2,0,0,'','0.00',180,'241.638796','200.000000','0.00',0,'2009-09-17','2009-09-17','',NULL,NULL,0,2,0,0,0,0,1,1,'2009-09-17 09:48:51','2009-09-17 09:48:51'),(8,0,0,1,3,0,0,'','0.00',1,'25.041806','0.000000','0.00',0,'2009-09-17','2009-09-17','',NULL,NULL,0,2,0,0,0,0,1,1,'2009-09-17 09:48:51','2009-09-17 09:48:51'),(9,2,2,1,3,0,0,'','0.00',1,'124.581940','0.000000','0.00',0,'2009-09-17','2009-09-17','',NULL,NULL,0,2,0,0,0,0,1,1,'2009-09-17 09:48:51','2009-09-17 09:48:51'),(10,0,0,1,1,0,0,'1234567890128','0.00',60,'16.722408','10.000000','0.00',0,'2009-09-17','2009-09-17','123mdb321','','',0,2,0,0,0,0,1,1,'2009-09-17 10:04:08','2009-09-17 10:10:33'),(11,0,0,1,1,0,0,'9876543210982','0.00',87,'12.123746','5.000000','0.00',0,'2009-09-17','2009-09-17','9876short5432','','',0,2,0,0,0,0,1,1,'2009-09-17 10:27:15','2009-09-17 10:32:29'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_product_attachment`; +CREATE TABLE `ps_product_attachment` ( + `id_product` int(10) NOT NULL, + `id_attachment` int(10) NOT NULL, + PRIMARY KEY (`id_product`,`id_attachment`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + + +DROP TABLE IF EXISTS `ps_product_attribute`; +CREATE TABLE `ps_product_attribute` ( + `id_product_attribute` int(10) unsigned NOT NULL auto_increment, + `id_product` int(10) unsigned NOT NULL, + `reference` varchar(32) default NULL, + `supplier_reference` varchar(32) default NULL, + `location` varchar(64) default NULL, + `ean13` varchar(13) default NULL, + `wholesale_price` decimal(13,6) NOT NULL default '0.000000', + `price` decimal(10,2) NOT NULL default '0.00', + `ecotax` decimal(10,2) NOT NULL default '0.00', + `quantity` int(10) unsigned NOT NULL default '0', + `weight` float NOT NULL default '0', + `default_on` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_product_attribute`), + KEY `product_attribute_product` (`id_product`), + KEY `reference` (`reference`), + KEY `supplier_reference` (`supplier_reference`) +) ENGINE=MyISAM AUTO_INCREMENT=52 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_product_attribute` WRITE; +INSERT INTO `ps_product_attribute` VALUES (30,1,'','',NULL,'','0.000000','0.00','0.00',50,0,0),(29,1,'','',NULL,'','0.000000','50.00','0.00',50,0,0),(28,1,'','',NULL,'','0.000000','0.00','0.00',50,0,0),(27,1,'','',NULL,'','0.000000','50.00','0.00',50,0,0),(26,1,'','',NULL,'','0.000000','0.00','0.00',50,0,0),(25,1,'','',NULL,'','0.000000','50.00','0.00',50,0,0),(7,2,'','',NULL,'','0.000000','0.00','0.00',10,0,0),(8,2,'','',NULL,'','0.000000','0.00','0.00',20,0,1),(9,2,'','',NULL,'','0.000000','0.00','0.00',30,0,0),(10,2,'','',NULL,'','0.000000','0.00','0.00',40,0,0),(12,5,'',NULL,NULL,'','0.000000','899.00','0.00',100,0,0),(13,5,'',NULL,NULL,'','0.000000','0.00','0.00',99,0,1),(14,5,'',NULL,NULL,'','0.000000','270.00','0.00',50,0,0),(15,5,'',NULL,NULL,'','0.000000','1169.00','0.00',25,0,0),(23,7,'',NULL,NULL,'','0.000000','180.00','0.00',70,0,0),(22,7,'',NULL,NULL,'','0.000000','90.00','0.00',60,0,0),(19,7,'',NULL,NULL,'','0.000000','0.00','0.00',50,0,1),(31,1,'','',NULL,'','0.000000','50.00','0.00',50,0,1),(32,1,'','',NULL,'','0.000000','0.00','0.00',50,0,0),(33,1,'','',NULL,'','0.000000','50.00','0.00',50,0,0),(34,1,'','',NULL,'','0.000000','0.00','0.00',50,0,0),(35,1,'','',NULL,'','0.000000','50.00','0.00',50,0,0),(36,1,'','',NULL,'','0.000000','0.00','0.00',50,0,0),(39,1,'','',NULL,'','0.000000','50.00','0.00',50,0,0),(40,1,'','',NULL,'','0.000000','0.00','0.00',50,0,0),(41,1,'','',NULL,'','0.000000','50.00','0.00',50,0,0),(42,1,'','',NULL,'','0.000000','0.00','0.00',50,0,0),(43,10,'','','','','0.000000','0.00','0.00',9,0,1),(44,10,'','','','','0.000000','0.00','0.00',18,0,0),(45,10,'','','','','0.000000','0.00','0.00',30,0,0),(46,10,'','','','','0.000000','0.00','0.00',40,0,0),(47,10,'','','','','0.000000','0.00','0.00',47,0,0),(48,10,'','','','','0.000000','0.00','0.00',56,0,0),(49,10,'','','','','0.000000','0.00','0.00',64,0,0),(50,10,'','','','','0.000000','0.00','0.00',74,0,0),(51,10,'','','','','0.000000','0.00','0.00',83,0,0); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_product_attribute_combination`; +CREATE TABLE `ps_product_attribute_combination` ( + `id_attribute` int(10) unsigned NOT NULL, + `id_product_attribute` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_attribute`,`id_product_attribute`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_product_attribute_combination` WRITE; +INSERT INTO `ps_product_attribute_combination` VALUES (3,9),(3,12),(3,13),(3,14),(3,15),(3,29),(3,30),(4,7),(4,25),(4,26),(4,43),(4,44),(4,45),(5,10),(5,35),(5,36),(6,8),(6,39),(6,40),(7,33),(7,34),(8,13),(8,15),(9,12),(9,14),(10,12),(10,13),(11,14),(11,15),(14,31),(14,32),(14,46),(14,47),(14,48),(15,19),(15,26),(15,28),(15,30),(15,32),(15,34),(15,36),(15,40),(15,42),(16,22),(16,25),(16,27),(16,29),(16,31),(16,33),(16,35),(16,39),(16,41),(17,23),(18,41),(18,42),(19,27),(19,28),(20,49),(20,50),(20,51),(21,45),(21,48),(21,51),(22,44),(22,47),(22,50),(23,43),(23,46),(23,49); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_product_attribute_image`; +CREATE TABLE `ps_product_attribute_image` ( + `id_product_attribute` int(10) NOT NULL, + `id_image` int(10) NOT NULL, + PRIMARY KEY (`id_product_attribute`,`id_image`), + KEY `id_image` (`id_image`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_product_attribute_image` WRITE; +INSERT INTO `ps_product_attribute_image` VALUES (7,46),(8,47),(9,49),(10,48),(12,0),(13,0),(14,0),(15,0),(19,0),(22,0),(23,0),(25,38),(26,38),(27,45),(28,45),(29,44),(30,44),(31,37),(32,37),(33,40),(34,40),(35,41),(36,41),(39,39),(40,39),(41,42),(42,42); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_product_download`; +CREATE TABLE `ps_product_download` ( + `id_product_download` int(10) unsigned NOT NULL auto_increment, + `id_product` int(10) unsigned NOT NULL, + `display_filename` varchar(255) default NULL, + `physically_filename` varchar(255) default NULL, + `date_deposit` datetime NOT NULL, + `date_expiration` datetime default NULL, + `nb_days_accessible` int(10) unsigned default NULL, + `nb_downloadable` int(10) unsigned default '1', + `active` tinyint(1) unsigned NOT NULL default '1', + PRIMARY KEY (`id_product_download`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + + +DROP TABLE IF EXISTS `ps_product_lang`; +CREATE TABLE `ps_product_lang` ( + `id_product` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `description` text, + `description_short` text, + `link_rewrite` varchar(128) NOT NULL, + `meta_description` varchar(255) default NULL, + `meta_keywords` varchar(255) default NULL, + `meta_title` varchar(128) default NULL, + `name` varchar(128) NOT NULL, + `available_now` varchar(255) default NULL, + `available_later` varchar(255) default NULL, + UNIQUE KEY `product_lang_index` (`id_product`,`id_lang`), + KEY `id_lang` (`id_lang`), + KEY `name` (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_product_lang` WRITE; +INSERT INTO `ps_product_lang` VALUES (1,1,'<p><strong><span style=\"font-size: small\">Curved ahead of the curve.</span></strong></p>\r\n<p>For those about to rock, we give you nine amazing colors. But that\'s only part of the story. Feel the curved, all-aluminum and glass design and you won\'t want to put iPod nano down.</p>\r\n<p><strong><span style=\"font-size: small\">Great looks. And brains, too.</span></strong></p>\r\n<p>The new Genius feature turns iPod nano into your own highly intelligent, personal DJ. It creates playlists by finding songs in your library that go great together.</p>\r\n<p><strong><span style=\"font-size: small\">Made to move with your moves.</span></strong></p>\r\n<p>The accelerometer comes to iPod nano. Give it a shake to shuffle your music. Turn it sideways to view Cover Flow. And play games designed with your moves in mind.</p>','<p>New design. New features. Now in 8GB and 16GB. iPod nano rocks like never before.</p>','ipod-nano','','','','iPod Nano','In stock',''),(1,2,'<p><span style=\"font-size: small\"><strong>Des courbes avantageuses.</strong></span></p>\r\n<p>Pour les amateurs de sensations, voici neuf nouveaux coloris. Et ce n\'est pas tout ! Faites l\'experience du design elliptique en aluminum et verre. Vous ne voudrez plus le lacher.</p>\r\n<p><strong><span style=\"font-size: small\">Beau et intelligent.</span></strong></p>\r\n<p>La nouvelle fonctionnalite Genius fait d\'iPod nano votre DJ personnel. Genius cree des listes de lecture en recherchant dans votre bibliotheque les chansons qui vont bien ensemble.</p>\r\n<p><strong><span style=\"font-size: small\">Fait pour bouger avec vous.</span></strong></p>\r\n<p>iPod nano est equipe de l\'accelerometre. Secouez-le pour melanger votre musique. Basculez-le pour afficher Cover Flow. Et decouvrez des jeux adaptes a vos mouvements.</p>','<p>Nouveau design. Nouvelles fonctionnalites. Desormais en 8 et 16 Go. iPod nano, plus rock que jamais.</p>','ipod-nano','','','','iPod Nano','En stock',''),(2,1,'<p><span style=\"font-size: small\"><strong>Instant attachment.</strong></span></p>\r\n<p>Wear up to 500 songs on your sleeve. Or your belt. Or your gym shorts. iPod shuffle is a badge of musical devotion. Now in new, more brilliant colors.</p>\r\n<p><span style=\"font-size: small\"><strong>Feed your iPod shuffle.</strong></span></p>\r\n<p>iTunes is your entertainment superstore. It’s your ultra-organized music collection and jukebox. And it’s how you load up your iPod shuffle in one click.</p>\r\n<p><span style=\"font-size: small\"><strong>Beauty and the beat.</strong></span></p>\r\n<p>Intensely colorful anodized aluminum complements the simple design of iPod shuffle. Now in blue, green, pink, red, and original silver.</p>','<p>iPod shuffle, the world’s most wearable music player, now clips on in more vibrant blue, green, pink, and red.</p>','ipod-shuffle','','','','iPod shuffle','In stock',''),(2,2,'<p><span style=\"font-size: small\"><strong>Un lien immediat.</strong></span></p>\r\n<p>Portez jusqu\'a 500 chansons accrochees a votre manche, a votre ceinture ou a votre short. Arborez votre iPod shuffle comme signe exterieur de votre passion pour la musique. Existe desormais en quatre nouveaux coloris encore plus eclatants.</p>\r\n<p><span style=\"font-size: small\"><strong>Emplissez votre iPod shuffle.</strong></span></p>\r\n<p>iTunes est un immense magasin dedie au divertissement, une collection musicale parfaitement organisee et un jukebox. Vous pouvez en un seul clic remplir votre iPod shuffle de chansons.</p>\r\n<p><strong><span style=\"font-size: small\">La musique en technicolor.</span></strong></p>\r\n<p>iPod shuffle s\'affiche desormais dans de nouveaux coloris intenses qui rehaussent le design epure du boitier en aluminium anodise. Choisissez parmi le bleu, le vert, le rose, le rouge et l\'argente d\'origine.</p>','<p>iPod shuffle, le baladeur le plus portable du monde, se clippe maintenant en bleu, vert, rose et rouge.</p>','ipod-shuffle','','','','iPod shuffle','En stock',''),(5,1,'<p>MacBook Air is nearly as thin as your index finger. Practically every detail that could be streamlined has been. Yet it still has a 13.3-inch widescreen LED display, full-size keyboard, and large multi-touch trackpad. It’s incomparably portable without the usual ultraportable screen and keyboard compromises.</p><p>The incredible thinness of MacBook Air is the result of numerous size- and weight-shaving innovations. From a slimmer hard drive to strategically hidden I/O ports to a lower-profile battery, everything has been considered and reconsidered with thinness in mind.</p><p>MacBook Air is designed and engineered to take full advantage of the wireless world. A world in which 802.11n Wi-Fi is now so fast and so available, people are truly living untethered — buying and renting movies online, downloading software, and sharing and storing files on the web. </p>','MacBook Air is ultrathin, ultraportable, and ultra unlike anything else. But you don’t lose inches and pounds overnight. It’s the result of rethinking conventions. Of multiple wireless innovations. And of breakthrough design. With MacBook Air, mobile computing suddenly has a new standard.','macbook-air','','','','MacBook Air','',NULL),(5,2,'<p>MacBook Air est presque aussi fin que votre index. Pratiquement tout ce qui pouvait etre simplifie l\'a ete. Il n\'en dispose pas moins d\'un ecran panoramique de 13,3 pouces, d\'un clavier complet et d\'un vaste trackpad multi-touch. Incomparablement portable il vous evite les compromis habituels en matiere d\'ecran et de clavier ultra-portables.</p><p>L\'incroyable finesse de MacBook Air est le resultat d\'un grand nombre d\'innovations en termes de reduction de la taille et du poids. D\'un disque dur plus fin a des ports d\'E/S habilement dissimules en passant par une batterie plus plate, chaque detail a ete considere et reconsidere avec la finesse a l\'esprit.</p><p>MacBook Air a ete concu et elabore pour profiter pleinement du monde sans fil. Un monde dans lequel la norme Wi-Fi 802.11n est desormais si rapide et si accessible qu\'elle permet veritablement de se liberer de toute attache pour acheter des videos en ligne, telecharger des logiceeeeiels, stocker et partager des fichiers sur le Web. </p>','MacBook Air est ultra fin, ultra portable et ultra different de tout le reste. Mais on ne perd pas des kilos et des centimetres en une nuit. C\'est le resultat d\'une reinvention des normes. D\'une multitude d\'innovations sans fil. Et d\'une revolution dans le design. Avec MacBook Air, l\'informatique mobile prend soudain une nouvelle dimension.','macbook-air','','','','MacBook Air','',NULL),(6,1,'Every MacBook has a larger hard drive, up to 250GB, to store growing media collections and valuable data.<br /><br />The 2.4GHz MacBook models now include 2GB of memory standard — perfect for running more of your favorite applications smoothly.','MacBook makes it easy to hit the road thanks to its tough polycarbonate case, built-in wireless technologies, and innovative MagSafe Power Adapter that releases automatically if someone accidentally trips on the cord.','macbook','','','','MacBook','',NULL),(6,2,'Chaque MacBook est equipe d\'un disque dur plus spacieux, d\'une capacite atteignant 250 Go, pour stocker vos collections multimedia en expansion et vos donnees precieuses.<br /><br />Le modele MacBook a 2,4 GHz integre desormais 2 Go de memoire en standard. L\'ideal pour executer en souplesse vos applications preferees.','MacBook vous offre la liberte de mouvement grace a son boitier resistant en polycarbonate, a ses technologies sans fil integrees et a son adaptateur secteur MagSafe novateur qui se deconnecte automatiquement si quelqu\'un se prend les pieds dans le fil.','macbook','','','','MacBook','',NULL),(7,1,'<h3>Five new hands-on applications</h3>\r\n<p>View rich HTML email with photos as well as PDF, Word, and Excel attachments. Get maps, directions, and real-time traffic information. Take notes and read stock and weather reports.</p>\r\n<h3>Touch your music, movies, and more</h3>\r\n<p>The revolutionary Multi-Touch technology built into the gorgeous 3.5-inch display lets you pinch, zoom, scroll, and flick with your fingers.</p>\r\n<h3>Internet in your pocket</h3>\r\n<p>With the Safari web browser, see websites the way they were designed to be seen and zoom in and out with a tap.<sup>2</sup> And add Web Clips to your Home screen for quick access to favorite sites.</p>\r\n<h3>What\'s in the box</h3>\r\n<ul>\r\n<li><span></span>iPod touch</li>\r\n<li><span></span>Earphones</li>\r\n<li><span></span>USB 2.0 cable</li>\r\n<li><span></span>Dock adapter</li>\r\n<li><span></span>Polishing cloth</li>\r\n<li><span></span>Stand</li>\r\n<li><span></span>Quick Start guide</li>\r\n</ul>','<ul>\r\n<li>Revolutionary Multi-Touch interface</li>\r\n<li>3.5-inch widescreen color display</li>\r\n<li>Wi-Fi (802.11b/g)</li>\r\n<li>8 mm thin</li>\r\n<li>Safari, YouTube, Mail, Stocks, Weather, Notes, iTunes Wi-Fi Music Store, Maps</li>\r\n</ul>','ipod-touch','','','','iPod touch','',NULL),(7,2,'<h1>Titre 1</h1>\r\n<h2>Titre 2</h2>\r\n<h3>Titre 3</h3>\r\n<h4>Titre 4</h4>\r\n<h5>Titre 5</h5>\r\n<h6>Titre 6</h6>\r\n<ul>\r\n<li>UL</li>\r\n<li>UL</li>\r\n<li>UL</li>\r\n<li>UL</li>\r\n</ul>\r\n<ol>\r\n<li>OL</li>\r\n<li>OL</li>\r\n<li>OL</li>\r\n<li>OL</li>\r\n</ol>\r\n<p>paragraphe...</p>\r\n<p>paragraphe...</p>\r\n<p>paragraphe...</p>\r\n<table border=\"0\">\r\n<thead> \r\n<tr>\r\n<th>th</th> <th>th</th> <th>th</th>\r\n</tr>\r\n</thead> \r\n<tbody>\r\n<tr>\r\n<td>td</td>\r\n<td>td</td>\r\n<td>td</td>\r\n</tr>\r\n<tr>\r\n<td>td</td>\r\n<td>td</td>\r\n<td>td</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n<h3>Cinq nouvelles applications sous la main</h3>\r\n<p>Consultez vos e-mails au format HTML enrichi, avec photos et pieces jointes au format PDF, Word et Excel. Obtenez des cartes, des itineraires et des informations sur l\'etat de la circulation en temps reel. Redigez des notes et consultez les cours de la Bourse et les bulletins meteo.</p>\r\n<h3>Touchez du doigt votre musique et vos videos. Entre autres.</h3>\r\n<p>La technologie multi-touch revolutionnaire integree au superbe ecran de 3,5 pouces vous permet d\'effectuer des zooms avant et arriere, de faire defiler et de feuilleter des pages a l\'aide de vos seuls doigts.</p>\r\n<h3>Internet dans votre poche</h3>\r\n<p>Avec le navigateur Safari, vous pouvez consulter des sites web dans leur mise en page d\'origine et effectuer un zoom avant et arriere d\'une simple pression sur l\'ecran.</p>\r\n<h3>Contenu du coffret</h3>\r\n<ul>\r\n<li><span></span>iPod touch</li>\r\n<li><span></span>Ecouteurs</li>\r\n<li><span></span>Cable USB 2.0</li>\r\n<li><span></span>Adaptateur Dock</li>\r\n<li><span></span>Chiffon de nettoyage</li>\r\n<li><span></span>Support</li>\r\n<li><span></span>Guide de demarrage rapide</li>\r\n</ul>\r\n<p> </p>','<p>Interface multi-touch revolutionnaire<br />Ecran panoramique couleur de 3,5 pouces<br />Wi-Fi (802.11b/g)<br />8 mm d\'epaisseur<br />Safari, YouTube, iTunes Wi-Fi Music Store, Courrier, Cartes, Bourse, Meteo, Notes</p>','ipod-touch','','','','iPod touch','En stock',NULL),(8,1,'<p>Lorem ipsum</p>','<p>Lorem ipsum</p>','housse-portefeuille-en-cuir-belkin-pour-ipod-nano-noir-chocolat','','','','Housse portefeuille en cuir Belkin pour iPod nano - Noir/Chocolat','',NULL),(8,2,'<p><strong>Caracteristiques</strong></p>\r\n<li>Cuir doux resistant<br /> </li>\r\n<li>Acces au bouton Hold<br /> </li>\r\n<li>Fermeture magnetique<br /> </li>\r\n<li>Acces au Dock Connector<br /> </li>\r\n<li>Protege-ecran</li>','<p>Cet etui en cuir tendance assure une protection complete contre les eraflures et les petits aleas de la vie quotidienne. Sa conception elegante et compacte vous permet de glisser votre iPod directement dans votre poche ou votre sac a main.</p>','housse-portefeuille-en-cuir-ipod-nano-noir-chocolat','','','','Housse portefeuille en cuir (iPod nano) - Noir/Chocolat','',NULL),(9,1,'<div class=\"product-overview-full\">Using Hi-Definition MicroSpeakers to deliver full-range audio, the ergonomic and lightweight design of the SE210 earphones is ideal for premium on-the-go listening on your iPod or iPhone. They offer the most accurate audio reproduction from both portable and home stereo audio sources--for the ultimate in precision highs and rich low end. In addition, the flexible design allows you to choose the most comfortable fit from a variety of wearing positions. <br /> <br /> <strong>Features </strong> <br /> \r\n<ul>\r\n<li>Sound-isolating design </li>\r\n<li> Hi-Definition MicroSpeaker with a single balanced armature driver </li>\r\n<li> Detachable, modular cable so you can make the cable longer or shorter depending on your activity </li>\r\n<li> Connector compatible with earphone ports on both iPod and iPhone </li>\r\n</ul>\r\n<strong>Specifications </strong><br /> \r\n<ul>\r\n<li>Speaker type: Hi-Definition MicroSpeaker </li>\r\n<li> Frequency range: 25Hz-18.5kHz </li>\r\n<li> Impedance (1kHz): 26 Ohms </li>\r\n<li> Sensitivity (1mW): 114 dB SPL/mW </li>\r\n<li> Cable length (with extension): 18.0 in./45.0 cm (54.0 in./137.1 cm) </li>\r\n</ul>\r\n<strong>In the box</strong><br /> \r\n<ul>\r\n<li>Shure SE210 earphones </li>\r\n<li> Extension cable (36.0 in./91.4 cm) </li>\r\n<li> Three pairs foam earpiece sleeves (small, medium, large) </li>\r\n<li> Three pairs soft flex earpiece sleeves (small, medium, large) </li>\r\n<li> One pair triple-flange earpiece sleeves </li>\r\n<li> Carrying case </li>\r\n</ul>\r\nWarranty<br /> Two-year limited <br />(For details, please visit <br />www.shure.com/PersonalAudio/CustomerSupport/ProductReturnsAndWarranty/index.htm.) <br /><br /> Mfr. Part No.: SE210-A-EFS <br /><br />Note: Products sold through this website that do not bear the Apple Brand name are serviced and supported exclusively by their manufacturers in accordance with terms and conditions packaged with the products. Apple\'s Limited Warranty does not apply to products that are not Apple-branded, even if packaged or sold with Apple products. Please contact the manufacturer directly for technical support and customer service.</div>','<p>Evolved from personal monitor technology road-tested by pro musicians and perfected by Shure engineers, the lightweight and stylish SE210 delivers full-range audio that\'s free from outside noise.</p>','ecouteurs-a-isolation-sonore-shure-se210-blanc','','','','Shure SE210 Sound-Isolating Earphones for iPod and iPhone','',NULL),(9,2,'<p>Bases sur la technologie des moniteurs personnels testee sur la route par des musiciens professionnels et perfectionnee par les ingenieurs Shure, les ecouteurs SE210, legers et elegants, fournissent une sortie audio a gamme etendue exempte de tout bruit externe.</p>\r\n<p><img src=\"http://store.apple.com/Catalog/fr/Images/TM255_screen1.jpg\" border=\"0\" /></p>\r\n<p><strong>Conception a isolation sonore <br /></strong>Les embouts a isolation sonore fournis bloquent plus de 90 % du bruit ambiant. Combines a un design ergonomique seduisant et un cable modulaire, ils minimisent les intrusions du monde exterieur, vous permettant de vous concentrer sur votre musique. Concus pour les amoureux de la musique qui souhaitent faire evoluer leur appareil audio portable, les ecouteurs SE210 vous permettent d\'emmener la performance avec vous. <br /> <br /><strong>Micro-transducteur haute definition <br /></strong>Developpes pour une ecoute de qualite superieure en deplacement, les ecouteurs SE210 utilisent un seul transducteur a armature equilibree pour beneficier d\'une gamme audio etendue. Le resultat ? Un confort d\'ecoute epoustouflant qui restitue tous les details d\'un spectacle live.</p>\r\n<p><strong>Le kit universel Deluxe comprend les elements suivants : <br /></strong>- <strong><em>Embouts a isolation sonore</em></strong> <br />Les embouts a isolation sonore inclus ont un double role : bloquer les bruits ambiants et garantir un maintien et un confort personnalises. Comme chaque oreille est differente, le kit universel Deluxe comprend trois tailles (S, M, L) d\'embouts mousse et flexibles. Choisissez la taille et le style d\'embout qui vous conviennent le mieux : une bonne etancheite est un facteur cle pour optimiser l\'isolation sonore et la reponse des basses, ainsi que pour accroitre le confort en ecoute prolongee.<br /><br />- <em><strong>Cable modulaire</strong></em> <br />En se basant sur les commentaires de nombreux utilisateurs, les ingenieurs de Shure ont developpe une solution de cable detachable pour permettre un degre de personnalisation sans precedent. Le cable de 1 metre fourni vous permet d\'adapter votre confort en fonction de l\'activite et de l\'application.<br /> <br />- <em><strong>Etui de transport</strong></em> <br />Outre les embouts a isolation sonore et le cable modulaire, un etui de transport compact et resistant est fourni avec les ecouteurs SE210 pour vous permettre de ranger vos ecouteurs de maniere pratique et sans encombres.<br /> <br />- <strong><em>Garantie limitee de deux ans <br /></em></strong>Chaque solution SE210 achetee est couverte par une garantie pieces et main-d\'Å“uvre de deux ans.<br /><br /><strong>Caracteristiques techniques</strong></p>\r\n<ul>\r\n<li> Type de transducteur : micro-transducteur haute definition<br /></li>\r\n<li> Sensibilite (1 mW) : pression acoustique de 114 dB/mW<br /></li>\r\n<li> Impedance (a 1 kHz) : 26 W<br /></li>\r\n<li> Gamme de frequences : 25 Hz – 18,5 kHz<br /></li>\r\n<li> Longueur de cable / avec rallonge : 45 cm / 136 cm<br /></li>\r\n</ul>\r\n<p><strong>Contenu du coffret<br /></strong></p>\r\n<ul>\r\n<li> Ecouteurs Shure SE210<br /></li>\r\n<li> Kit universel Deluxe (embouts a isolation sonore, cable modulaire, etui de transport)</li>\r\n</ul>','<p>Les ecouteurs a isolation sonore ergonomiques et legers offrent la reproduction audio la plus fidele en provenance de sources audio stereo portables ou de salon.</p>','ecouteurs-a-isolation-sonore-shure-se210','','','','Ecouteurs a isolation sonore Shure SE210','',NULL),(10,1,'','','maillot-de-bain','','','','Maillot de Bain','',''),(10,2,'','','maillot-de-bain','','','','Maillot de Bain','',''),(11,1,'','','short','','','','Short','',''),(11,2,'','','short','','','','Short','',''); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_product_sale`; +CREATE TABLE `ps_product_sale` ( + `id_product` int(10) unsigned NOT NULL, + `quantity` int(10) unsigned NOT NULL default '0', + `sale_nbr` int(10) unsigned NOT NULL default '0', + `date_upd` date NOT NULL, + PRIMARY KEY (`id_product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_product_sale` WRITE; +INSERT INTO `ps_product_sale` VALUES (11,13,2,'2009-09-17'),(10,29,8,'2009-09-17'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_product_tag`; +CREATE TABLE `ps_product_tag` ( + `id_product` int(10) unsigned NOT NULL, + `id_tag` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_product`,`id_tag`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_product_tag` WRITE; +INSERT INTO `ps_product_tag` VALUES (1,2),(1,6),(1,7),(1,8),(2,6),(2,18),(5,8),(5,19),(5,20),(5,21),(6,5),(6,22),(7,23),(7,24),(9,25),(9,26),(9,27); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_state`; +CREATE TABLE `ps_state` ( + `id_state` int(10) unsigned NOT NULL auto_increment, + `id_country` int(11) NOT NULL, + `id_zone` int(11) NOT NULL, + `name` varchar(64) NOT NULL, + `iso_code` char(4) NOT NULL, + `tax_behavior` smallint(1) NOT NULL default '0', + `active` tinyint(1) NOT NULL default '0', + PRIMARY KEY (`id_state`) +) ENGINE=MyISAM AUTO_INCREMENT=53 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_state` WRITE; +INSERT INTO `ps_state` VALUES (1,21,2,'Alabama','AL',0,1),(2,21,2,'Alaska','AK',0,1),(3,21,2,'Arizona','AZ',0,1),(4,21,2,'Arkansas','AR',0,1),(5,21,2,'California','CA',0,1),(6,21,2,'Colorado','CO',0,1),(7,21,2,'Connecticut','CT',0,1),(8,21,2,'Delaware','DE',0,1),(9,21,2,'Florida','FL',0,1),(10,21,2,'Georgia','GA',0,1),(11,21,2,'Hawaii','HI',0,1),(12,21,2,'Idaho','ID',0,1),(13,21,2,'Illinois','IL',0,1),(14,21,2,'Indiana','IN',0,1),(15,21,2,'Iowa','IA',0,1),(16,21,2,'Kansas','KS',0,1),(17,21,2,'Kentucky','KY',0,1),(18,21,2,'Louisiana','LA',0,1),(19,21,2,'Maine','ME',0,1),(20,21,2,'Maryland','MD',0,1),(21,21,2,'Massachusetts','MA',0,1),(22,21,2,'Michigan','MI',0,1),(23,21,2,'Minnesota','MN',0,1),(24,21,2,'Mississippi','MS',0,1),(25,21,2,'Missouri','MO',0,1),(26,21,2,'Montana','MT',0,1),(27,21,2,'Nebraska','NE',0,1),(28,21,2,'Nevada','NV',0,1),(29,21,2,'New Hampshire','NH',0,1),(30,21,2,'New Jersey','NJ',0,1),(31,21,2,'New Mexico','NM',0,1),(32,21,2,'New York','NY',0,1),(33,21,2,'North Carolina','NC',0,1),(34,21,2,'North Dakota','ND',0,1),(35,21,2,'Ohio','OH',0,1),(36,21,2,'Oklahoma','OK',0,1),(37,21,2,'Oregon','OR',0,1),(38,21,2,'Pennsylvania','PA',0,1),(39,21,2,'Rhode Island','RI',0,1),(40,21,2,'South Carolina','SC',0,1),(41,21,2,'South Dakota','SD',0,1),(42,21,2,'Tennessee','TN',0,1),(43,21,2,'Texas','TX',0,1),(44,21,2,'Utah','UT',0,1),(45,21,2,'Vermont','VT',0,1),(46,21,2,'Virginia','VA',0,1),(47,21,2,'Washington','WA',0,1),(48,21,2,'West Virginia','WV',0,1),(49,21,2,'Wisconsin','WI',0,1),(50,21,2,'Wyoming','WY',0,1),(51,21,2,'Puerto Rico','PR',0,1),(52,21,2,'US Virgin Islands','VI',0,1); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_supplier`; +CREATE TABLE `ps_supplier` ( + `id_supplier` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) NOT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_supplier`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_supplier` WRITE; +INSERT INTO `ps_supplier` VALUES (1,'AppleStore','2009-09-17 09:48:51','2009-09-17 09:48:51'),(2,'Shure Online Store','2009-09-17 09:48:51','2009-09-17 09:48:51'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_supplier_lang`; +CREATE TABLE `ps_supplier_lang` ( + `id_supplier` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `description` text, + `meta_title` varchar(254) default NULL, + `meta_keywords` varchar(254) default NULL, + `meta_description` varchar(254) default NULL, + PRIMARY KEY (`id_supplier`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + + +DROP TABLE IF EXISTS `ps_tag`; +CREATE TABLE `ps_tag` ( + `id_tag` int(10) unsigned NOT NULL auto_increment, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(32) NOT NULL, + PRIMARY KEY (`id_tag`), + KEY `tag_name` (`name`) +) ENGINE=MyISAM AUTO_INCREMENT=28 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_tag` WRITE; +INSERT INTO `ps_tag` VALUES (5,1,'apple'),(6,2,'ipod'),(7,2,'nano'),(8,2,'apple'),(18,2,'shuffle'),(19,2,'macbook'),(20,2,'macbookair'),(21,2,'air'),(22,1,'superdrive'),(27,2,'marche'),(26,2,'casque'),(25,2,'ecouteurs'),(24,2,'ipod touch tacticle'),(23,1,'Ipod touch'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_tax`; +CREATE TABLE `ps_tax` ( + `id_tax` int(10) unsigned NOT NULL auto_increment, + `rate` float NOT NULL, + PRIMARY KEY (`id_tax`) +) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_tax` WRITE; +INSERT INTO `ps_tax` VALUES (1,19.6),(2,5.5),(3,17.5); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_tax_lang`; +CREATE TABLE `ps_tax_lang` ( + `id_tax` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(32) NOT NULL, + UNIQUE KEY `tax_lang_index` (`id_tax`,`id_lang`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_tax_lang` WRITE; +INSERT INTO `ps_tax_lang` VALUES (1,1,'VAT 19.6%'),(1,2,'TVA 19.6%'),(2,1,'VAT 5.5%'),(2,2,'TVA 5.5%'),(3,1,'VAT 17.5%'),(3,2,'TVA UK 17.5%'); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_tax_state`; +CREATE TABLE `ps_tax_state` ( + `id_tax` int(10) unsigned NOT NULL, + `id_state` int(10) unsigned NOT NULL, + KEY `tax_state_index` (`id_tax`,`id_state`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + + +DROP TABLE IF EXISTS `ps_tax_zone`; +CREATE TABLE `ps_tax_zone` ( + `id_tax` int(10) unsigned NOT NULL, + `id_zone` int(10) unsigned NOT NULL, + KEY `tax_zone_index` (`id_tax`,`id_zone`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_tax_zone` WRITE; +INSERT INTO `ps_tax_zone` VALUES (1,1),(2,1); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `ps_zone`; +CREATE TABLE `ps_zone` ( + `id_zone` int(10) unsigned NOT NULL auto_increment, + `name` varchar(64) NOT NULL, + `active` tinyint(1) unsigned NOT NULL default '0', + `enabled` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id_zone`) +) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; + +LOCK TABLES `ps_zone` WRITE; +INSERT INTO `ps_zone` VALUES (1,'Europe',1,1),(2,'US',1,1),(3,'Asia',1,1),(4,'Africa',1,1),(5,'Oceania',1,1); +UNLOCK TABLES; + diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_04_accounting.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_04_accounting.sql new file mode 100644 index 0000000000000000000000000000000000000000..1823808bd1b6c321897cc0509522ba306a5d245f --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_04_accounting.sql @@ -0,0 +1,20 @@ +/* Drop table if exists */ +DROP TABLE IF EXISTS `NOMACTX`; + +/* Create the NOMACTX table */ +CREATE TABLE `NOMACTX` ( + `account_code` int(20) DEFAULT NULL, + `account_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `transaction_reference` int(20) DEFAULT NULL, + `journal_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `date` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `third_party` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `comment1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `comment2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `tax_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `debit` float DEFAULT NULL, + `credit` float DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +INSERT INTO `NOMACTX` VALUES (1100, 'Debtors Control Account', 1812, 'SR', '2009-01-06', 'OrgaNisma', '', 'Sales Receipt', 'Tax9', 0.0, 16892.2),(1100, 'Debtors Control Account', 2298, 'SI', '2009-01-05', 'NorgA', '25', 'Nov Outlay', 'Tax6', 741213.0, 0.0),(1100, 'Debtors Control Account', 2778, 'SA', '2009-03-11', 'NorgA', '', 'Payment on Account', 'Tax9', 0.0, 610204.0),(1100, 'Debtors Control Account', 4397, 'SC', '2009-06-17', 'NorgA', '47-1', 'Reverse Invoice 43', 'Tax6', 0.0, 477746.0),(1200, 'Bank Current Account', 1717, 'PP', '2009-01-02', 'MobileOrg', 'DD', 'Purchase Payment', 'Tax9', 0.0, 471.37),(1200, 'Bank Current Account', 1780, 'BP', '2009-01-05', 1200, 'DD', 'Lease # 01234', 'Tax6', 0.0,618.65),(1200, 'Bank Current Account', 1781, 'PA', '2009-01-06', 'Comporg', 'iBB', 'Payment on Account', 'Tax9', 0.0, 4070.25),(1200, 'Bank Current Account', 1812, 'SR', '2009-01-06', 'OrgaNisma', '', 'Sales Receipt', 'Tax9', 16892.2, 0.0),(1200, 'Bank Current Account', 2778, 'SA', '2009-03-11', 'NorgA', '', 'Payment on Account', 'Tax9', 610204.0, 0.0),(1200, 'Bank Current Account', 3049, 'BR', '2009-03-31', 1200, '518785', 'Return of goods to Elara', 'Tax6', 29.16, 0.0),(1230, 'Petty Cash', '2041', 'JC', '2009-01-02', 1230, 'Transporters', 'Error in posting payments', 'Tax9', 0.0, 58.38),(1231, 'Cash Advance - Quatre four', 2352, 'CP', '2009-02-16', 1231, 'Cash', 'Quatre four - Weekcomm 16/02/09', 'Tax0', 0.0, 896.0),(1240, 'Company Credit Card', 2036, 'JD', '2009-01-09', 1240, 'Transporters', 'Bank Transfer', 'Tax9', 463.87, 0.0),(1240, 'Company Credit Card', 2454, 'VP', '2009-01-19', 1240, 'COrg', 'Sat Nav and Motor Oil etc for Corg', 'Tax0', 0.0, 220.18),(2100, 'Creditors Control Account', 1690, 'PI', '2009-01-02', 'Telecom Supplier', '6', 'Calls to 31/12/08', 'Tax6', 0.0, 20.64),(2100, 'Creditors Control Account', 1717, 'PP', '2009-01-02', 'MobileOrg', 'DD', 'Purchase Payment', 'Tax9', 471.37, 0.0),(2100, 'Creditors Control Account', 1781, 'PA', '2009-01-06', 'Comporg', 'iBB', 'Payment on Account', 'Tax9', 4070.25, 0.0),(2100, 'Creditors Control Account', 2403, 'PC', '2009-02-27', 'MyCompTELEPE', '697', 'Against Oct Invoice 521069', 'Tax5', 20000.0, 0.0),(2200, 'Sales Tax Control Account', 2298, 'SI', '2009-01-05', 'NorgA', '25', 'Nov Outlay', 'Tax6', 0.0, 131161.0),(2200, 'Sales Tax Control Account', 3049, 'BR', '2009-03-31', 1200, '518785', 'Return of goods to Elara', 'Tax6', 0.0, 5.16),(2200, 'Sales Tax Control Account', 4397, 'SC', '2009-06-17', 'NorgA', '47-1', 'Reverse Invoice 43', 'Tax6', 84539.5, 0.0),(2201, 'Purchase Tax Control Account', 1690, 'PI', '2009-01-02', 'Telecom Supplier', '6', 'Calls to 31/12/08', 'Tax6', 3.65, 0.0),(2201, 'Purchase Tax Control Account', 1780, 'BP', '2009-01-05', 1200, 'DD', 'Lease # 01234', 'Tax6', 109.47, 0.0),(4004, 'Change request construction services', 4397, 'SC', '2009-06-17', 'NorgA', '47-1', 'Reverse Invoice 43', 'Tax6', 393207.0, 0.0),(5000, 'Purchases', 2298, 'SI', '2009-01-05', 'NorgA', '25', 'Nov Outlay', 'Tax6', 0.0, 610052.0),(5006, 'Contact Centre Services - MM Teleperformance', 2403, 'PC', '2009-02-27', 'MyCompTELEPE', '697', 'Against Oct Invoice 521069', 'Tax5', 0.0, 20000.0),(7301, 'Repairs and Servicing', 3049, 'BR', '2009-03-31', 1200, '518785', 'Return of goods to Elara', 'Tax6', 0.0, 24.0),(7304, 'Miscellaneous Motor Expenses', 1780, 'BP', '2009-01-05', 1200, 'DD', 'Lease # 01234', 'Tax6', 509.18, 0.0),(7304, 'Miscellaneous Motor Expenses', 2454, 'VP', '2009-01-19', 1240, 'Corg', 'Sat Nav and Motor Oil etc for Corg', 'Tax0', 220.18, 0.0),(7400, 'Travelling', 2352, 'CP', '2009-02-16', 1231, 'Cash', 'Quatre four - Weekcomm 16/02/09', 'Tax0', 896.0, 0.0),(7502, 'Telephone', 1690, 'PI', '2009-01-02', 'Telecom Supplier', '6', 'Calls to 31/12/08', 'Tax6', 16.99, 0.0); + diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_99_drop_tables.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_99_drop_tables.sql new file mode 100644 index 0000000000000000000000000000000000000000..d8a5ee4286153fbb4a49d18c6a16db34257f27fc --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_99_drop_tables.sql @@ -0,0 +1,136 @@ +DROP TABLE IF EXISTS `ps_access`; +DROP TABLE IF EXISTS `ps_accessory`; +DROP TABLE IF EXISTS `ps_address`; +DROP TABLE IF EXISTS `ps_alias`; +DROP TABLE IF EXISTS `ps_attachment`; +DROP TABLE IF EXISTS `ps_attachment_lang`; +DROP TABLE IF EXISTS `ps_attribute`; +DROP TABLE IF EXISTS `ps_attribute_group`; +DROP TABLE IF EXISTS `ps_attribute_group_lang`; +DROP TABLE IF EXISTS `ps_attribute_lang`; +DROP TABLE IF EXISTS `ps_block_cms`; +DROP TABLE IF EXISTS `ps_blocklink`; +DROP TABLE IF EXISTS `ps_blocklink_lang`; +DROP TABLE IF EXISTS `ps_carrier`; +DROP TABLE IF EXISTS `ps_carrier_lang`; +DROP TABLE IF EXISTS `ps_carrier_zone`; +DROP TABLE IF EXISTS `ps_cart`; +DROP TABLE IF EXISTS `ps_cart_discount`; +DROP TABLE IF EXISTS `ps_cart_product`; +DROP TABLE IF EXISTS `ps_category`; +DROP TABLE IF EXISTS `ps_category_group`; +DROP TABLE IF EXISTS `ps_category_lang`; +DROP TABLE IF EXISTS `ps_category_product`; +DROP TABLE IF EXISTS `ps_cms`; +DROP TABLE IF EXISTS `ps_cms_lang`; +DROP TABLE IF EXISTS `ps_configuration`; +DROP TABLE IF EXISTS `ps_configuration_lang`; +DROP TABLE IF EXISTS `ps_connections`; +DROP TABLE IF EXISTS `ps_connections_page`; +DROP TABLE IF EXISTS `ps_connections_source`; +DROP TABLE IF EXISTS `ps_contact`; +DROP TABLE IF EXISTS `ps_contact_lang`; +DROP TABLE IF EXISTS `ps_country`; +DROP TABLE IF EXISTS `ps_country_lang`; +DROP TABLE IF EXISTS `ps_currency`; +DROP TABLE IF EXISTS `ps_customer`; +DROP TABLE IF EXISTS `ps_customer_group`; +DROP TABLE IF EXISTS `ps_customization`; +DROP TABLE IF EXISTS `ps_customization_field`; +DROP TABLE IF EXISTS `ps_customization_field_lang`; +DROP TABLE IF EXISTS `ps_customized_data`; +DROP TABLE IF EXISTS `ps_date_range`; +DROP TABLE IF EXISTS `ps_delivery`; +DROP TABLE IF EXISTS `ps_discount`; +DROP TABLE IF EXISTS `ps_discount_category`; +DROP TABLE IF EXISTS `ps_discount_lang`; +DROP TABLE IF EXISTS `ps_discount_quantity`; +DROP TABLE IF EXISTS `ps_discount_type`; +DROP TABLE IF EXISTS `ps_discount_type_lang`; +DROP TABLE IF EXISTS `ps_employee`; +DROP TABLE IF EXISTS `ps_feature`; +DROP TABLE IF EXISTS `ps_feature_lang`; +DROP TABLE IF EXISTS `ps_feature_product`; +DROP TABLE IF EXISTS `ps_feature_value`; +DROP TABLE IF EXISTS `ps_feature_value_lang`; +DROP TABLE IF EXISTS `ps_group`; +DROP TABLE IF EXISTS `ps_group_lang`; +DROP TABLE IF EXISTS `ps_guest`; +DROP TABLE IF EXISTS `ps_hook`; +DROP TABLE IF EXISTS `ps_hook_module`; +DROP TABLE IF EXISTS `ps_hook_module_exceptions`; +DROP TABLE IF EXISTS `ps_image`; +DROP TABLE IF EXISTS `ps_image_lang`; +DROP TABLE IF EXISTS `ps_image_type`; +DROP TABLE IF EXISTS `ps_lang`; +DROP TABLE IF EXISTS `ps_manufacturer`; +DROP TABLE IF EXISTS `ps_manufacturer_lang`; +DROP TABLE IF EXISTS `ps_message`; +DROP TABLE IF EXISTS `ps_message_readed`; +DROP TABLE IF EXISTS `ps_meta`; +DROP TABLE IF EXISTS `ps_meta_lang`; +DROP TABLE IF EXISTS `ps_module`; +DROP TABLE IF EXISTS `ps_module_country`; +DROP TABLE IF EXISTS `ps_module_currency`; +DROP TABLE IF EXISTS `ps_module_group`; +DROP TABLE IF EXISTS `ps_operating_system`; +DROP TABLE IF EXISTS `ps_order_detail`; +DROP TABLE IF EXISTS `ps_order_discount`; +DROP TABLE IF EXISTS `ps_order_history`; +DROP TABLE IF EXISTS `ps_order_message`; +DROP TABLE IF EXISTS `ps_order_message_lang`; +DROP TABLE IF EXISTS `ps_order_return`; +DROP TABLE IF EXISTS `ps_order_return_detail`; +DROP TABLE IF EXISTS `ps_order_return_state`; +DROP TABLE IF EXISTS `ps_order_return_state_lang`; +DROP TABLE IF EXISTS `ps_order_slip`; +DROP TABLE IF EXISTS `ps_order_slip_detail`; +DROP TABLE IF EXISTS `ps_order_state`; +DROP TABLE IF EXISTS `ps_order_state_lang`; +DROP TABLE IF EXISTS `ps_orders`; +DROP TABLE IF EXISTS `ps_pack`; +DROP TABLE IF EXISTS `ps_page`; +DROP TABLE IF EXISTS `ps_page_type`; +DROP TABLE IF EXISTS `ps_page_viewed`; +DROP TABLE IF EXISTS `ps_pagenotfound`; +DROP TABLE IF EXISTS `ps_product`; +DROP TABLE IF EXISTS `ps_product_attachment`; +DROP TABLE IF EXISTS `ps_product_attribute`; +DROP TABLE IF EXISTS `ps_product_attribute_combination`; +DROP TABLE IF EXISTS `ps_product_attribute_image`; +DROP TABLE IF EXISTS `ps_attribute_impact`; +DROP TABLE IF EXISTS `ps_product_download`; +DROP TABLE IF EXISTS `ps_product_lang`; +DROP TABLE IF EXISTS `ps_product_sale`; +DROP TABLE IF EXISTS `ps_product_tag`; +DROP TABLE IF EXISTS `ps_profile`; +DROP TABLE IF EXISTS `ps_profile_lang`; +DROP TABLE IF EXISTS `ps_quick_access`; +DROP TABLE IF EXISTS `ps_quick_access_lang`; +DROP TABLE IF EXISTS `ps_range_price`; +DROP TABLE IF EXISTS `ps_range_weight`; +DROP TABLE IF EXISTS `ps_referrer`; +DROP TABLE IF EXISTS `ps_referrer_cache`; +DROP TABLE IF EXISTS `ps_scene`; +DROP TABLE IF EXISTS `ps_scene_category`; +DROP TABLE IF EXISTS `ps_scene_lang`; +DROP TABLE IF EXISTS `ps_scene_products`; +DROP TABLE IF EXISTS `ps_search_engine`; +DROP TABLE IF EXISTS `ps_search_index`; +DROP TABLE IF EXISTS `ps_search_word`; +DROP TABLE IF EXISTS `ps_sekeyword`; +DROP TABLE IF EXISTS `ps_state`; +DROP TABLE IF EXISTS `ps_statssearch`; +DROP TABLE IF EXISTS `ps_subdomain`; +DROP TABLE IF EXISTS `ps_supplier`; +DROP TABLE IF EXISTS `ps_supplier_lang`; +DROP TABLE IF EXISTS `ps_tab`; +DROP TABLE IF EXISTS `ps_tab_lang`; +DROP TABLE IF EXISTS `ps_tag`; +DROP TABLE IF EXISTS `ps_tax`; +DROP TABLE IF EXISTS `ps_tax_lang`; +DROP TABLE IF EXISTS `ps_tax_state`; +DROP TABLE IF EXISTS `ps_tax_zone`; +DROP TABLE IF EXISTS `ps_timezone`; +DROP TABLE IF EXISTS `ps_web_browser`; +DROP TABLE IF EXISTS `ps_zone`; diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_01.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_01.sql new file mode 100644 index 0000000000000000000000000000000000000000..ca8a3e9c593d0bcbe19235a6617fc022986d82ed --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_01.sql @@ -0,0 +1,2 @@ +/* ********** Person delcaration ********** */ +INSERT INTO `ps_customer` (id_customer, firstname, lastname, email, deleted) VALUES (1, 'John', 'DOE', 'john@doe.com', 0); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_02.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_02.sql new file mode 100644 index 0000000000000000000000000000000000000000..d21376af40d13a10380987e8d4266db51e9ef5ae --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_02.sql @@ -0,0 +1,3 @@ +/* ********** Person delcaration ********** */ +INSERT INTO `ps_customer` (id_customer, firstname, lastname, email, birthday, deleted) VALUES (1, 'Jean', 'GRAY', 'jean@gray.com', '1985-04-05', 0); +INSERT INTO `ps_address` (id_address, id_country, id_customer, address1, postcode, city, deleted) VALUES (1, 8, 1, '22 rue des Peupliers', '75000', 'Paris', 0); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_03.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_03.sql new file mode 100644 index 0000000000000000000000000000000000000000..9d7de4edb4e5e5eb98da0468ac912666309a23ea --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_03.sql @@ -0,0 +1,3 @@ +/* ********** Person delcaration ********** */ +INSERT INTO `ps_customer` (id_customer, firstname, lastname, email, birthday, deleted) VALUES (1, 'Jenifer-Dylan', 'COX', 'jenifer-dylan@cox.com', '2008-06-06', 0); +INSERT INTO `ps_address` (id_address, id_country, id_customer, address1, postcode, city, deleted) VALUES (1, 8, 1, '234 rue de la Paix', '75000', 'Paris', 0), (2, 1, 1, '123 boulevard des Capucines', '72160', 'Stuttgart', 0), (3, 1, 1, '345 avenue des Fleurs', '44001', 'Dortmund', 0); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_04.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_04.sql new file mode 100644 index 0000000000000000000000000000000000000000..019785a92e0f0624549143253736125d10729412 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_04.sql @@ -0,0 +1,3 @@ +/* ********** Person delcaration ********** */ +INSERT INTO `ps_customer` (id_customer, firstname, lastname, email, birthday, deleted) VALUES (1, 'John', 'DORIAN', 'john@dorian.com', '1980-01-27', 0); +INSERT INTO `ps_address` (id_address, id_country, id_customer, address1, postcode, city, deleted) VALUES (1, 8, 1, '22 rue des Champs', '75000', 'Paris', 0), (2, 8, 1, '17 rue des Plomb', '44001', 'Dortmund', 0); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_05.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_05.sql new file mode 100644 index 0000000000000000000000000000000000000000..c7e49123313d86e30f5245e89c315bee2272d1d8 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_05.sql @@ -0,0 +1,2 @@ +/* ********** Person delcaration ********** */ +INSERT INTO `ps_customer` (id_customer, firstname, lastname, email, deleted) VALUES (1, 'John', 'DOE', 'john@doe.com', 0), (2, 'Jane', 'DOE', 'jane@doe.com', 0), (3, 'Dan', 'DOE', 'dan@doe.com', 0); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_06.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_06.sql new file mode 100644 index 0000000000000000000000000000000000000000..794925900c95c7441472e67fbb0dd3a30eead3d5 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_06.sql @@ -0,0 +1,2 @@ +/* ********** Delete the Persons ********** */ +DELETE FROM ps_customer; diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_07.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_07.sql new file mode 100644 index 0000000000000000000000000000000000000000..0dfe29f40ea808787089608172b39852f84f1fc5 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_07.sql @@ -0,0 +1,3 @@ +/* ********** Person delcaration ********** */ +INSERT INTO `ps_customer` (id_customer, firstname, lastname, email, birthday, deleted) VALUES (1, 'Chris', 'TURK', 'chris@turk.com', '1980-06-22', 0); +INSERT INTO `ps_address` (id_address, id_country, id_customer, address1, postcode, city, deleted) VALUES (1, 8, 1, '22 rue des Peupliers', '75000', 'Paris', 0); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_08.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_08.sql new file mode 100644 index 0000000000000000000000000000000000000000..b9f6f0a25eacf914afa5b06e68bfeed0e4489b13 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_08.sql @@ -0,0 +1,2 @@ +/* ********** Update person ********** */ +UPDATE `ps_customer` SET birthday = '1974-06-22' WHERE id_customer = 1; diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_09.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_09.sql new file mode 100644 index 0000000000000000000000000000000000000000..fc5ddb3216adcd76e1e92ac2ed8d854046c652ee --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_09.sql @@ -0,0 +1,3 @@ +/* ********** Person delcaration ********** */ +INSERT INTO `ps_customer` (id_customer, firstname, lastname, email, birthday, deleted) VALUES (1, 'Perry', 'COX', 'perry@cox.com', '1959-08-03', 0); +INSERT INTO `ps_address` (id_address, id_country, id_customer, address1, postcode, city, deleted) VALUES (1, 8, 1, '456 rue de la Paix', '75000', 'Paris', 0), (2, 1, 1, '789 avenue des Fleurs', '44001', 'Dortmund', 0); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_10.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_10.sql new file mode 100644 index 0000000000000000000000000000000000000000..4df9e80652bf12889572095d2107b40f01bf6499 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_10.sql @@ -0,0 +1,4 @@ +/* ********** Update person ********** */ +UPDATE `ps_customer` SET birthday = NULL WHERE id_customer = 1; +DELETE FROM `ps_address`; +INSERT INTO `ps_address` (id_address, id_country, id_customer, address1, postcode, city, deleted) VALUES (1, 1, 1, '123 boulevard des Capucines', '72160', 'Stuttgart', 0); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_11.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_11.sql new file mode 100644 index 0000000000000000000000000000000000000000..65f8b0a07785ab2dd6b2b4855c9c7f5d3f105f1d --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_person_sync_11.sql @@ -0,0 +1,4 @@ +/* ********** Update person ********** */ +UPDATE `ps_customer` SET birthday = '1959-08-03' WHERE id_customer = 1; +DELETE FROM `ps_address`; +INSERT INTO `ps_address` (id_address, id_country, id_customer, address1, postcode, city, deleted) VALUES (1, 1, 1, '123 boulevard des Capucines', '72160', 'Stuttgart', 0), (2, 1, 1, '789 avenue des Fleurs', '44001', 'Dortmund', 0); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_01.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_01.sql new file mode 100644 index 0000000000000000000000000000000000000000..022a738a0d9ddffc4722ff197244e69a37c98425 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_01.sql @@ -0,0 +1,3 @@ +/* ********** Product declaration ********** */ +INSERT INTO `ps_product` (id_product, id_tax, reference, active) VALUES (1, 1, 'my_ref', 1); +INSERT INTO `ps_product_lang` (id_product, id_lang, name) VALUES (1, 2, 'Tee-Shirt'); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_02.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_02.sql new file mode 100644 index 0000000000000000000000000000000000000000..4a1cae402cb59bec8fc38f9406a5b101ca23a713 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_02.sql @@ -0,0 +1,10 @@ +/* ********** Product declaration ********** */ +INSERT INTO `ps_product` (id_product, id_tax, reference, price, wholesale_price, ean13, active) VALUES (1, 1, '0123456789', 2.123456, 1.123456, 1234567890128, 1); +INSERT INTO `ps_product_lang` (id_product, id_lang, name) VALUES (1, 2, 'Ballon de Foot'); +/* ********** Variation declaration ********** */ +INSERT INTO `ps_attribute_group_lang` (id_attribute_group, id_lang, name, public_name) VALUES (1, 2, 'Taille du Ballon', 'Taille du Ballon'), (2, 2, 'Couleur', 'Couleur'); +INSERT INTO `ps_attribute` (id_attribute, id_attribute_group, color) VALUES (1, 1, NULL), (2, 1, NULL), (3, 2, '#FFFFFF'), (4, 2, '#000000'); +INSERT INTO `ps_attribute_lang` (id_attribute, id_lang, name) VALUES (1, 2, 's4'), (2, 2, 's5'), (3, 2, 'Blanc'), (4, 2, 'Noir'); +/* ********** Mapping between product and attribute ********** */ +INSERT INTO `ps_product_attribute` (id_product_attribute, id_product, reference, supplier_reference, location, ean13, wholesale_price, price, ecotax, quantity, weight, default_on) VALUES (1, 1, '', '', '', '', '0.000000', '0.00', '0.00', 10, 0, 0), (2, 1, '', '', '', '', '0.000000', '0.00', '0.00', 20, 0, 0), (3, 1, '', '', '', '', '0.000000', '0.00', '0.00', 30, 0, 0), (4, 1, '', '', '', '', '0.000000', '0.00', '0.00', 40, 0, 0); +INSERT INTO `ps_product_attribute_combination` (id_attribute, id_product_attribute) VALUES (1, 1), (3, 1), (1, 2), (4, 2), (2, 3), (3, 3), (2, 4), (4, 4); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_03.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_03.sql new file mode 100644 index 0000000000000000000000000000000000000000..9edc61edf225222f9dad5f971a34eeaab6d400fd --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_03.sql @@ -0,0 +1,10 @@ +/* ********** Product declaration ********** */ +INSERT INTO `ps_product` (id_product, id_tax, reference, price, wholesale_price, ean13, active) VALUES (1, 1, '01111', 2.1, 1.1, NULL, 1), (2, 1, '02222', 20.2, 10.2, 2222222222222, 1), (3, 1, '03333', 200.3, 100.3, 3333333333338, 1), (4, 1, '04444', 2000.4, 1000.4, 4444444444444, 1); +INSERT INTO `ps_product_lang` (id_product, id_lang, name) VALUES (1, 2, 'Stylo'), (2, 2, 'Ballon'), (3, 2, 'Ballon de Foot'), (4, 2, 'Ballon de Basket'); +/* ********** Variation declaration ********** */ +INSERT INTO `ps_attribute_group_lang` (id_attribute_group, id_lang, name, public_name) VALUES (1, 2, 'Taille du Ballon', 'Taille du Ballon'), (2, 2, 'Couleur', 'Couleur'); +INSERT INTO `ps_attribute` (id_attribute, id_attribute_group, color) VALUES (1, 1, NULL), (2, 1, NULL), (3, 2, '#FFFFFF'), (4, 2, '#000000'); +INSERT INTO `ps_attribute_lang` (id_attribute, id_lang, name) VALUES (1, 2, 's4'), (2, 2, 's5'), (3, 2, 'Blanc'), (4, 2, 'Noir'); +/* ********** Mapping between product and attribute ********** */ +INSERT INTO `ps_product_attribute` (id_product_attribute, id_product, reference, supplier_reference, location, ean13, wholesale_price, price, ecotax, quantity, weight, default_on) VALUES (1, 2, '', '', '', '', '0.000000', '0.00', '0.00', 10, 0, 0), (2, 2, '', '', '', '', '0.000000', '0.00', '0.00', 20, 0, 0), (3, 3, '', '', '', '', '0.000000', '0.00', '0.00', 30, 0, 0), (4, 3, '', '', '', '', '0.000000', '0.00', '0.00', 40, 0, 0), (5, 4, '', '', '', '', '0.000000', '0.00', '0.00', 50, 0, 0), (6, 4, '', '', '', '', '0.000000', '0.00', '0.00', 60, 0, 0), (7, 4, '', '', '', '', '0.000000', '0.00', '0.00', 70, 0, 0), (8, 4, '', '', '', '', '0.000000', '0.00', '0.00', 80, 0, 0); +INSERT INTO `ps_product_attribute_combination` (id_attribute, id_product_attribute) VALUES (1, 1), (2, 2), (3, 3), (4, 4), (1, 5), (3, 5), (1, 6), (4, 6), (2, 7), (3, 7), (2, 8), (4, 8); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_04.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_04.sql new file mode 100644 index 0000000000000000000000000000000000000000..481ab81b7740048586b88ca9746358f3ca1db3f5 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_04.sql @@ -0,0 +1,3 @@ +/* ********** Product declaration ********** */ +INSERT INTO `ps_product` (id_product, id_tax, reference, active) VALUES (1, 1, '12345', 1), (2, 1, '34567', 1), (3, 1, '56789', 1); +INSERT INTO `ps_product_lang` (id_product, id_lang, name) VALUES (1, 2, 'Tee-Shirt'), (2, 2, 'Short'), (3, 2, 'Pull-Over'); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_05.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_05.sql new file mode 100644 index 0000000000000000000000000000000000000000..b5bd1cb2b1f49cf6f7280672c829cca1aacc230f --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_05.sql @@ -0,0 +1,2 @@ +/* ********** Delete the Products ********** */ +DELETE FROM ps_product; diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_06.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_06.sql new file mode 100644 index 0000000000000000000000000000000000000000..73ed90d6ca9dc46070ccc383bccac0a8e71d9553 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_06.sql @@ -0,0 +1,10 @@ +/* ********** Product declaration ********** */ +INSERT INTO `ps_product` (id_product, id_tax, reference, price, wholesale_price, ean13, active) VALUES (1, 1, 'b246b', 2000.4, 1000.4, 1234567890128, 1); +INSERT INTO `ps_product_lang` (id_product, id_lang, name) VALUES (1, 2, 'Ballon de Basket'); +/* ********** Variation declaration ********** */ +INSERT INTO `ps_attribute_group_lang` (id_attribute_group, id_lang, name, public_name) VALUES (1, 2, 'Taille du Ballon', 'Taille du Ballon'), (2, 2, 'Couleur', 'Couleur'); +INSERT INTO `ps_attribute` (id_attribute, id_attribute_group, color) VALUES (1, 1, NULL), (2, 1, NULL), (3, 2, '#FFFFFF'), (4, 2, '#000000'); +INSERT INTO `ps_attribute_lang` (id_attribute, id_lang, name) VALUES (1, 2, 's4'), (2, 2, 's5'), (3, 2, 'Blanc'), (4, 2, 'Noir'); +/* ********** Mapping between product and attribute ********** */ +INSERT INTO `ps_product_attribute` (id_product_attribute, id_product, reference, supplier_reference, location, ean13, wholesale_price, price, ecotax, quantity, weight, default_on) VALUES (1, 1, '', '', '', '', '0.000000', '0.00', '0.00', 11, 0, 0), (2, 1, '', '', '', '', '0.000000', '0.00', '0.00', 21, 0, 0), (3, 1, '', '', '', '', '0.000000', '0.00', '0.00', 31, 0, 0), (4, 1, '', '', '', '', '0.000000', '0.00', '0.00', 41, 0, 0); +INSERT INTO `ps_product_attribute_combination` (id_attribute, id_product_attribute) VALUES (1, 1), (3, 1), (1, 2), (4, 2), (2, 3), (3, 3), (2, 4), (4, 4); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_07.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_07.sql new file mode 100644 index 0000000000000000000000000000000000000000..258f9836b6ebf75d5359a93cddaeed9451e95b6a --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_07.sql @@ -0,0 +1,2 @@ +/* ********** Product declaration ********** */ +UPDATE ps_product SET price = 20.0, wholesale_price = 10.0, ean13 = '0987654321098' WHERE id_product = 1; diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_08.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_08.sql new file mode 100644 index 0000000000000000000000000000000000000000..4bd13333e6204a24099d0ab48c155045df089ce1 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_08.sql @@ -0,0 +1,10 @@ +/* ********** Product declaration ********** */ +INSERT INTO `ps_product` (id_product, id_tax, reference, price, wholesale_price, active) VALUES (1, 1, 'a5962z', 200.25, 100.25, 1); +INSERT INTO `ps_product_lang` (id_product, id_lang, name) VALUES (1, 2, 'Ballon de Plage'); +/* ********** Variation declaration ********** */ +INSERT INTO `ps_attribute_group_lang` (id_attribute_group, id_lang, name, public_name) VALUES (1, 2, 'Taille du Ballon', 'Taille du Ballon'), (2, 2, 'Couleur', 'Couleur'); +INSERT INTO `ps_attribute` (id_attribute, id_attribute_group, color) VALUES (1, 1, NULL), (2, 1, NULL), (3, 1, NULL), (4, 2, '#FFFFFF'), (5, 2, '#000000'), (6, 2, '#FF0000'); +INSERT INTO `ps_attribute_lang` (id_attribute, id_lang, name) VALUES (1, 2, 's4'), (2, 2, 's5'), (3, 2, 's6'), (4, 2, 'Blanc'), (5, 2, 'Noir'), (6, 2, 'Rouge'); +/* ********** Mapping between product and attribute ********** */ +INSERT INTO `ps_product_attribute` (id_product_attribute, id_product, reference, supplier_reference, location, ean13, wholesale_price, price, ecotax, quantity, weight, default_on) VALUES (1, 1, '', '', '', '', '0.000000', '0.00', '0.00', 12, 0, 0), (2, 1, '', '', '', '', '0.000000', '0.00', '0.00', 22, 0, 0), (3, 1, '', '', '', '', '0.000000', '0.00', '0.00', 32, 0, 0), (4, 1, '', '', '', '', '0.000000', '0.00', '0.00', 42, 0, 0), (5, 1, '', '', '', '', '0.000000', '0.00', '0.00', 52, 0, 0), (6, 1, '', '', '', '', '0.000000', '0.00', '0.00', 62, 0, 0), (7, 1, '', '', '', '', '0.000000', '0.00', '0.00', 72, 0, 0), (8, 1, '', '', '', '', '0.000000', '0.00', '0.00', 82, 0, 0), (9, 1, '', '', '', '', '0.000000', '0.00', '0.00', 92, 0, 0); +INSERT INTO `ps_product_attribute_combination` (id_attribute, id_product_attribute) VALUES (1, 1), (4, 1), (1, 2), (5, 2), (2, 3), (4, 3), (2, 4), (5, 4); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_09.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_09.sql new file mode 100644 index 0000000000000000000000000000000000000000..789204ca164d44376b3bc63fe855aa78a6108adb --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_09.sql @@ -0,0 +1,6 @@ +/* ********** Product declaration ********** */ +UPDATE ps_product SET price = 120.0, wholesale_price = 0.0, ean13 = '1357913579130' WHERE id_product = 1; +/* ********** Update the variations ********** */ +DELETE FROM `ps_product_attribute_combination`; +INSERT INTO `ps_product_attribute_combination` (id_attribute, id_product_attribute) VALUES (1, 1), (4, 1), (1, 2), (6, 2), (3, 3), (4, 3), (3, 4), (6, 4); + diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_10.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_10.sql new file mode 100644 index 0000000000000000000000000000000000000000..a8e8242979906765ee1b6f08a54aa9ef13edb30a --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_10.sql @@ -0,0 +1,3 @@ +/* ********** Update the variations ********** */ +DELETE FROM `ps_product_attribute_combination`; +INSERT INTO `ps_product_attribute_combination` (id_attribute, id_product_attribute) VALUES (1, 1), (4, 1), (1, 3), (4, 3); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_11.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_11.sql new file mode 100644 index 0000000000000000000000000000000000000000..6bb19f5b8c7ce55eed2b19efbecf099dacc0aefe --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_11.sql @@ -0,0 +1,3 @@ +/* ********** Update the variations ********** */ +DELETE FROM `ps_product_attribute_combination`; +INSERT INTO `ps_product_attribute_combination` (id_attribute, id_product_attribute) VALUES (1, 1), (4, 1), (1, 2), (5, 2), (1, 3), (6, 3), (2, 4), (4, 4), (2, 5), (6, 5), (2, 6), (4, 6), (3, 7), (4, 7), (3, 8), (6, 8), (3, 9), (4, 9); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_12.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_12.sql new file mode 100644 index 0000000000000000000000000000000000000000..e8771f0590fc878b6f3bdd0a08602c3a49de22a6 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_product_sync_12.sql @@ -0,0 +1,4 @@ +/* ********** Variation declaration ********** */ +INSERT INTO `ps_attribute_group_lang` (id_attribute_group, id_lang, name, public_name) VALUES (1, 2, 'Taille du Ballon', 'Taille du Ballon'), (2, 2, 'Couleur', 'Couleur'); +INSERT INTO `ps_attribute` (id_attribute, id_attribute_group, color) VALUES (1, 1, NULL), (2, 1, NULL), (3, 1, NULL), (4, 2, '#FFFFFF'), (5, 2, '#000000'), (6, 2, '#FF0000'); +INSERT INTO `ps_attribute_lang` (id_attribute, id_lang, name) VALUES (1, 2, 's4'), (2, 2, 's5'), (3, 2, 's6'), (4, 2, 'Blanc'), (5, 2, 'Noir'), (6, 2, 'Rouge'); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_01.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_01.sql new file mode 100644 index 0000000000000000000000000000000000000000..9a6558560d81a31ee1f31ba791b62d93655369fe --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_01.sql @@ -0,0 +1,21 @@ +/* ********** Person delcaration ********** */ +INSERT INTO `ps_customer` (id_customer, firstname, lastname, email, birthday, deleted) VALUES (1, 'Jean', 'GRAY', 'jean@gray.com', '1985-04-05', 0); +INSERT INTO `ps_address` (id_address, id_country, id_customer, address1, postcode, city, deleted) VALUES (1, 8, 1, '22 rue des Peupliers', '75000', 'Paris', 0); + + +/* ********** Product delcaration ********** */ +INSERT INTO `ps_product` (id_product, id_tax, reference, price, wholesale_price, ean13, active) VALUES (1, 1, '01111', 2.1, 1.1, NULL, 1), (2, 1, '02222', 20.2, 10.2, 2222222222222, 1), (3, 1, '03333', 200.3, 100.3, 3333333333338, 1), (4, 1, '04444', 2000.4, 1000.4, 4444444444444, 1); +INSERT INTO `ps_product_lang` (id_product, id_lang, name) VALUES (1, 2, 'Stylo'), (2, 2, 'Ballon'), (3, 2, 'Ballon de Foot'), (4, 2, 'Ballon de Basket'); +/* Variation declaration */ +INSERT INTO `ps_attribute_group_lang` (id_attribute_group, id_lang, name, public_name) VALUES (1, 2, 'Taille du Ballon', 'Taille du Ballon'), (2, 2, 'Couleur', 'Couleur'); +INSERT INTO `ps_attribute` (id_attribute, id_attribute_group, color) VALUES (1, 1, NULL), (2, 1, NULL), (3, 2, '#FFFFFF'), (4, 2, '#000000'); +INSERT INTO `ps_attribute_lang` (id_attribute, id_lang, name) VALUES (1, 2, 's4'), (2, 2, 's5'), (3, 2, 'Blanc'), (4, 2, 'Noir'); +/* Mapping between product and attribute */ +INSERT INTO `ps_product_attribute` (id_product_attribute, id_product, reference, supplier_reference, location, ean13, wholesale_price, price, ecotax, quantity, weight, default_on) VALUES (1, 2, '', '', '', '', '0.000000', '0.00', '0.00', 10, 0, 0), (2, 2, '', '', '', '', '0.000000', '0.00', '0.00', 20, 0, 0), (3, 3, '', '', '', '', '0.000000', '0.00', '0.00', 30, 0, 0), (4, 3, '', '', '', '', '0.000000', '0.00', '0.00', 40, 0, 0), (5, 4, '', '', '', '', '0.000000', '0.00', '0.00', 50, 0, 0), (6, 4, '', '', '', '', '0.000000', '0.00', '0.00', 60, 0, 0), (7, 4, '', '', '', '', '0.000000', '0.00', '0.00', 70, 0, 0), (8, 4, '', '', '', '', '0.000000', '0.00', '0.00', 80, 0, 0); +INSERT INTO `ps_product_attribute_combination` (id_attribute, id_product_attribute) VALUES (1, 1), (2, 2), (3, 3), (4, 4), (1, 5), (3, 5), (1, 6), (4, 6), (2, 7), (3, 7), (2, 8), (4, 8); + +/* ********** Sale Order declaration ********** */ +INSERT INTO `ps_orders` VALUES (1,2,2,1,1,1,1,1,'40959ebe0a5332ea6864b557ee546915','CB','carte bancaire',1,0,'','','0.00','10.49','10.49','2.10','7.98','0.00',0,0,'2010-06-14 09:00:00','2010-06-16 09:00:00',0,'2010-06-14 09:00:00','2010-06-14 09:00:00'); +INSERT INTO `ps_order_detail` VALUES (1,1,1,0,'Stylo',1,1,0,0,0,'2.100000','0.000000',NULL,'01111',NULL,0,'TVA 19.6%','19.60','0.00','',0,'2010-06-14 09:00:00'); +INSERT INTO `ps_order_history` VALUES (1,0,1,4,'2010-06-14 09:00:00'); +INSERT INTO `ps_cart` VALUES (1,2,2,1,1,1,1,1,1,0,'','2010-06-14 09:00:00','2010-06-14 09:00:00'); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_02.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_02.sql new file mode 100644 index 0000000000000000000000000000000000000000..5e15a5a5c7ecec8308189b3ea596b929ff630829 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_02.sql @@ -0,0 +1,22 @@ +/* ********** Person delcaration ********** */ +INSERT INTO `ps_customer` (id_customer, firstname, lastname, email, birthday, deleted) VALUES (1, 'Jean', 'GRAY', 'jean@gray.com', '1985-04-05', 0); +INSERT INTO `ps_address` (id_address, id_country, id_customer, address1, postcode, city, deleted) VALUES (1, 8, 1, '22 rue des Peupliers', '75000', 'Paris', 0); + + +/* ********** Product delcaration ********** */ +INSERT INTO `ps_product` (id_product, id_tax, reference, price, wholesale_price, ean13, active) VALUES (1, 1, '01111', 2.1, 1.1, NULL, 1), (2, 1, '02222', 20.2, 10.2, 2222222222222, 1), (3, 1, '03333', 200.3, 100.3, 3333333333338, 1), (4, 1, '04444', 2000.4, 1000.4, 4444444444444, 1); +INSERT INTO `ps_product_lang` (id_product, id_lang, name) VALUES (1, 2, 'Stylo'), (2, 2, 'Ballon'), (3, 2, 'Ballon de Foot'), (4, 2, 'Ballon de Basket'); +/* Variation declaration */ +INSERT INTO `ps_attribute_group_lang` (id_attribute_group, id_lang, name, public_name) VALUES (1, 2, 'Taille du Ballon', 'Taille du Ballon'), (2, 2, 'Couleur', 'Couleur'); +INSERT INTO `ps_attribute` (id_attribute, id_attribute_group, color) VALUES (1, 1, NULL), (2, 1, NULL), (3, 2, '#FFFFFF'), (4, 2, '#000000'); +INSERT INTO `ps_attribute_lang` (id_attribute, id_lang, name) VALUES (1, 2, 's4'), (2, 2, 's5'), (3, 2, 'Blanc'), (4, 2, 'Noir'); +/* Mapping between product and attribute */ +INSERT INTO `ps_product_attribute` (id_product_attribute, id_product, reference, supplier_reference, location, ean13, wholesale_price, price, ecotax, quantity, weight, default_on) VALUES (1, 2, '', '', '', '', '0.000000', '0.00', '0.00', 10, 0, 0), (2, 2, '', '', '', '', '0.000000', '0.00', '0.00', 20, 0, 0), (3, 3, '', '', '', '', '0.000000', '0.00', '0.00', 30, 0, 0), (4, 3, '', '', '', '', '0.000000', '0.00', '0.00', 40, 0, 0), (5, 4, '', '', '', '', '0.000000', '0.00', '0.00', 50, 0, 0), (6, 4, '', '', '', '', '0.000000', '0.00', '0.00', 60, 0, 0), (7, 4, '', '', '', '', '0.000000', '0.00', '0.00', 70, 0, 0), (8, 4, '', '', '', '', '0.000000', '0.00', '0.00', 80, 0, 0); +INSERT INTO `ps_product_attribute_combination` (id_attribute, id_product_attribute) VALUES (1, 1), (2, 2), (3, 3), (4, 4), (1, 5), (3, 5), (1, 6), (4, 6), (2, 7), (3, 7), (2, 8), (4, 8); + +/* ********** Sale Order delcaration ********** */ +INSERT INTO `ps_orders` VALUES (1,2,2,1,2,1,1,1,'40959ebe0a5332ea6864b557ee546915','CB','carte bancaire',1,0,'','','0.00','104.62','104.62','80.80','7.98','0.00',0,0,'2010-06-14 09:10:00','2010-06-16 09:10:00',0,'2010-06-14 09:10:00','2010-06-14 09:10:00'); +INSERT INTO `ps_order_detail` VALUES ( +1,1,2,1,'Ballon - Taille du Ballon : s4',2,2,0,0,0,'20.200000','0.000000','2222222222222','02222',NULL,0,'TVA 19.6%','19.60','0.00','',0,'2010-06-14 09:10:00'), (2,1,2,2,'Ballon - Taille du Ballon : s5',2,2,0,0,0,'20.200000','0.000000','2222222222222','02222',NULL,0,'TVA 19.6%','19.60','0.00','',0,'2010-06-14 09:10:00'); +INSERT INTO `ps_order_history` VALUES (1,0,1,4,'2010-06-14 09:10:00'); +INSERT INTO `ps_cart` VALUES (1,2,2,1,1,1,1,1,1,0,'','2010-06-14 09:10:00','2010-06-14 09:10:00'); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_03.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_03.sql new file mode 100644 index 0000000000000000000000000000000000000000..bd4b213eee39bba1734d1baccf27cb7725864b13 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_03.sql @@ -0,0 +1,21 @@ +/* ********** Person delcaration ********** */ +INSERT INTO `ps_customer` (id_customer, firstname, lastname, email, birthday, deleted) VALUES (1, 'Jean', 'GRAY', 'jean@gray.com', '1985-04-05', 0); +INSERT INTO `ps_address` (id_address, id_country, id_customer, address1, postcode, city, deleted) VALUES (1, 8, 1, '22 rue des Peupliers', '75000', 'Paris', 0); + + +/* ********** Product delcaration ********** */ +INSERT INTO `ps_product` (id_product, id_tax, reference, price, wholesale_price, ean13, active) VALUES (1, 1, '01111', 2.1, 1.1, NULL, 1), (2, 1, '02222', 20.2, 10.2, 2222222222222, 1), (3, 1, '03333', 200.3, 100.3, 3333333333338, 1), (4, 1, '04444', 2000.4, 1000.4, 4444444444444, 1); +INSERT INTO `ps_product_lang` (id_product, id_lang, name) VALUES (1, 2, 'Stylo'), (2, 2, 'Ballon'), (3, 2, 'Ballon de Foot'), (4, 2, 'Ballon de Basket'); +/* Variation declaration */ +INSERT INTO `ps_attribute_group_lang` (id_attribute_group, id_lang, name, public_name) VALUES (1, 2, 'Taille du Ballon', 'Taille du Ballon'), (2, 2, 'Couleur', 'Couleur'); +INSERT INTO `ps_attribute` (id_attribute, id_attribute_group, color) VALUES (1, 1, NULL), (2, 1, NULL), (3, 2, '#FFFFFF'), (4, 2, '#000000'); +INSERT INTO `ps_attribute_lang` (id_attribute, id_lang, name) VALUES (1, 2, 's4'), (2, 2, 's5'), (3, 2, 'Blanc'), (4, 2, 'Noir'); +/* Mapping between product and attribute */ +INSERT INTO `ps_product_attribute` (id_product_attribute, id_product, reference, supplier_reference, location, ean13, wholesale_price, price, ecotax, quantity, weight, default_on) VALUES (1, 2, '', '', '', '', '0.000000', '0.00', '0.00', 10, 0, 0), (2, 2, '', '', '', '', '0.000000', '0.00', '0.00', 20, 0, 0), (3, 3, '', '', '', '', '0.000000', '0.00', '0.00', 30, 0, 0), (4, 3, '', '', '', '', '0.000000', '0.00', '0.00', 40, 0, 0), (5, 4, '', '', '', '', '0.000000', '0.00', '0.00', 50, 0, 0), (6, 4, '', '', '', '', '0.000000', '0.00', '0.00', 60, 0, 0), (7, 4, '', '', '', '', '0.000000', '0.00', '0.00', 70, 0, 0), (8, 4, '', '', '', '', '0.000000', '0.00', '0.00', 80, 0, 0); +INSERT INTO `ps_product_attribute_combination` (id_attribute, id_product_attribute) VALUES (1, 1), (2, 2), (3, 3), (4, 4), (1, 5), (3, 5), (1, 6), (4, 6), (2, 7), (3, 7), (2, 8), (4, 8); + +/* ********** Sale Order delcaration ********** */ +INSERT INTO `ps_orders` VALUES (1,2,2,1,1,1,1,1,'40959ebe0a5332ea6864b557ee546915','CB','carte bancaire',1,0,'','','0.00','966.22','966.22','801.20','7.98','0.00',0,0,'2010-06-14 09:20:00','2010-06-16 09:20:00',0,'2010-06-14 09:20:00','2010-06-14 09:20:00'); +INSERT INTO `ps_order_detail` VALUES (1,1,3,3,'Ballon de Foot - Couleur : Blanc',2,2,0,0,0,'200.300000','0.000000','3333333333338','03333',NULL,0,'TVA 19.6%','19.60','0.00','',0,'2010-06-14 09:20:00'), (2,1,3,4,'Ballon de Foot - Couleur : Noir',2,2,0,0,0,'200.300000','0.000000','3333333333338','03333',NULL,0,'TVA 19.6%','19.60','0.00','',0,'2010-06-14 09:20:00'); +INSERT INTO `ps_order_history` VALUES (1,0,1,4,'2010-06-14 09:20:00'); +INSERT INTO `ps_cart` VALUES (1,2,2,1,1,1,1,1,1,0,'','2010-06-14 16:25:00','2010-06-14 09:20:00'); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_04.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_04.sql new file mode 100644 index 0000000000000000000000000000000000000000..3d82fb0201f51a9188ae4dea44594ac0dfc66ef8 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_04.sql @@ -0,0 +1,21 @@ +/* ********** Person delcaration ********** */ +INSERT INTO `ps_customer` (id_customer, firstname, lastname, email, birthday, deleted) VALUES (1, 'Jean', 'GRAY', 'jean@gray.com', '1985-04-05', 0); +INSERT INTO `ps_address` (id_address, id_country, id_customer, address1, postcode, city, deleted) VALUES (1, 8, 1, '22 rue des Peupliers', '75000', 'Paris', 0); + + +/* ********** Product delcaration ********** */ +INSERT INTO `ps_product` (id_product, id_tax, reference, price, wholesale_price, ean13, active) VALUES (1, 1, '01111', 2.1, 1.1, NULL, 1), (2, 1, '02222', 20.2, 10.2, 2222222222222, 1), (3, 1, '03333', 200.3, 100.3, 3333333333338, 1), (4, 1, '04444', 2000.4, 1000.4, 4444444444444, 1); +INSERT INTO `ps_product_lang` (id_product, id_lang, name) VALUES (1, 2, 'Stylo'), (2, 2, 'Ballon'), (3, 2, 'Ballon de Foot'), (4, 2, 'Ballon de Basket'); +/* Variation declaration */ +INSERT INTO `ps_attribute_group_lang` (id_attribute_group, id_lang, name, public_name) VALUES (1, 2, 'Taille du Ballon', 'Taille du Ballon'), (2, 2, 'Couleur', 'Couleur'); +INSERT INTO `ps_attribute` (id_attribute, id_attribute_group, color) VALUES (1, 1, NULL), (2, 1, NULL), (3, 2, '#FFFFFF'), (4, 2, '#000000'); +INSERT INTO `ps_attribute_lang` (id_attribute, id_lang, name) VALUES (1, 2, 's4'), (2, 2, 's5'), (3, 2, 'Blanc'), (4, 2, 'Noir'); +/* Mapping between product and attribute */ +INSERT INTO `ps_product_attribute` (id_product_attribute, id_product, reference, supplier_reference, location, ean13, wholesale_price, price, ecotax, quantity, weight, default_on) VALUES (1, 2, '', '', '', '', '0.000000', '0.00', '0.00', 10, 0, 0), (2, 2, '', '', '', '', '0.000000', '0.00', '0.00', 20, 0, 0), (3, 3, '', '', '', '', '0.000000', '0.00', '0.00', 30, 0, 0), (4, 3, '', '', '', '', '0.000000', '0.00', '0.00', 40, 0, 0), (5, 4, '', '', '', '', '0.000000', '0.00', '0.00', 50, 0, 0), (6, 4, '', '', '', '', '0.000000', '0.00', '0.00', 60, 0, 0), (7, 4, '', '', '', '', '0.000000', '0.00', '0.00', 70, 0, 0), (8, 4, '', '', '', '', '0.000000', '0.00', '0.00', 80, 0, 0); +INSERT INTO `ps_product_attribute_combination` (id_attribute, id_product_attribute) VALUES (1, 1), (2, 2), (3, 3), (4, 4), (1, 5), (3, 5), (1, 6), (4, 6), (2, 7), (3, 7), (2, 8), (4, 8); + +/* ********** Sale Order delcaration ********** */ +INSERT INTO `ps_orders` VALUES (1,2,2,1,1,1,1,1,'40959ebe0a5332ea6864b557ee546915','CB','carte bancaire',1,0,'','','0.00','19147.81','19147.81','16003.20','7.98','0.00',0,0,'2010-06-14 09:30:00','2010-06-16 09:30:00',0,'2010-06-14 09:30:00','2010-06-14 09:30:00'); +INSERT INTO `ps_order_detail` VALUES (1,1,4,5,'Ballon de Basket - Couleur : Blanc, Taille du Ballon : s4',4,4,0,0,0,'2000.400000','0.000000','4444444444444','044444',NULL,0,'TVA 19.6%','19.60','0.00','',0,'2010-06-14 09:30:00'), (7,1,4,8,'Ballon de Basket - Couleur : Noir, Taille du Ballon : s5',4,4,0,0,0,'2000.400000','0.000000','4444444444444','044444',NULL,0,'TVA 19.6%','19.60','0.00','',0,'2010-06-14 00:30:00'); +INSERT INTO `ps_order_history` VALUES (1,0,1,4,'2010-06-14 09:30:00'); +INSERT INTO `ps_cart` VALUES (1,2,2,1,1,1,1,1,1,0,'','2010-06-14 16:26:00','2010-06-14 09:30:00'); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_05.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_05.sql new file mode 100644 index 0000000000000000000000000000000000000000..a3cbb1cd4a50e449d1412b516bff80121f4a9a54 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_05.sql @@ -0,0 +1,23 @@ +/* ********** Person delcaration ********** */ +INSERT INTO `ps_customer` (id_customer, firstname, lastname, email, birthday, deleted) VALUES (1, 'Jean', 'GRAY', 'jean@gray.com', '1985-04-05', 0); +INSERT INTO `ps_address` (id_address, id_country, id_customer, address1, postcode, city, deleted) VALUES (1, 8, 1, '22 rue des Peupliers', '75000', 'Paris', 0); + + +/* ********** Product delcaration ********** */ +INSERT INTO `ps_product` (id_product, id_tax, reference, price, wholesale_price, ean13, active) VALUES (1, 1, '01111', 2.1, 1.1, NULL, 1), (2, 1, '02222', 20.2, 10.2, 2222222222222, 1), (3, 1, '03333', 200.3, 100.3, 3333333333338, 1), (4, 1, '04444', 2000.4, 1000.4, 4444444444444, 1); +INSERT INTO `ps_product_lang` (id_product, id_lang, name) VALUES (1, 2, 'Stylo'), (2, 2, 'Ballon'), (3, 2, 'Ballon de Foot'), (4, 2, 'Ballon de Basket'); +/* Variation declaration */ +INSERT INTO `ps_attribute_group_lang` (id_attribute_group, id_lang, name, public_name) VALUES (1, 2, 'Taille du Ballon', 'Taille du Ballon'), (2, 2, 'Couleur', 'Couleur'); +INSERT INTO `ps_attribute` (id_attribute, id_attribute_group, color) VALUES (1, 1, NULL), (2, 1, NULL), (3, 2, '#FFFFFF'), (4, 2, '#000000'); +INSERT INTO `ps_attribute_lang` (id_attribute, id_lang, name) VALUES (1, 2, 's4'), (2, 2, 's5'), (3, 2, 'Blanc'), (4, 2, 'Noir'); +/* Mapping between product and attribute */ +INSERT INTO `ps_product_attribute` (id_product_attribute, id_product, reference, supplier_reference, location, ean13, wholesale_price, price, ecotax, quantity, weight, default_on) VALUES (1, 2, '', '', '', '', '0.000000', '0.00', '0.00', 10, 0, 0), (2, 2, '', '', '', '', '0.000000', '0.00', '0.00', 20, 0, 0), (3, 3, '', '', '', '', '0.000000', '0.00', '0.00', 30, 0, 0), (4, 3, '', '', '', '', '0.000000', '0.00', '0.00', 40, 0, 0), (5, 4, '', '', '', '', '0.000000', '0.00', '0.00', 50, 0, 0), (6, 4, '', '', '', '', '0.000000', '0.00', '0.00', 60, 0, 0), (7, 4, '', '', '', '', '0.000000', '0.00', '0.00', 70, 0, 0), (8, 4, '', '', '', '', '0.000000', '0.00', '0.00', 80, 0, 0); +INSERT INTO `ps_product_attribute_combination` (id_attribute, id_product_attribute) VALUES (1, 1), (2, 2), (3, 3), (4, 4), (1, 5), (3, 5), (1, 6), (4, 6), (2, 7), (3, 7), (2, 8), (4, 8); + +/* ********** Sale Order delcaration ********** */ +INSERT INTO `ps_orders` VALUES (1,2,2,1,1,1,1,1,'40959ebe0a5332ea6864b557ee546915','CB','carte bancaire',1,0,'','','5.00','10.49','5.49','2.10','7.98','0.00',0,0,'2010-06-14 09:00:00','2010-06-16 09:00:00',0,'2010-06-14 09:00:00','2010-06-14 09:00:00'); +INSERT INTO `ps_order_detail` VALUES (1,1,1,0,'Stylo',1,1,0,0,0,'2.100000','0.000000',NULL,'01111',NULL,0,'TVA 19.6%','19.60','0.00','',0,'2010-06-14 09:00:00'); +INSERT INTO `ps_order_history` VALUES (1,0,1,4,'2010-06-14 09:00:00'); +INSERT INTO `ps_cart` VALUES (1,2,2,1,1,1,1,1,1,0,'','2010-06-14 09:00:00','2010-06-14 09:00:00'); +INSERT INTO `ps_discount` VALUES (1,2,1,'Dicount 5 Euro','5.00',0,1,0,0,'2010-06-14 00:00:00','2010-06-14 22:00:00','1.00',1); +INSERT INTO `ps_order_discount` VALUES (1,1,1,'Discount 5 Euro','5.00'); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_06.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_06.sql new file mode 100644 index 0000000000000000000000000000000000000000..b7319ac03759187e2ba08eccc3c800d76dc22410 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_06.sql @@ -0,0 +1,21 @@ +/* ********** Person delcaration ********** */ +INSERT INTO `ps_customer` (id_customer, firstname, lastname, email, birthday, deleted) VALUES (1, 'Jean', 'GRAY', 'jean@gray.com', '1985-04-05', 0); +INSERT INTO `ps_address` (id_address, id_country, id_customer, address1, postcode, city, deleted) VALUES (1, 8, 1, '22 rue des Peupliers', '75000', 'Paris', 0); + + +/* ********** Product delcaration ********** */ +INSERT INTO `ps_product` (id_product, id_tax, reference, price, wholesale_price, ean13, active) VALUES (1, 1, '01111', 2.1, 1.1, NULL, 1), (2, 1, '02222', 20.2, 10.2, 2222222222222, 1), (3, 1, '03333', 200.3, 100.3, 3333333333338, 1), (4, 1, '04444', 2000.4, 1000.4, 4444444444444, 1); +INSERT INTO `ps_product_lang` (id_product, id_lang, name) VALUES (1, 2, 'Stylo'), (2, 2, 'Ballon'), (3, 2, 'Ballon de Foot'), (4, 2, 'Ballon de Basket'); +/* Variation declaration */ +INSERT INTO `ps_attribute_group_lang` (id_attribute_group, id_lang, name, public_name) VALUES (1, 2, 'Taille du Ballon', 'Taille du Ballon'), (2, 2, 'Couleur', 'Couleur'); +INSERT INTO `ps_attribute` (id_attribute, id_attribute_group, color) VALUES (1, 1, NULL), (2, 1, NULL), (3, 2, '#FFFFFF'), (4, 2, '#000000'); +INSERT INTO `ps_attribute_lang` (id_attribute, id_lang, name) VALUES (1, 2, 's4'), (2, 2, 's5'), (3, 2, 'Blanc'), (4, 2, 'Noir'); +/* Mapping between product and attribute */ +INSERT INTO `ps_product_attribute` (id_product_attribute, id_product, reference, supplier_reference, location, ean13, wholesale_price, price, ecotax, quantity, weight, default_on) VALUES (1, 2, '', '', '', '', '0.000000', '0.00', '0.00', 10, 0, 0), (2, 2, '', '', '', '', '0.000000', '0.00', '0.00', 20, 0, 0), (3, 3, '', '', '', '', '0.000000', '0.00', '0.00', 30, 0, 0), (4, 3, '', '', '', '', '0.000000', '0.00', '0.00', 40, 0, 0), (5, 4, '', '', '', '', '0.000000', '0.00', '0.00', 50, 0, 0), (6, 4, '', '', '', '', '0.000000', '0.00', '0.00', 60, 0, 0), (7, 4, '', '', '', '', '0.000000', '0.00', '0.00', 70, 0, 0), (8, 4, '', '', '', '', '0.000000', '0.00', '0.00', 80, 0, 0); +INSERT INTO `ps_product_attribute_combination` (id_attribute, id_product_attribute) VALUES (1, 1), (2, 2), (3, 3), (4, 4), (1, 5), (3, 5), (1, 6), (4, 6), (2, 7), (3, 7), (2, 8), (4, 8); + +/* ********** Sale Order delcaration ********** */ +INSERT INTO `ps_orders` VALUES (1,2,2,0,1,1,1,1,'40959ebe0a5332ea6864b557ee546915','CB','carte bancaire',1,0,'','','0.00','10.49','10.49','2.10','7.98','0.00',0,0,'2010-06-14 09:00:00','2010-06-16 09:00:00',0,'2010-06-14 09:00:00','2010-06-14 09:00:00'); +INSERT INTO `ps_order_detail` VALUES (1,1,1,0,'Stylo',1,1,0,0,0,'2.100000','0.000000',NULL,'01111',NULL,0,'TVA 19.6%','19.60','0.00','',0,'2010-06-14 09:00:00'); +INSERT INTO `ps_order_history` VALUES (1,0,1,4,'2010-06-14 09:00:00'); +INSERT INTO `ps_cart` VALUES (1,2,2,1,1,1,1,1,1,0,'','2010-06-14 09:00:00','2010-06-14 09:00:00'); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_07.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_07.sql new file mode 100644 index 0000000000000000000000000000000000000000..715946be9c6d589ed96dc9b2ec10775144b3d51c --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_07.sql @@ -0,0 +1,22 @@ +/* ********** Person delcaration ********** */ +INSERT INTO `ps_customer` (id_customer, firstname, lastname, email, birthday, deleted) VALUES (1, 'Jean', 'GRAY', 'jean@gray.com', '1985-04-05', 0); +INSERT INTO `ps_address` (id_address, id_country, id_customer, address1, postcode, city, deleted) VALUES (1, 8, 1, '22 rue des Peupliers', '75000', 'Paris', 0); + + +/* ********** Product delcaration ********** */ +INSERT INTO `ps_product` (id_product, id_tax, reference, price, wholesale_price, ean13, active) VALUES (1, 1, '01111', 2.1, 1.1, NULL, 1), (2, 1, '02222', 20.2, 10.2, 2222222222222, 1), (3, 1, '03333', 200.3, 100.3, 3333333333338, 1), (4, 1, '04444', 2000.4, 1000.4, 4444444444444, 1); +INSERT INTO `ps_product_lang` (id_product, id_lang, name) VALUES (1, 2, 'Stylo'), (2, 2, 'Ballon'), (3, 2, 'Ballon de Foot'), (4, 2, 'Ballon de Basket'); +/* Variation declaration */ +INSERT INTO `ps_attribute_group_lang` (id_attribute_group, id_lang, name, public_name) VALUES (1, 2, 'Taille du Ballon', 'Taille du Ballon'), (2, 2, 'Couleur', 'Couleur'); +INSERT INTO `ps_attribute` (id_attribute, id_attribute_group, color) VALUES (1, 1, NULL), (2, 1, NULL), (3, 2, '#FFFFFF'), (4, 2, '#000000'); +INSERT INTO `ps_attribute_lang` (id_attribute, id_lang, name) VALUES (1, 2, 's4'), (2, 2, 's5'), (3, 2, 'Blanc'), (4, 2, 'Noir'); +/* Mapping between product and attribute */ +INSERT INTO `ps_product_attribute` (id_product_attribute, id_product, reference, supplier_reference, location, ean13, wholesale_price, price, ecotax, quantity, weight, default_on) VALUES (1, 2, '', '', '', '', '0.000000', '0.00', '0.00', 10, 0, 0), (2, 2, '', '', '', '', '0.000000', '0.00', '0.00', 20, 0, 0), (3, 3, '', '', '', '', '0.000000', '0.00', '0.00', 30, 0, 0); +/* FIXME: Is variation are keep even if the product is removed ?? , (4, 3, '', '', '', '', '0.000000', '0.00', '0.00', 40, 0, 0), (5, 4, '', '', '', '', '0.000000', '0.00', '0.00', 50, 0, 0), (6, 4, '', '', '', '', '0.000000', '0.00', '0.00', 60, 0, 0), (7, 4, '', '', '', '', '0.000000', '0.00', '0.00', 70, 0, 0), (8, 4, '', '', '', '', '0.000000', '0.00', '0.00', 80, 0, 0) */ +INSERT INTO `ps_product_attribute_combination` (id_attribute, id_product_attribute) VALUES (1, 1), (2, 2), (3, 3), (4, 4), (1, 5), (3, 5), (1, 6), (4, 6), (2, 7), (3, 7), (2, 8), (4, 8); + +/* ********** Sale Order delcaration ********** */ +INSERT INTO `ps_orders` VALUES (1,2,2,1,1,1,1,1,'40959ebe0a5332ea6864b557ee546915','CB','carte bancaire',1,0,'','','0.00','19147.81','19147.81','16003.20','7.98','0.00',0,0,'2010-06-14 09:30:00','2010-06-16 09:30:00',0,'2010-06-14 09:30:00','2010-06-14 09:30:00'); +INSERT INTO `ps_order_detail` VALUES (1,1,0,5,'Ballon de Basket - Couleur : Blanc, Taille du Ballon : s4',4,4,0,0,0,'2000.400000','0.000000','4444444444444','044444',NULL,0,'TVA 19.6%','19.60','0.00','',0,'2010-06-14 09:30:00'), (7,1,0,8,'Ballon de Basket - Couleur : Noir, Taille du Ballon : s5',4,4,0,0,0,'2000.400000','0.000000','4444444444444','044444',NULL,0,'TVA 19.6%','19.60','0.00','',0,'2010-06-14 00:30:00'); +INSERT INTO `ps_order_history` VALUES (1,0,1,4,'2010-06-14 09:00:00'); +INSERT INTO `ps_cart` VALUES (1,2,2,1,1,1,1,1,1,0,'','2010-06-14 09:00:00','2010-06-14 09:00:00'); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_08.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_08.sql new file mode 100644 index 0000000000000000000000000000000000000000..87a363fca0455eaf24fdbcfb7e5b79bd5511e9f3 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_08.sql @@ -0,0 +1,21 @@ +/* ********** Person delcaration ********** */ +INSERT INTO `ps_customer` (id_customer, firstname, lastname, email, birthday, deleted) VALUES (1, 'Jean', 'GRAY', 'jean@gray.com', '1985-04-05', 0); +INSERT INTO `ps_address` (id_address, id_country, id_customer, address1, postcode, city, deleted) VALUES (1, 8, 1, '22 rue des Peupliers', '75000', 'Paris', 0); + + +/* ********** Product delcaration ********** */ +INSERT INTO `ps_product` (id_product, id_tax, reference, price, wholesale_price, ean13, active) VALUES (1, 1, '01111', 2.1, 1.1, NULL, 1), (2, 1, '02222', 20.2, 10.2, 2222222222222, 1), (3, 1, '03333', 200.3, 100.3, 3333333333338, 1), (4, 1, '04444', 2000.4, 1000.4, 4444444444444, 1); +INSERT INTO `ps_product_lang` (id_product, id_lang, name) VALUES (1, 2, 'Stylo'), (2, 2, 'Ballon'), (3, 2, 'Ballon de Foot'), (4, 2, 'Ballon de Basket'); +/* Variation declaration */ +INSERT INTO `ps_attribute_group_lang` (id_attribute_group, id_lang, name, public_name) VALUES (1, 2, 'Taille du Ballon', 'Taille du Ballon'), (2, 2, 'Couleur', 'Couleur'); +INSERT INTO `ps_attribute` (id_attribute, id_attribute_group, color) VALUES (1, 1, NULL), (2, 1, NULL), (3, 2, '#FFFFFF'), (4, 2, '#000000'); +INSERT INTO `ps_attribute_lang` (id_attribute, id_lang, name) VALUES (1, 2, 's4'), (2, 2, 's5'), (3, 2, 'Blanc'), (4, 2, 'Noir'); +/* Mapping between product and attribute */ +INSERT INTO `ps_product_attribute` (id_product_attribute, id_product, reference, supplier_reference, location, ean13, wholesale_price, price, ecotax, quantity, weight, default_on) VALUES (1, 2, '', '', '', '', '0.000000', '0.00', '0.00', 10, 0, 0), (2, 2, '', '', '', '', '0.000000', '0.00', '0.00', 20, 0, 0), (3, 3, '', '', '', '', '0.000000', '0.00', '0.00', 30, 0, 0), (4, 3, '', '', '', '', '0.000000', '0.00', '0.00', 40, 0, 0), (5, 4, '', '', '', '', '0.000000', '0.00', '0.00', 50, 0, 0), (6, 4, '', '', '', '', '0.000000', '0.00', '0.00', 60, 0, 0), (7, 4, '', '', '', '', '0.000000', '0.00', '0.00', 70, 0, 0), (8, 4, '', '', '', '', '0.000000', '0.00', '0.00', 80, 0, 0); +INSERT INTO `ps_product_attribute_combination` (id_attribute, id_product_attribute) VALUES (1, 1), (2, 2), (3, 3), (4, 4), (1, 5), (3, 5), (1, 6), (4, 6), (2, 7), (3, 7), (2, 8), (4, 8); + +/* ********** Sale Order delcaration ********** */ +INSERT INTO `ps_orders` VALUES (1,2,2,1,1,1,1,1,'40959ebe0a5332ea6864b557ee546915','CB','carte bancaire',1,0,'','','0.00','10.49','10.49','2.10','7.98','0.00',0,0,'2010-06-14 09:00:00','2010-06-16 09:00:00',0,'2010-06-14 09:00:00','2010-06-14 09:00:00'); +INSERT INTO `ps_order_detail` VALUES (1,1,1,0,'Stylo',1,1,0,0,0,'2.100000','0.000000',NULL,'01111',NULL,0,'TVA 19.6%','19.60','0.00','',0,'2010-06-14 09:00:00'); +INSERT INTO `ps_order_history` VALUES (1,0,1,4,'2010-06-14 09:00:00'); +INSERT INTO `ps_cart` VALUES (1,2,2,1,1,1,1,1,1,0,'','2010-06-14 09:00:00','2010-06-14 09:00:00'); diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_09.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_09.sql new file mode 100644 index 0000000000000000000000000000000000000000..bb511c36965c8388ac16a14eda37d824a76c0c60 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_09.sql @@ -0,0 +1,2 @@ +/* ********** Update the Sale Order ********** */ +UPDATE ps_orders SET invoice_date = '2010-06-15 09:10:00' WHERE id_order = 1; diff --git a/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_10.sql b/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_10.sql new file mode 100644 index 0000000000000000000000000000000000000000..ecf2294613e325e4d9278b0eb41f3de05cdf7126 --- /dev/null +++ b/product/ERP5TioSafe/tests/dump/prestashop/dump_sale_order_sync_10.sql @@ -0,0 +1,2 @@ +/* ********** Delete the Sale Order ********** */ +DELETE FROM ps_orders; diff --git a/product/ERP5TioSafe/tests/testBusinessTemplateInstallation.py b/product/ERP5TioSafe/tests/testBusinessTemplateInstallation.py new file mode 100644 index 0000000000000000000000000000000000000000..6bb15beb18e664fcc39ec2cff69271dc0c4dcb6d --- /dev/null +++ b/product/ERP5TioSafe/tests/testBusinessTemplateInstallation.py @@ -0,0 +1,86 @@ +############################################################################## +# -*- coding: utf8 -*- +# Copyright (c) 2006 Nexedi SARL and Contributors. All Rights Reserved. +# Jerome Perrin <jerome@nexedi.com> +# Guy Oswald Obama <guy@nexedi.com> +# +# +############################################################################## + +"""Test suites for packaging of tiosafe +""" + +from testTioSafeMixin import testTioSafeMixin +from DateTime import DateTime +from AccessControl.SecurityManagement import newSecurityManager + +current_user_name = 'herve' + +class TestPackaging(testTioSafeMixin): + """Test business template packaging. + + Ce teste s'assure que certains éléments du site sont bien installés. Il peut + également être utilisé pour initialiser un site. + """ + + def getTitle(self): + return "TioSafe Business template packaging." + + def _createUser(self, user_name, user_groups, user_roles=['Member'], **kw): + """Create a user. + """ + kw['reference'] = user_name + #kw.setdefault('password', 'secret') + person = self.portal.person_module.newContent(**kw) + assignment = person.newContent( + portal_type='Assignment', + start_date=DateTime(), + stop_date=DateTime() + 10,) + assignment.open() + get_transaction().commit() + self.tic() + + zodb_roles = self.portal.acl_users.zodb_roles + for role in user_roles: + if role != 'Member': + zodb_roles.assignRoleToPrincipal(role, user_name) + + def loginAsUser(self, user_id): + """Login with a given user_id """ + uf = self.getPortal().acl_users + user = uf.getUserById(user_id).__of__(uf) + return newSecurityManager(None, user) + + def afterSetUp(self): + """set up """ + self._createUser(current_user_name, [], ['Author', 'Auditor', 'Assignee', + 'Assignor', 'Associate', 'Manager']) + self.loginAsUser(current_user_name) + portal = self.getPortal() + self.portal = portal + self.skin_tool = portal.portal_skins + self.workflow_tool = portal.portal_workflow + self.category_tool = portal.portal_categories + self.preferences_tool = portal.portal_preferences + + def test_skins(self): + """Test skins are present.""" + for skin_name in ( 'erp5_base', + 'erp5_pdm', + 'erp5_trade', + 'erp5_accounting', + 'erp5_invoicing', + 'erp5_simplified_invoicing', + 'erp5_syncml', + 'erp5_integration', + 'erp5_oauth', + ): + self.failUnless(skin_name in self.skin_tool.objectIds(), skin_name) + + +import unittest +def test_suite(): + suite = unittest.TestSuite() + suite.addTest(unittest.makeSuite(TestPackaging)) + return suite + diff --git a/product/ERP5TioSafe/tests/testPersonERP5Synchronization.py b/product/ERP5TioSafe/tests/testPersonERP5Synchronization.py new file mode 100644 index 0000000000000000000000000000000000000000..751d5b7e668b823adec82eb6f8b9de8da7649732 --- /dev/null +++ b/product/ERP5TioSafe/tests/testPersonERP5Synchronization.py @@ -0,0 +1,390 @@ +############################################################################## +# +# Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved. +# Hervé Poulain <herve@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +import transaction +from DateTime import DateTime +from Products.ERP5TioSafe.tests.testPrestashopMixin import testPrestashopMixin + +class testPersonERP5Synchronization(testPrestashopMixin): + """ This class allows to check different cases of Person's sync. """ + def afterSetUp(self): + """ This method is called after the SetUp method. """ + # Shortcut for modules and tools + self.person_module = self.portal.person_module + self.connection = self.portal.erp5_sql_connection + self.prestashop = self.portal.portal_integrations.prestashop + self.root_xml = '<directory>\n%s\n</directory>' + + def test_PrestashopSimplestXMLSync(self): + """ This test checks the person sync with the simplest XML. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.loadSQLDump( + self.connection, + '%s/dump_person_sync_01.sql' % self.ps_dump_path, + ) + transaction.commit() + self.tic() + + # Run the sync of persons and check person's data after sync + self.assertEqual(len(self.person_module.contentValues()), 0) + self.loadSync([self.prestashop.person_module, ]) + self.assertEqual(len(self.person_module.contentValues()), 1) + person = self.person_module.contentValues()[0] + self.assertEqual(person.getTitle(), 'John DOE') + self.assertEqual(person.getFirstName(), 'John') + self.assertEqual(person.getLastName(), 'DOE') + self.assertEqual(person.getDefaultEmailText(), 'john@doe.com') + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml=self.root_xml % person.Node_asTioSafeXML(), + tiosafe_xml=self.root_xml % self.prestashop.person_module()[0].asXML(), + xsd_path='../XSD/nodes.xsd', + ) + + def test_PrestashopPersonWithSingleAddressSync(self): + """ This test checks the person sync with an address. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.initMapping(self.prestashop) + self.loadSQLDump( + self.connection, + '%s/dump_person_sync_02.sql' % self.ps_dump_path, + ) + transaction.commit() + self.tic() + + # Run the sync of persons and check person's data after sync + self.assertEqual(len(self.person_module.contentValues()), 0) + self.loadSync([self.prestashop.person_module, ]) + self.assertEqual(len(self.person_module.contentValues()), 1) + person = self.person_module.contentValues()[0] + self.assertEqual(person.getTitle(), 'Jean GRAY') + self.assertEqual(person.getFirstName(), 'Jean') + self.assertEqual(person.getLastName(), 'GRAY') + self.assertEqual(person.getDefaultEmailText(), 'jean@gray.com') + self.assertEqual(str(person.getStartDate()), str(DateTime('1985-04-05'))) + self.assertEqual(len(person.searchFolder(portal_type='Address')), 1) + self.assertEqual( + person.getDefaultAddressStreetAddress(), + '22 rue des Peupliers', + ) + self.assertEqual(person.getDefaultAddressZipCode(), '75000') + self.assertEqual(person.getDefaultAddressCity(), 'Paris') + self.assertEqual(person.getDefaultAddressRegionTitle(), 'France') + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml=self.root_xml % person.Node_asTioSafeXML(), + tiosafe_xml=self.root_xml % self.prestashop.person_module()[0].asXML(), + xsd_path='../XSD/nodes.xsd', + ) + + def test_PrestashopPersonWithMultipleAddressSync(self): + """ This test checks the person sync with the simplest XML. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.initMapping(self.prestashop) + self.loadSQLDump( + self.connection, + '%s/dump_person_sync_03.sql' % self.ps_dump_path, + ) + transaction.commit() + self.tic() + + # Run the sync of persons and check person's data after sync + self.assertEqual(len(self.person_module.contentValues()), 0) + self.loadSync([self.prestashop.person_module, ]) + self.assertEqual(len(self.person_module.contentValues()), 1) + person = self.person_module.contentValues()[0] + self.assertEqual(person.getTitle(), 'Jenifer-Dylan COX') + self.assertEqual(person.getFirstName(), 'Jenifer-Dylan') + self.assertEqual(person.getLastName(), 'COX') + self.assertEqual(person.getDefaultEmailText(), 'jenifer-dylan@cox.com') + self.assertEqual(str(person.getStartDate()), str(DateTime('2008-06-06'))) + self.assertEqual(len(person.searchFolder(portal_type='Address')), 3) + for address in person.searchFolder(portal_type='Address'): + index = address.getId() + if index == 'default_address': + self.assertEqual( + address.getStreetAddress(), + '123 boulevard des Capucines', + ) + self.assertEqual(address.getZipCode(), '72160') + self.assertEqual(address.getCity(), 'Stuttgart') + self.assertEqual(address.getRegionTitle(), 'Allemagne') + elif index == '2': + self.assertEqual( + address.getStreetAddress(), + '234 rue de la Paix', + ) + self.assertEqual(address.getZipCode(), '75000') + self.assertEqual(address.getCity(), 'Paris') + self.assertEqual(address.getRegionTitle(), 'France') + elif index == '3': + self.assertEqual(address.getStreetAddress(), '345 avenue des Fleurs') + self.assertEqual(address.getZipCode(), '44001') + self.assertEqual(address.getCity(), 'Dortmund') + self.assertEqual(address.getRegionTitle(), 'Allemagne') + else: + raise ValueError, 'Can not check the address: %s of the person: %s' % \ + (address.getId(), person.getTitle()) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml=self.root_xml % person.Node_asTioSafeXML(), + tiosafe_xml=self.root_xml % self.prestashop.person_module()[0].asXML(), + xsd_path='../XSD/nodes.xsd', + ) + + def test_PrestashopPersonWithAddressNoMappingSync(self): + """ This test checks the person sync with an address and no mapping. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.loadSQLDump( + self.connection, + '%s/dump_person_sync_04.sql' % self.ps_dump_path, + ) + transaction.commit() + self.tic() + + # Check that an empty mapping is created in integration site + self.assertTrue(self.prestashop.get('Country', None) is None) + # Run the sync of persons and check person's data after sync + self.assertEqual(len(self.person_module.contentValues()), 0) + self.loadSync([self.prestashop.person_module, ]) + self.assertEqual(len(self.person_module.contentValues()), 0) + + def test_PrestashopDeletePerson(self): + """ Check that the delete during a person's sync invalidate the person. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.loadSQLDump( + self.connection, + '%s/dump_person_sync_05.sql' % self.ps_dump_path, + ) + transaction.commit() + self.tic() + + # Run the sync of persons + self.assertEqual(len(self.person_module.contentValues()), 0) + self.loadSync([self.prestashop.person_module, ]) + self.assertEqual(len(self.person_module.contentValues()), 3) + # Move the persons as draft, validated and invalidated state + john_doe = self.person_module.searchFolder( + portal_type='Person', + title='John DOE', + )[0].getObject() + jane_doe = self.person_module.searchFolder( + portal_type='Person', + title='Jane DOE', + )[0].getObject() + if jane_doe.getValidationState() != "validated": + jane_doe.validate() + dan_doe = self.person_module.searchFolder( + portal_type='Person', + title='Dan DOE', + )[0].getObject() + if dan_doe.getValidationState() != "validated": + dan_doe.validate() + dan_doe.invalidate() + # Remove the persons in prestashop and check that after sync the state + self.loadSQLDump( + self.connection, + '%s/dump_person_sync_06.sql' % self.ps_dump_path, + ) + transaction.commit() + self.tic() + self.assertEqual(john_doe.getValidationState(), 'validated') + self.assertEqual(jane_doe.getValidationState(), 'validated') + self.assertEqual(dan_doe.getValidationState(), 'invalidated') + self.loadSync([self.prestashop.person_module, ]) + self.assertEqual(len(self.person_module.contentValues()), 3) + self.assertEqual(john_doe.getValidationState(), 'invalidated') + self.assertEqual(jane_doe.getValidationState(), 'invalidated') + self.assertEqual(dan_doe.getValidationState(), 'invalidated') + + def test_PrestashopUpdateSimpleElement(self): + """ This test checks the simple update after sync of persons. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.initMapping(self.prestashop) + self.loadSQLDump( + self.connection, + '%s/dump_person_sync_07.sql' % self.ps_dump_path, + ) + transaction.commit() + self.tic() + + # Run the sync of persons and check person's data after sync + self.assertEqual(len(self.person_module.contentValues()), 0) + self.loadSync([self.prestashop.person_module, ]) + self.assertEqual(len(self.person_module.contentValues()), 1) + person = self.person_module.contentValues()[0] + self.assertEqual(person.getTitle(), 'Chris TURK') + self.assertEqual(person.getFirstName(), 'Chris') + self.assertEqual(person.getLastName(), 'TURK') + self.assertEqual(person.getDefaultEmailText(), 'chris@turk.com') + self.assertEqual(str(person.getStartDate()), str(DateTime('1980-06-22'))) + self.assertEqual(len(person.searchFolder(portal_type='Address')), 1) + self.assertEqual( + person.getDefaultAddressStreetAddress(), + '22 rue des Peupliers', + ) + self.assertEqual(person.getDefaultAddressZipCode(), '75000') + self.assertEqual(person.getDefaultAddressCity(), 'Paris') + self.assertEqual(person.getDefaultAddressRegionTitle(), 'France') + # Update the data, run the sync and check the data after the update + self.loadSQLDump( + self.connection, + '%s/dump_person_sync_08.sql' % self.ps_dump_path, + ) + self.loadSync([self.prestashop.person_module, ]) + self.assertEqual(len(self.person_module.contentValues()), 1) + self.assertEqual(person.getTitle(), 'Chris TURK') + self.assertEqual(person.getFirstName(), 'Chris') + self.assertEqual(person.getLastName(), 'TURK') + self.assertEqual(person.getDefaultEmailText(), 'chris@turk.com') + self.assertEqual(str(person.getStartDate()), str(DateTime('1974-06-22'))) + self.assertEqual(len(person.searchFolder(portal_type='Address')), 1) + self.assertEqual( + person.getDefaultAddressStreetAddress(), + '22 rue des Peupliers', + ) + self.assertEqual(person.getDefaultAddressZipCode(), '75000') + self.assertEqual(person.getDefaultAddressCity(), 'Paris') + self.assertEqual(person.getDefaultAddressRegionTitle(), 'France') + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml=self.root_xml % person.Node_asTioSafeXML(), + tiosafe_xml=self.root_xml % self.prestashop.person_module()[0].asXML(), + xsd_path='../XSD/nodes.xsd', + ) + + def test_PrestashopComplexeUpdateElement(self): + """ + This test checks the complexe update after sync of persons. + It updates some element, adds others and removes the last. + """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.initMapping(self.prestashop) + self.loadSQLDump( + self.connection, + '%s/dump_person_sync_09.sql' % self.ps_dump_path, + ) + transaction.commit() + self.tic() + + # Run the sync of persons and check person's data after sync + self.assertEqual(len(self.person_module.contentValues()), 0) + self.loadSync([self.prestashop.person_module, ]) + self.assertEqual(len(self.person_module.contentValues()), 1) + person = self.person_module.contentValues()[0] + self.assertEqual(person.getTitle(), 'Perry COX') + self.assertEqual(person.getFirstName(), 'Perry') + self.assertEqual(person.getLastName(), 'COX') + self.assertEqual(person.getDefaultEmailText(), 'perry@cox.com') + self.assertEqual(str(person.getStartDate()), str(DateTime('1959-08-03'))) + address_list = person.searchFolder( + portal_type='Address', + sort_on=(['id', 'ASC'], ), + ) + self.assertEqual(len(address_list), 2) + for index, address in enumerate(address_list): + if index == 0: + self.assertEqual(address.getStreetAddress(), '789 avenue des Fleurs') + self.assertEqual(address.getZipCode(), '44001') + self.assertEqual(address.getCity(), 'Dortmund') + self.assertEqual(address.getRegionTitle(), 'Allemagne') + elif index == 1: + self.assertEqual(address.getStreetAddress(), '456 rue de la Paix') + self.assertEqual(address.getZipCode(), '75000') + self.assertEqual(address.getCity(), 'Paris') + self.assertEqual(address.getRegionTitle(), 'France') + else: + raise ValueError, 'Can not check the address: %s of the person: %s' % \ + (index, person.getTitle()) + # The first update check remove of simple element, remove an address + self.loadSQLDump( + self.connection, + '%s/dump_person_sync_10.sql' % self.ps_dump_path, + ) + self.loadSync([self.prestashop.person_module, ]) + self.assertEqual(person.getTitle(), 'Perry COX') + self.assertEqual(person.getFirstName(), 'Perry') + self.assertEqual(person.getLastName(), 'COX') + self.assertEqual(person.getDefaultEmailText(), 'perry@cox.com') + self.assertEqual(person.getStartDate(), None) + self.assertEqual(len(person.searchFolder(portal_type='Address')), 1) + self.assertEqual( + person.getDefaultAddressStreetAddress(), + '123 boulevard des Capucines', + ) + self.assertEqual(person.getDefaultAddressZipCode(), '72160') + self.assertEqual(person.getDefaultAddressCity(), 'Stuttgart') + self.assertEqual(person.getDefaultAddressRegionTitle(), 'Allemagne') + # The second update check the add of a simple element and the add of + # address + self.loadSQLDump( + self.connection, + '%s/dump_person_sync_11.sql' % self.ps_dump_path, + ) + self.loadSync([self.prestashop.person_module, ]) + self.assertEqual(person.getTitle(), 'Perry COX') + self.assertEqual(person.getFirstName(), 'Perry') + self.assertEqual(person.getLastName(), 'COX') + self.assertEqual(person.getDefaultEmailText(), 'perry@cox.com') + self.assertEqual(str(person.getStartDate()), str(DateTime('1959-08-03'))) + address_list = person.searchFolder( + portal_type='Address', + sort_on=(['id', 'ASC'], ), + ) + self.assertEqual(len(address_list), 2) + for index, address in enumerate(address_list): + if index == 0: + self.assertEqual(address.getStreetAddress(), '789 avenue des Fleurs') + self.assertEqual(address.getZipCode(), '44001') + self.assertEqual(address.getCity(), 'Dortmund') + self.assertEqual(address.getRegionTitle(), 'Allemagne') + elif index == 1: + self.assertEqual( + address.getStreetAddress(), + '123 boulevard des Capucines', + ) + self.assertEqual(address.getZipCode(), '72160') + self.assertEqual(address.getCity(), 'Stuttgart') + self.assertEqual(address.getRegionTitle(), 'Allemagne') + else: + raise ValueError, 'Can not check the address: %s of the person: %s' % \ + (index, person.getTitle()) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml=self.root_xml % person.Node_asTioSafeXML(), + tiosafe_xml=self.root_xml % self.prestashop.person_module()[0].asXML(), + xsd_path='../XSD/nodes.xsd', + ) + diff --git a/product/ERP5TioSafe/tests/testPersonPrestashopSynchronization.py b/product/ERP5TioSafe/tests/testPersonPrestashopSynchronization.py new file mode 100644 index 0000000000000000000000000000000000000000..d9834066a14ba35a4ac4f2cb5df4d7044b2288db --- /dev/null +++ b/product/ERP5TioSafe/tests/testPersonPrestashopSynchronization.py @@ -0,0 +1,302 @@ +############################################################################## +# +# Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved. +# Hervé Poulain <herve@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +import transaction +from Products.ERP5TioSafe.tests.testPrestashopMixin import testPrestashopMixin + +class testPersonPrestashopSynchronization(testPrestashopMixin): + """ This class allows to check different cases of Person's sync. """ + def afterSetUp(self): + """ This method is called after the SetUp method. """ + # Shortcut for modules and tools + self.person_module = self.portal.person_module + self.portal_sync= self.portal.portal_synchronizations + self.prestashop = self.portal.portal_integrations.prestashop + self.root_xml = '<directory>\n%s\n</directory>' + + def test_PrestashopSimplestXMLSync(self): + """ This test checks the person sync with the simplest XML. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + person = self.person_module.newContent( + portal_type='Person', + title='John DOE', + first_name='John', + last_name='DOE', + default_email_text='john@doe.com', + career_role_list = ['client'], + ) + person.validate() + transaction.commit() + self.tic() + + # Run the sync of persons and check person's data after sync + self.assertEqual(len(self.prestashop.person_module()), 0) + self.loadSync([self.prestashop.person_module, ]) + self.assertEqual(len(self.prestashop.person_module()), 1) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.person_module()[0].asXML(), + tiosafe_xml=self.root_xml % person.Node_asTioSafeXML(), + xsd_path='../XSD/nodes.xsd', + ) + + def test_PrestashopPersonWithSingleAddressSync(self): + """ This test checks the person sync with an address. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.initMapping(self.prestashop) + person = self.person_module.newContent( + portal_type='Person', + title='Jean GRAY', + first_name='Jean', + last_name='GRAY', + start_date='1985-04-05', + default_email_text='jean@gray.com', + career_role_list = ['client'], + ) + person.setDefaultAddressStreetAddress('22 rue des Peupliers') + person.setDefaultAddressZipCode('75000') + person.setDefaultAddressCity('Paris') + person.setDefaultAddressRegion('france') + person.validate() + transaction.commit() + self.tic() + + # Run the sync of persons and check person's data after sync + self.assertEqual(len(self.prestashop.person_module()), 0) + self.loadSync([self.prestashop.person_module, ]) + self.assertEqual(len(self.prestashop.person_module()), 1) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.person_module()[0].asXML(), + tiosafe_xml=self.root_xml % person.Node_asTioSafeXML(), + xsd_path='../XSD/nodes.xsd', + ) + + def test_PrestashopPersonWithMultipleAddressSync(self): + """ This test checks the person sync with the simplest XML. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.initMapping(self.prestashop) + person = self.person_module.newContent( + portal_type='Person', + title='Jenifer-Dylan COX', + first_name='Jenifer-Dylan', + last_name='COX', + start_date='2008-06-06', + default_email_text='jenifer-dylan@cox.com', + career_role_list = ['client'], + ) + # default address + person.setDefaultAddressStreetAddress('123 boulevard des Capucines') + person.setDefaultAddressZipCode('72160') + person.setDefaultAddressCity('Stuttgart') + person.setDefaultAddressRegion('europe/western_europe/allemagne') + person.validate() + # second address + person.newContent( + portal_type='Address', + id='2', + street_address='234 rue de la Paix', + zip_code='75000', + city='Paris', + region='france', + ) + # third address + person.newContent( + portal_type='Address', + id='3', + street_address='345 avenue des Fleurs', + zip_code='44001', + city='Dortmund', + region='europe/western_europe/allemagne', + ) + transaction.commit() + self.tic() + + # Run the sync of persons and check person's data after sync + self.assertEqual(len(self.prestashop.person_module()), 0) + self.loadSync([self.prestashop.person_module, ]) + self.assertEqual(len(self.prestashop.person_module()), 1) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.person_module()[0].asXML(), + tiosafe_xml=self.root_xml % person.Node_asTioSafeXML(), + xsd_path='../XSD/nodes.xsd', + ) + + def test_PrestashopDeletePerson(self): + """ Check that the delete during a person's sync invalidate the person. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + person = self.person_module.newContent( + portal_type='Person', + title='John DOE', + first_name='John', + last_name='DOE', + default_email_text='john@doe.com', + career_role_list = ['client'], + ) + person.validate() + transaction.commit() + self.tic() + + # Run the sync of persons + self.assertEqual(len(self.prestashop.person_module()), 0) + self.loadSync([self.prestashop.person_module, ]) + self.assertEqual(len(self.prestashop.person_module()), 1) + # Remove the persons in ERP5 and check that after sync in prestashop + self.person_module.manage_delObjects([person.getId(), ]) + self.loadSync([self.prestashop.person_module, ]) + self.assertEqual(len(self.person_module.contentValues()), 0) + + def test_PrestashopUpdateSimpleElement(self): + """ This test checks the simple update after sync of persons. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.initMapping(self.prestashop) + person = self.person_module.newContent( + portal_type='Person', + title='Chris TURK', + first_name='Chris', + last_name='TURK', + default_email_text='chris@turk.com', + default_address_street_address='22 rue des Peupliers', + default_address_zip_code='75000', + default_address_city='Paris', + default_address_region='france', + career_role_list = ['client'], + ) + person.validate() + transaction.commit() + self.tic() + + # Run the sync of persons and check person's data after sync + self.assertEqual(len(self.prestashop.person_module()), 0) + self.loadSync([self.prestashop.person_module, ]) + self.assertEqual(len(self.prestashop.person_module()), 1) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.person_module()[0].asXML(), + tiosafe_xml=self.root_xml % person.Node_asTioSafeXML(), + xsd_path='../XSD/nodes.xsd', + ) + # Update the data, run the sync and check the data after the update + person.setStartDate('1974-06-22') + self.loadSync([self.prestashop.person_module, ]) + self.assertEqual(len(self.prestashop.person_module()), 1) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.person_module()[0].asXML(), + tiosafe_xml=self.root_xml % person.Node_asTioSafeXML(), + xsd_path='../XSD/nodes.xsd', + ) + + def test_PrestashopComplexeUpdateElement(self): + """ + This test checks the complexe update after sync of persons. + It updates some element, adds others and removes the last. + """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.initMapping(self.prestashop) + person = self.person_module.newContent( + portal_type='Person', + title='Perry COX', + first_name='Perry', + last_name='COX', + default_email_text='perry@cox.com', + start_date='1959-08-03', + default_address_street_address='456 rue de la Paix', + default_address_zip_code='75000', + default_address_city='Paris', + default_address_region='france', + career_role_list = ['client'], + ) + person.validate() + address2 = person.newContent( + portal_type='Address', + street_address='789 avenue des Fleurs', + zip_code='44001', + city='Dortmund', + region='europe/western_europe/allemagne', + ) + transaction.commit() + self.tic() + + # Run the sync of persons and check person's data after sync + self.assertEqual(len(self.prestashop.person_module()), 0) + self.loadSync([self.prestashop.person_module, ]) + self.assertEqual(len(self.prestashop.person_module()), 1) + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.person_module()[0].asXML(), + tiosafe_xml=self.root_xml % person.Node_asTioSafeXML(), + xsd_path='../XSD/nodes.xsd', + ) + # The first update check remove of simple element, remove an address + person.setStartDate(None) + person.manage_delObjects([address2.getId(), ]) + person.setDefaultAddressStreetAddress('123 boulevard des Capucines') + person.setDefaultAddressZipCode('72160') + self.loadSync([self.prestashop.person_module, ]) + self.assertEqual(len(self.prestashop.person_module()), 1) + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.person_module()[0].asXML(), + tiosafe_xml=self.root_xml % person.Node_asTioSafeXML(), + xsd_path='../XSD/nodes.xsd', + ) + # The second update check the add of a simple element and the add of + # address + person.setStartDate('1959-08-03') # TODO: Why it doesn't work ??? + person.setDefaultAddressCity('Stuttgart') + address2 = person.newContent( + portal_type='Address', + street_address='789 avenue des Fleurs', + zip_code='44001', + city='Dortmund', + region='europe/western_europe/allemagne', + ) + self.loadSync([self.prestashop.person_module, ]) + self.assertEqual(len(self.prestashop.person_module()), 1) + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.person_module()[0].asXML(), + tiosafe_xml=self.root_xml % person.Node_asTioSafeXML(), + xsd_path='../XSD/nodes.xsd', + ) + # The third update check the remove of element in addresses + person.setDefaultAddressZipCode('73000') + address2.setCity('Munich') + self.loadSync([self.prestashop.person_module, ]) + self.assertEqual(len(self.prestashop.person_module()), 1) + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.person_module()[0].asXML(), + tiosafe_xml=self.root_xml % person.Node_asTioSafeXML(), + xsd_path='../XSD/nodes.xsd', + ) + diff --git a/product/ERP5TioSafe/tests/testPrestashopMixin.py b/product/ERP5TioSafe/tests/testPrestashopMixin.py new file mode 100644 index 0000000000000000000000000000000000000000..a6b20bee085aaa2fad0a6abd56a87955b6611f88 --- /dev/null +++ b/product/ERP5TioSafe/tests/testPrestashopMixin.py @@ -0,0 +1,78 @@ +############################################################################## +# +# Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved. +# Aurelien Calonne <aurel@nexedi.com> +# Hervé Poulain <herve@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +import os +import transaction +from Products.ERP5TioSafe.tests.testTioSafeMixin import testTioSafeMixin + +class testPrestashopMixin(testTioSafeMixin): + """ This class provides the Prestashop generics elements. """ + + def getBusinessTemplateList(self): + """ Return the list of BT required by unit tests. """ + return ( + 'erp5_base', + 'erp5_pdm', + 'erp5_trade', + 'erp5_simulation', + 'erp5_simulation_legacy', + 'erp5_trade_simulation_legacy', + 'erp5_syncml', + 'erp5_tiosafe_core', + 'erp5_tiosafe_prestashop', + 'erp5_tiosafe_test', + ) + + def initPrestashopTest(self): + """ This method is called after the SetUp method. """ + # Declare some shortcuts + self.prestashop = self.portal.portal_integrations.prestashop + # Path for integration site dump + self.ps_dump_path = 'dump/prestashop' + # Init the prestashop database + self.loadSQLDump( + self.portal.erp5_sql_connection, + 'dump/prestashop/dump_00_init_tables.sql', + ) + # set the language used by prestashop + self.prestashop.setLanguage(2) + # Update the connection to use the PHPUnitTestConnection + url = os.path.dirname(__file__) + url = url.split('/ERP5TioSafe/')[0] + '/ERP5TioSafe' + url += '/plugins/prestashop/modules/oneclickconnect' + connection_plugin = self.getConnectionPlugin(self.prestashop) + connection_plugin.setUrlString(url) + connection_plugin.setTransport('php_unit_test') + self.updateSynchronizationObjects() + self.organisation = self.portal.organisation_module.tiosafe_default_organisation + self.prestashop.recursiveReindexObject() + transaction.commit() + self.tic() + + diff --git a/product/ERP5TioSafe/tests/testProductERP5Synchronization.py b/product/ERP5TioSafe/tests/testProductERP5Synchronization.py new file mode 100644 index 0000000000000000000000000000000000000000..f5ffe31c9b3df8904adbe06e52d2fa47f360c84d --- /dev/null +++ b/product/ERP5TioSafe/tests/testProductERP5Synchronization.py @@ -0,0 +1,737 @@ +############################################################################## +# +# Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved. +# Hervé Poulain <herve@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +import transaction +from Products.ERP5TioSafe.tests.testPrestashopMixin import testPrestashopMixin + +class testProductERP5Synchronization(testPrestashopMixin): + """ This class allows to check different cases of Product's sync. """ + def afterSetUp(self): + """ This method is called after the SetUp method. """ + # Shortcut for modules and tools + self.product_module = self.portal.product_module + self.portal_categories = self.portal.portal_categories + self.portal_sync = self.portal.portal_synchronizations + self.connection = self.portal.erp5_sql_connection + self.prestashop = self.portal.portal_integrations.prestashop + self.root_xml = '<catalog>\n%s\n</catalog>' + + def test_PrestashopSimplestXMLSync(self): + """ This test checks the product sync with the simplest XML. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.loadSQLDump( + self.connection, + '%s/dump_product_sync_01.sql' % self.ps_dump_path, + ) + transaction.commit() + self.tic() + + # Run the sync of products and check product's data after sync + self.assertEqual(len(self.product_module.contentValues()), 0) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.product_module.contentValues()), 1) + product = self.product_module.contentValues()[0] + self.assertEqual(product.getTitle(), 'Tee-Shirt') + self.assertEqual(product.getReference(), 'my_ref') + self.assertEqual(product.getUse(), 'sale') + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml= self.root_xml % product.Resource_asTioSafeXML(), + tiosafe_xml=self.root_xml % self.prestashop.product_module()[0].asXML(), + xsd_path='../XSD/resources.xsd', + ) + + def test_PrestashopIndividualVariationSync(self): + """ This test check the product sync with individual variations. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.loadSQLDump( + self.connection, + '%s/dump_product_sync_02.sql' % self.ps_dump_path, + ) + # Define the specific mapping, initMapping declare the categories in ERP5 + self.initMapping() + mapping_dict_list = [ + { 'title': 'Taille du Ballon', + 'path': 'TailleduBallon', + 'source_reference': 'Taille du Ballon', + 'destination_reference':'ball_size', }, + { 'title': 'Couleur', + 'path': 'Couleur', + 'source_reference': 'Couleur', + 'destination_reference': 'colour', }, + ] + for mapping in mapping_dict_list: + self.createMapping(integration_site=self.prestashop, **mapping) + transaction.commit() + self.tic() + + # Run the sync of products and check product's data after sync + self.assertEqual(len(self.product_module.contentValues()), 0) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.product_module.contentValues()), 1) + product = self.product_module.contentValues()[0] + self.assertEqual(product.getTitle(), 'Ballon de Foot') + self.assertEqual(product.getReference(), '0123456789') + self.assertEqual(product.getEan13Code(), '1234567890128') + self.assertEqual(product.getUse(), 'sale') + # Check the individual variations + # FIXME: When no mapping is created between ERP5 and Prestashop, the full + # variation is created as individual variation, ie: + # Ball Size/s4 and Ball Size/s5 will be an individual variations, + individual_variation_list = product.searchFolder( + portal_type='Product Individual Variation', + sort_on=(['id', 'ASC'], ), + ) + self.assertEqual(len(individual_variation_list), 4) + for individual_variation in individual_variation_list: + # Use shortcut for the checking + individual_variation = individual_variation.getObject() + title = individual_variation.getTitle() + base_category_list = individual_variation.getVariationBaseCategoryList() + index = individual_variation.getId() + # check through the order + if index == '1': + self.assertEqual(title, 's4') + self.assertEqual(base_category_list, ['ball_size', ]) + elif index == '2': + self.assertEqual(title, 's5') + self.assertEqual(base_category_list, ['ball_size', ]) + elif index == '3': + self.assertEqual(title, 'Blanc') + self.assertEqual(base_category_list, ['colour', ]) + elif index == '4': + self.assertEqual(title, 'Noir') + self.assertEqual(base_category_list, ['colour', ]) + else: + raise ValueError, 'Can not check variation: %s of the product: %s' % \ + (index, product.getTitle()) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml= self.root_xml % product.Resource_asTioSafeXML(), + tiosafe_xml=self.root_xml % self.prestashop.product_module()[0].asXML(), + xsd_path='../XSD/resources.xsd', + ) + + def test_PrestashopSharedVariationSync(self): + """ This test check the product sync with shared variations. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.loadSQLDump( + self.connection, + '%s/dump_product_sync_02.sql' % self.ps_dump_path, + ) + self.initMapping(self.prestashop) + transaction.commit() + self.tic() + + # Run the sync of products and check product's data after sync + self.assertEqual(len(self.product_module.contentValues()), 0) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.product_module.contentValues()), 1) + product = self.product_module.contentValues()[0] + self.assertEqual(product.getTitle(), 'Ballon de Foot') + self.assertEqual(product.getReference(), '0123456789') + self.assertEqual(product.getEan13Code(), '1234567890128') + self.assertEqual(product.getUse(), 'sale') + # Check the shared variations + self.assertEqual( + product.contentValues(portal_type='Product Individual Variation'), + [], + ) + sorted_shared_category_list = product.getVariationCategoryList() + sorted_shared_category_list.sort() + self.assertEqual(len(sorted_shared_category_list), 4) + for i, variation in enumerate(sorted_shared_category_list): + if i == 0: + self.assertEqual(variation, 'ball_size/x4') + elif i == 1: + self.assertEqual(variation, 'ball_size/x5') + elif i == 2: + self.assertEqual(variation, 'colour/black') + elif i == 3: + self.assertEqual(variation, 'colour/white') + else: + raise ValueError, 'Can not check variation: %s of the product: %s' % \ + (variation, product.getTitle()) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml= self.root_xml % product.Resource_asTioSafeXML(), + tiosafe_xml=self.root_xml % self.prestashop.product_module()[0].asXML(), + xsd_path='../XSD/resources.xsd', + ) + + def test_PrestashopDifferentKindVariationsSync(self): + """ This test check the product sync with the two kind of variations. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.loadSQLDump( + self.connection, + '%s/dump_product_sync_02.sql' % self.ps_dump_path, + ) + # Define the specific mapping, initMapping declare the categories in ERP5 + self.initMapping() + mapping_dict_list = [ + { 'title': 'Taille du Ballon', + 'path': 'TailleduBallon', + 'source_reference': 'Taille du Ballon', + 'destination_reference':'ball_size', }, + { 'title': 'Couleur', + 'path': 'Couleur', + 'source_reference': 'Couleur', + 'destination_reference': 'colour', }, + { 'title': 'Blanc', + 'path': 'Couleur/Blanc', + 'source_reference': 'Blanc', + 'destination_reference': 'white', }, + { 'title': 'Noir', + 'path': 'Couleur/Noir', + 'source_reference': 'Noir', + 'destination_reference': 'black', }, + ] + for mapping in mapping_dict_list: + self.createMapping(integration_site=self.prestashop, **mapping) + transaction.commit() + self.tic() + + # Run the sync of products and check product's data after sync + self.assertEqual(len(self.product_module.contentValues()), 0) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.product_module.contentValues()), 1) + product = self.product_module.contentValues()[0] + self.assertEqual(product.getTitle(), 'Ballon de Foot') + self.assertEqual(product.getReference(), '0123456789') + self.assertEqual(product.getEan13Code(), '1234567890128') + self.assertEqual(product.getUse(), 'sale') + # Check the shared variations + sorted_shared_category_list = product.getVariationCategoryList() + sorted_shared_category_list.sort() + self.assertEqual(len(sorted_shared_category_list), 2) + for i, variation in enumerate(sorted_shared_category_list): + if i == 0: + self.assertEqual(variation, 'colour/black') + elif i == 1: + self.assertEqual(variation, 'colour/white') + else: + raise ValueError, 'Can not check variation: %s of the product: %s' % \ + (variation, product.getTitle()) + individual_variation_list = product.searchFolder( + portal_type='Product Individual Variation', + sort_on=(['id', 'ASC'], ), + ) + self.assertEqual(len(individual_variation_list), 2) + for individual_variation in individual_variation_list: + # Use shortcut for the checking + individual_variation = individual_variation.getObject() + title = individual_variation.getTitle() + base_category_list = individual_variation.getVariationBaseCategoryList() + index = individual_variation.getId() + # check through the order + if index == '1': + self.assertEqual(title, 's4') + self.assertEqual(base_category_list, ['ball_size']) + elif index == '2': + self.assertEqual(title, 's5') + self.assertEqual(base_category_list, ['ball_size']) + else: + raise ValueError, 'Can not check variation: %s of the product: %s' % \ + (index, product.getTitle()) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml= self.root_xml % product.Resource_asTioSafeXML(), + tiosafe_xml=self.root_xml % self.prestashop.product_module()[0].asXML(), + xsd_path='../XSD/resources.xsd', + ) + + def test_PrestashopMultipleSync(self): + """ This test check the multiple product sync. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.loadSQLDump( + self.connection, + '%s/dump_product_sync_03.sql' % self.ps_dump_path, + ) + # Define the specific mapping, initMapping declare the categories in ERP5 + self.initMapping() + mapping_dict_list = [ + { 'title': 'Taille du Ballon', + 'path': 'TailleduBallon', + 'source_reference': 'Taille du Ballon', + 'destination_reference':'ball_size', }, + { 'title': 'Couleur', + 'path': 'Couleur', + 'source_reference': 'Couleur', + 'destination_reference': 'colour', }, + { 'title': 'Blanc', + 'path': 'Couleur/Blanc', + 'source_reference': 'Blanc', + 'destination_reference': 'white', }, + { 'title': 'Noir', + 'path': 'Couleur/Noir', + 'source_reference': 'Noir', + 'destination_reference': 'black', }, + ] + for mapping in mapping_dict_list: + self.createMapping(integration_site=self.prestashop, **mapping) + transaction.commit() + self.tic() + + # Run the sync of products and check product's data after sync + self.assertEqual(len(self.product_module.contentValues()), 0) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.product_module.contentValues()), 4) + # Check the product 'Stylo' + product_1 = self.product_module.searchFolder( + portal_type='Product', + title='Stylo', + )[0].getObject() + self.assertEqual(product_1.getTitle(), 'Stylo') + self.assertEqual(product_1.getReference(), '01111') + self.assertEqual(product_1.getUse(), 'sale') + # Check the product 'Ballon' + product_2 = self.product_module.searchFolder( + portal_type='Product', + title='Ballon', + )[0].getObject() + self.assertEqual(product_2.getTitle(), 'Ballon') + self.assertEqual(product_2.getReference(), '02222') + self.assertEqual(product_2.getEan13Code(), '2222222222222') + self.assertEqual(product_2.getUse(), 'sale') + self.assertEqual(product_2.getVariationCategoryList(), []) + individual_variation_list = product_2.searchFolder( + portal_type='Product Individual Variation', + sort_on=(['id', 'ASC'], ), + ) + for individual_variation in individual_variation_list: + # Use shortcut for the checking + individual_variation = individual_variation.getObject() + title = individual_variation.getTitle() + base_category_list = individual_variation.getVariationBaseCategoryList() + index = individual_variation.getId() + # check through the order + if index == '1': + self.assertEqual(title, 's4') + self.assertEqual(base_category_list, ['ball_size']) + elif index == '2': + self.assertEqual(title, 's5') + self.assertEqual(base_category_list, ['ball_size']) + else: + raise ValueError, 'Can not check variation: %s of the product: %s' % \ + (index, product_2.getTitle()) + # Check the product 'Ballon de foot' + product_3 = self.product_module.searchFolder( + portal_type='Product', + title='Ballon de Foot', + )[0].getObject() + self.assertEqual(product_3.getTitle(), 'Ballon de Foot') + self.assertEqual(product_3.getReference(), '03333') + self.assertEqual(product_3.getEan13Code(), '3333333333338') + self.assertEqual(product_3.getUse(), 'sale') + self.assertEqual( + product_3.contentValues(portal_type='Product Individual Variation'), + [], + ) + sorted_shared_category_list = product_3.getVariationCategoryList() + sorted_shared_category_list.sort() + self.assertEqual(len(sorted_shared_category_list), 2) + for i, variation in enumerate(sorted_shared_category_list): + if i == 0: + self.assertEqual(variation, 'colour/black') + elif i == 1: + self.assertEqual(variation, 'colour/white') + else: + raise ValueError, 'Can not check variation: %s of the product: %s' % \ + (variation, product_3.getTitle()) + # Check the product 'Ballon de Basket' + product_4 = self.product_module.searchFolder( + portal_type='Product', + title='Ballon de Basket', + )[0].getObject() + self.assertEqual(product_4.getTitle(), 'Ballon de Basket') + self.assertEqual(product_4.getReference(), '04444') + self.assertEqual(product_4.getEan13Code(), '4444444444444') + self.assertEqual(product_4.getUse(), 'sale') + shared_variation_list = product_4.getVariationCategoryList() + shared_variation_list.sort() + self.assertEqual(len(shared_variation_list), 2) + for i, variation in enumerate(shared_variation_list): + if i == 0: + self.assertEqual(variation, 'colour/black') + elif i == 1: + self.assertEqual(variation, 'colour/white') + else: + raise ValueError, 'Can not check variation: %s of the product: %s' % \ + (variation, product_4.getTitle()) + individual_variation_list = product_4.searchFolder( + portal_type='Product Individual Variation', + sort_on=(['id', 'ASC'], ), + ) + self.assertEqual(len(individual_variation_list), 2) + for individual_variation in individual_variation_list: + # Use shortcut for the checking + individual_variation = individual_variation.getObject() + title = individual_variation.getTitle() + base_category_list = individual_variation.getVariationBaseCategoryList() + index = individual_variation.getId() + # check through the order + if index == '1': + self.assertEqual(title, 's4') + self.assertEqual(base_category_list, ['ball_size']) + elif index == '2': + self.assertEqual(title, 's5') + self.assertEqual(base_category_list, ['ball_size']) + else: + raise ValueError, 'Can not check variation: %s of the product: %s' % \ + (index, product_4.getTitle()) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml= self.root_xml % product_1.Resource_asTioSafeXML(), + tiosafe_xml=self.root_xml % self.prestashop.product_module[1].asXML(), + xsd_path='../XSD/resources.xsd', + ) + self.checkTioSafeXML( + plugin_xml= self.root_xml % product_2.Resource_asTioSafeXML(), + tiosafe_xml=self.root_xml % self.prestashop.product_module[2].asXML(), + xsd_path='../XSD/resources.xsd', + ) + self.checkTioSafeXML( + plugin_xml= self.root_xml % product_3.Resource_asTioSafeXML(), + tiosafe_xml=self.root_xml % self.prestashop.product_module[3].asXML(), + xsd_path='../XSD/resources.xsd', + ) + self.checkTioSafeXML( + plugin_xml= self.root_xml % product_4.Resource_asTioSafeXML(), + tiosafe_xml=self.root_xml % self.prestashop.product_module[4].asXML(), + xsd_path='../XSD/resources.xsd', + ) + + def test_PrestashopDeleteProduct(self): + """ Check that delete during a product's sync invalidate the product. """ + # Initialize the instance and prestashop + product_module = self.portal.product_module + self.initPrestashopTest() + self.loadSQLDump( + self.connection, + '%s/dump_product_sync_04.sql' % self.ps_dump_path, + ) + transaction.commit() + self.tic() + + # Run the sync of products + self.assertEqual(len(self.product_module.contentValues()), 0) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.product_module.contentValues()), 3) + # Move the products as validated and invalidated state + tee_shirt = product_module.searchFolder( + portal_type='Product', + title='Tee-Shirt', + )[0].getObject() + short = product_module.searchFolder( + portal_type='Product', + title='Short', + )[0].getObject() + pull_over = product_module.searchFolder( + portal_type='Product', + title='Pull-Over', + )[0].getObject() + pull_over.invalidate() + # Remove the products in prestashop and check that after sync the states + self.loadSQLDump( + self.connection, + '%s/dump_product_sync_05.sql' % self.ps_dump_path, + ) + self.assertEqual(tee_shirt.getValidationState(), 'validated') + self.assertEqual(short.getValidationState(), 'validated') + self.assertEqual(pull_over.getValidationState(), 'invalidated') + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.product_module.contentValues()), 3) + self.assertEqual(tee_shirt.getValidationState(), 'invalidated') + self.assertEqual(short.getValidationState(), 'invalidated') + self.assertEqual(pull_over.getValidationState(), 'invalidated') + + def test_PrestashopUpdateSimpleElement(self): + """ This test checks the simple update after sync of products. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.loadSQLDump( + self.connection, + '%s/dump_product_sync_06.sql' % self.ps_dump_path, + ) + self.initMapping(self.prestashop) + transaction.commit() + self.tic() + + # Run the sync of persons and check person's data after sync + self.assertEqual(len(self.product_module.contentValues()), 0) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.product_module.contentValues()), 1) + product = self.product_module.contentValues()[0] + self.assertEqual(product.getTitle(), 'Ballon de Basket') + self.assertEqual(product.getReference(), 'b246b') + self.assertEqual(product.getEan13Code(), '1234567890128') + self.assertEqual(product.getUse(), 'sale') + base_category_list = product.getVariationBaseCategoryList() + base_category_list.sort() + self.assertEqual(len(base_category_list), 2) + self.assertEqual(base_category_list, ['ball_size', 'colour']) + variation_category_list = product.getVariationCategoryList() + variation_category_list.sort() + self.assertEqual(len(variation_category_list), 4) + self.assertEqual( + variation_category_list, + ['ball_size/x4', 'ball_size/x5', 'colour/black', 'colour/white'], + ) + # Update the data, run the sync and check the data after the update + self.loadSQLDump( + self.connection, + '%s/dump_product_sync_07.sql' % self.ps_dump_path, + ) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.product_module.contentValues()), 1) + self.assertEqual(product.getTitle(), 'Ballon de Basket') + self.assertEqual(product.getReference(), 'b246b') + self.assertEqual(product.getEan13Code(), '0987654321098') + self.assertEqual(product.getUse(), 'sale') + base_category_list = product.getVariationBaseCategoryList() + base_category_list.sort() + self.assertEqual(len(base_category_list), 2) + self.assertEqual(base_category_list, ['ball_size', 'colour']) + variation_category_list = product.getVariationCategoryList() + variation_category_list.sort() + self.assertEqual(len(variation_category_list), 4) + self.assertEqual( + variation_category_list, + ['ball_size/x4', 'ball_size/x5', 'colour/black', 'colour/white'], + ) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml= self.root_xml % product.Resource_asTioSafeXML(), + tiosafe_xml=self.root_xml % self.prestashop.product_module()[0].asXML(), + xsd_path='../XSD/resources.xsd', + ) + + def test_PrestashopComplexeUpdateElement(self): + """ + This test checks the complexe update after sync of products. + It updates some element, adds others and removes the last. + """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.loadSQLDump( + self.connection, + '%s/dump_product_sync_08.sql' % self.ps_dump_path, + ) + # Define the specific mapping, initMapping declare the categories in ERP5 + self.initMapping() + mapping_dict_list = [ + { 'title': 'Taille du Ballon', + 'path': 'TailleduBallon', + 'source_reference': 'Taille du Ballon', + 'destination_reference':'ball_size', }, + { 'title': 'Couleur', + 'path': 'Couleur', + 'source_reference': 'Couleur', + 'destination_reference': 'colour', }, + { 'title': 'Blanc', + 'path': 'Couleur/Blanc', + 'source_reference': 'Blanc', + 'destination_reference': 'white', }, + { 'title': 'Noir', + 'path': 'Couleur/Noir', + 'source_reference': 'Noir', + 'destination_reference': 'black', }, + { 'title': 'Rouge', + 'path': 'Couleur/Rouge', + 'source_reference': 'Rouge', + 'destination_reference': 'red', }, + ] + for mapping in mapping_dict_list: + self.createMapping(integration_site=self.prestashop, **mapping) + transaction.commit() + self.tic() + + # Run the sync of persons and check person's data after sync + self.assertEqual(len(self.product_module.contentValues()), 0) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.product_module.contentValues()), 1) + product = self.product_module.contentValues()[0] + self.assertEqual(product.getTitle(), 'Ballon de Plage') + self.assertEqual(product.getReference(), 'a5962z') + self.assertEqual(product.getEan13Code(), None) + self.assertEqual(product.getUse(), 'sale') + base_category_list = product.getVariationBaseCategoryList(omit_individual_variation=True) + self.assertEqual(len(base_category_list), 1) + self.assertEqual(base_category_list, ['colour']) + shared_variation_list = product.getVariationCategoryList() + shared_variation_list.sort() + self.assertEqual(len(shared_variation_list), 2) + self.assertEqual( + shared_variation_list, + ['colour/black', 'colour/white'], + ) + individual_base_category_list = product.getIndividualVariationBaseCategoryList() + self.assertEqual(len(individual_base_category_list), 1) + self.assertEqual(individual_base_category_list, ['ball_size']) + individual_variation_list = product.searchFolder( + portal_type='Product Individual Variation', + sort_on=(['id', 'ASC'], ), + ) + self.assertEqual(len(individual_variation_list), 2) + for individual_variation in individual_variation_list: + # Use shortcut for the checking + individual_variation = individual_variation.getObject() + title = individual_variation.getTitle() + base_category_list = individual_variation.getVariationBaseCategoryList() + index = individual_variation.getId() + # check through the order + if index == '1': + self.assertEqual(title, 's4') + self.assertEqual(base_category_list, ['ball_size']) + elif index == '2': + self.assertEqual(title, 's5') + self.assertEqual(base_category_list, ['ball_size']) + else: + raise ValueError, 'Can not check variation: %s of the product: %s' % \ + (individual_variation.getId(), product.getTitle()) + # The first update remove, add and update some elements but not realise an + # hard work on variations + self.loadSQLDump( + self.connection, + '%s/dump_product_sync_09.sql' % self.ps_dump_path, + ) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.product_module.contentValues()), 1) + self.assertEqual(product.getTitle(), 'Ballon de Plage') + self.assertEqual(product.getReference(), 'a5962z') + self.assertEqual(product.getEan13Code(), '1357913579130') + self.assertEqual(product.getUse(), 'sale') + base_category_list = product.getVariationBaseCategoryList() + base_category_list.sort() + self.assertEqual(len(base_category_list), 2) + self.assertEqual(base_category_list, ['ball_size', 'colour']) + shared_variation_list = product.getVariationCategoryList() + shared_variation_list.sort() + self.assertEqual(len(shared_variation_list), 2) + self.assertEqual( + shared_variation_list, + ['colour/red', 'colour/white'], + ) + individual_variation_list = product.searchFolder( + portal_type='Product Individual Variation', + sort_on=(['id', 'ASC'], ), + ) + self.assertEqual(len(individual_variation_list), 2) + for individual_variation in individual_variation_list: + # Use shortcut for the checking + individual_variation = individual_variation.getObject() + title = individual_variation.getTitle() + base_category_list = individual_variation.getVariationBaseCategoryList() + index = individual_variation.getId() + # check through the order + if index == '1': + self.assertEqual(title, 's4') + self.assertEqual(base_category_list, ['ball_size']) + elif index == '2': + self.assertEqual(title, 's6') + self.assertEqual(base_category_list, ['ball_size']) + else: + raise ValueError, 'Can not check variation: %s of the product: %s' % \ + (index, product.getTitle()) + # The second update remove variations (individuals and shareds) + self.loadSQLDump( + self.connection, + '%s/dump_product_sync_10.sql' % self.ps_dump_path, + ) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.product_module.contentValues()), 1) + base_category_list = product.getVariationBaseCategoryList() + base_category_list.sort() + self.assertEqual(len(base_category_list), 2) + self.assertEqual(base_category_list, ['ball_size', 'colour']) + shared_variation_list = product.getVariationCategoryList() + shared_variation_list.sort() + self.assertEqual(len(shared_variation_list), 1) + self.assertEqual(shared_variation_list, ['colour/white', ]) + individual_variation_list = product.searchFolder( + portal_type='Product Individual Variation', + sort_on=(['id', 'ASC'], ), + ) + self.assertEqual(len(individual_variation_list), 1) + individual_variation = individual_variation_list[0].getObject() + self.assertEqual(individual_variation.getTitle(), 's4') + self.assertEqual( + individual_variation.getVariationBaseCategoryList(), ['ball_size'], + ) + # The third update allows to add variations (individuals and shareds) + self.loadSQLDump( + self.connection, + '%s/dump_product_sync_11.sql' % self.ps_dump_path, + ) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.product_module.contentValues()), 1) + base_category_list = product.getVariationBaseCategoryList() + base_category_list.sort() + self.assertEqual(len(base_category_list), 2) + self.assertEqual(base_category_list, ['ball_size', 'colour']) + shared_variation_list = product.getVariationCategoryList() + shared_variation_list.sort() + self.assertEqual(len(shared_variation_list), 3) + self.assertEqual( + shared_variation_list, + ['colour/black', 'colour/red', 'colour/white', ]) + individual_variation_list = product.searchFolder( + portal_type='Product Individual Variation', + sort_on=(['id', 'ASC'], ), + ) + self.assertEqual(len(individual_variation_list), 3) + for index, individual_variation in enumerate(individual_variation_list): + # Use shortcut for the checking + individual_variation = individual_variation.getObject() + title = individual_variation.getTitle() + base_category_list = individual_variation.getVariationBaseCategoryList() + # check through the order + if index == 0: + self.assertEqual(title, 's4') + self.assertEqual(base_category_list, ['ball_size']) + elif index == 1: + self.assertEqual(title, 's5') + self.assertEqual(base_category_list, ['ball_size']) + elif index == 2: + self.assertEqual(title, 's6') + self.assertEqual(base_category_list, ['ball_size']) + else: + raise ValueError, 'Can not check variation: %s of the product: %s' % \ + (individual_variation.getId(), product.getTitle()) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml= self.root_xml % product.Resource_asTioSafeXML(), + tiosafe_xml=self.root_xml % self.prestashop.product_module()[0].asXML(), + xsd_path='../XSD/resources.xsd', + ) + diff --git a/product/ERP5TioSafe/tests/testProductPrestashopSynchronization.py b/product/ERP5TioSafe/tests/testProductPrestashopSynchronization.py new file mode 100644 index 0000000000000000000000000000000000000000..37ca0389fd23bc3b0a1963104a830fa56be00ca3 --- /dev/null +++ b/product/ERP5TioSafe/tests/testProductPrestashopSynchronization.py @@ -0,0 +1,551 @@ +############################################################################## +# +# Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved. +# Hervé Poulain <herve@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +import transaction +from Products.ERP5TioSafe.tests.testPrestashopMixin import testPrestashopMixin + +class testProductPrestashopSynchronization(testPrestashopMixin): + """ This class allows to check different cases of Product's sync. """ + def afterSetUp(self): + """ This method is called after the SetUp method. """ + # Shortcut for modules and tools + self.product_module = self.portal.product_module + self.portal_categories = self.portal.portal_categories + self.portal_sync = self.portal.portal_synchronizations + self.connection = self.portal.erp5_sql_connection + self.prestashop = self.portal.portal_integrations.prestashop + self.root_xml = '<catalog>\n%s\n</catalog>' + + def test_PrestashopSimplestXMLSync(self): + """ This test checks the product sync with the simplest XML. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + product = self.product_module.newContent( + portal_type='Product', + title='Tee-Shirt', + reference='my_ref', + use='sale', + ) + product.validate() + transaction.commit() + self.tic() + + # Run the sync of products and check product's data after sync + self.assertEqual(len(self.prestashop.product_module()), 0) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.prestashop.product_module()), 1) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.product_module()[0].asXML(), + tiosafe_xml=self.root_xml % product.Resource_asTioSafeXML(), + xsd_path='../XSD/resources.xsd', + ) + + def test_PrestashopIndividualVariationSync(self): + """ This test check the product sync with individual variations. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.loadSQLDump( + self.connection, + '%s/dump_product_sync_12.sql' % self.ps_dump_path, + ) + # Define the specific mapping, initMapping declare the categories in ERP5 + self.initMapping() + mapping_dict_list = [ + { 'title': 'Taille du Ballon', + 'path': 'TailleduBallon', + 'source_reference': 'Taille du Ballon', + 'destination_reference':'ball_size', }, + { 'title': 'Couleur', + 'path': 'Couleur', + 'source_reference': 'Couleur', + 'destination_reference': 'colour', }, + ] + for mapping in mapping_dict_list: + self.createMapping(integration_site=self.prestashop, **mapping) + # create and init the product + product = self.product_module.newContent( + portal_type='Product', + title='Ballon de Foot', + reference='0123456789', + ean13_code='1234567890128', + use='sale', + sale_supply_line_base_price=2.123456, + purchase_supply_line_base_price=1.123456, + ) + product.validate() + individual_variation_dict_list = [ + {'variation_base_category': 'ball_size', 'title': 's4', }, + {'variation_base_category': 'ball_size', 'title': 's5', }, + {'variation_base_category': 'colour', 'title': 'Blanc', }, + {'variation_base_category': 'colour', 'title': 'Noir', }, + ] + for individual_variation in individual_variation_dict_list: + product.newContent( + portal_type='Product Individual Variation', + **individual_variation + ) + transaction.commit() + self.tic() + + # Run the sync of products and check product's data after sync + self.assertEqual(len(self.prestashop.product_module()), 0) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.prestashop.product_module()), 1) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.product_module()[0].asXML(), + tiosafe_xml=self.root_xml % product.Resource_asTioSafeXML(), + xsd_path='../XSD/resources.xsd', + ) + + def test_PrestashopSharedVariationSync(self): + """ This test check the product sync with shared variations. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.loadSQLDump( + self.connection, + '%s/dump_product_sync_12.sql' % self.ps_dump_path, + ) + self.initMapping(self.prestashop) + # create and init the product + product = self.product_module.newContent( + portal_type='Product', + title='Ballon de Foot', + reference='0123456789', + ean13_code='1234567890128', + use='sale', + sale_supply_line_base_price=2.123456, + purchase_supply_line_base_price=1.123456, + ) + product.validate() + product.setVariationBaseCategoryList(['ball_size', 'colour']) + product.setVariationCategoryList( + ['ball_size/x4', 'ball_size/x5', 'colour/black', 'colour/white'], + ) + transaction.commit() + self.tic() + + # Run the sync of products and check product's data after sync + self.assertEqual(len(self.prestashop.product_module()), 0) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.prestashop.product_module()), 1) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.product_module()[0].asXML(), + tiosafe_xml=self.root_xml % product.Resource_asTioSafeXML(), + xsd_path='../XSD/resources.xsd', + ) + + def test_PrestashopDifferentKindVariationsSync(self): + """ This test check the product sync with the two kind of variations. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.loadSQLDump( + self.connection, + '%s/dump_product_sync_12.sql' % self.ps_dump_path, + ) + # Define the specific mapping, initMapping declare the categories in ERP5 + self.initMapping() + mapping_dict_list = [ + { 'title': 'Taille du Ballon', + 'path': 'TailleduBallon', + 'source_reference': 'Taille du Ballon', + 'destination_reference':'ball_size', }, + { 'title': 'Couleur', + 'path': 'Couleur', + 'source_reference': 'Couleur', + 'destination_reference': 'colour', }, + { 'title': 'Blanc', + 'path': 'Couleur/Blanc', + 'source_reference': 'Blanc', + 'destination_reference': 'white', }, + { 'title': 'Noir', + 'path': 'Couleur/Noir', + 'source_reference': 'Noir', + 'destination_reference': 'black', }, + ] + for mapping in mapping_dict_list: + self.createMapping(integration_site=self.prestashop, **mapping) + # create and init the product + product = self.product_module.newContent( + portal_type='Product', + title='Ballon de Foot', + reference='0123456789', + ean13_code='1234567890128', + use='sale', + sale_supply_line_base_price=2.123456, + purchase_supply_line_base_price=1.123456, + ) + product.validate() + product.setVariationBaseCategoryList(['colour']) + product.setVariationCategoryList(['colour/black', 'colour/white']) + individual_variation_dict_list = [ + {'variation_base_category': 'ball_size', 'title': 's4', }, + {'variation_base_category': 'ball_size', 'title': 's5', }, + ] + for individual_variation in individual_variation_dict_list: + product.newContent( + portal_type='Product Individual Variation', + **individual_variation + ) + transaction.commit() + self.tic() + + # Run the sync of products and check product's data after sync + self.assertEqual(len(self.prestashop.product_module()), 0) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.prestashop.product_module()), 1) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.product_module()[0].asXML(), + tiosafe_xml=self.root_xml % product.Resource_asTioSafeXML(), + xsd_path='../XSD/resources.xsd', + ) + + def test_PrestashopMultipleSync(self): + """ This test check the multiple product sync. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.loadSQLDump( + self.connection, + '%s/dump_product_sync_12.sql' % self.ps_dump_path, + ) + # Define the specific mapping, initMapping declare the categories in ERP5 + self.initMapping() + mapping_dict_list = [ + { 'title': 'Taille du Ballon', + 'path': 'TailleduBallon', + 'source_reference': 'Taille du Ballon', + 'destination_reference':'ball_size', }, + { 'title': 'Couleur', + 'path': 'Couleur', + 'source_reference': 'Couleur', + 'destination_reference': 'colour', }, + { 'title': 'Blanc', + 'path': 'Couleur/Blanc', + 'source_reference': 'Blanc', + 'destination_reference': 'white', }, + { 'title': 'Noir', + 'path': 'Couleur/Noir', + 'source_reference': 'Noir', + 'destination_reference': 'black', }, + ] + for mapping in mapping_dict_list: + self.createMapping(integration_site=self.prestashop, **mapping) + # create and init the product one + product_1 = self.product_module.newContent( + portal_type='Product', + title='Stylo', + reference='01111', + use='sale', + sale_supply_line_base_price=2.1, + purchase_supply_line_base_price=1.1, + ) + product_1.validate() + # create and init the product two + product_2 = self.product_module.newContent( + portal_type='Product', + title='Ballon', + reference='02222', + ean13_code='2222222222222', + use='sale', + sale_supply_line_base_price=20.2, + purchase_supply_line_base_price=10.2, + ) + product_2.validate() + individual_variation_dict_list = [ + {'variation_base_category': 'ball_size', 'title': 's4', }, + {'variation_base_category': 'ball_size', 'title': 's5', }, + ] + for individual_variation in individual_variation_dict_list: + product_2.newContent( + portal_type='Product Individual Variation', + **individual_variation + ) + # create and init the product three + product_3 = self.product_module.newContent( + portal_type='Product', + title='Ballon de Foot', + reference='03333', + ean13_code='3333333333338', + use='sale', + sale_supply_line_base_price=200.3, + purchase_supply_line_base_price=100.3, + ) + product_3.validate() + product_3.setVariationBaseCategoryList(['colour', ]) + product_3.setVariationCategoryList(['colour/black', 'colour/white']) + # create and init the product four + product_4 = self.product_module.newContent( + portal_type='Product', + title='Ballon de Basket', + reference='04444', + ean13_code='4444444444444', + use='sale', + sale_supply_line_base_price=2000.4, + purchase_supply_line_base_price=1000.4, + ) + product_4.validate() + product_4.setVariationBaseCategoryList(['colour']) + product_4.setVariationCategoryList(['colour/black', 'colour/white']) + individual_variation_dict_list = [ + {'variation_base_category': 'ball_size', 'title': 's4', }, + {'variation_base_category': 'ball_size', 'title': 's5', }, + ] + for individual_variation in individual_variation_dict_list: + product_4.newContent( + portal_type='Product Individual Variation', + **individual_variation + ) + transaction.commit() + self.tic() + + # Run the sync of products and check product's data after sync + self.assertEqual(len(self.prestashop.product_module()), 0) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.prestashop.product_module()), 4) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.product_module[13].asXML(), + tiosafe_xml= self.root_xml % product_1.Resource_asTioSafeXML(), + xsd_path='../XSD/resources.xsd', + ) + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.product_module[12].asXML(), + tiosafe_xml= self.root_xml % product_2.Resource_asTioSafeXML(), + xsd_path='../XSD/resources.xsd', + ) + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.product_module[11].asXML(), + tiosafe_xml= self.root_xml % product_3.Resource_asTioSafeXML(), + xsd_path='../XSD/resources.xsd', + ) + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.product_module[10].asXML(), + tiosafe_xml= self.root_xml % product_4.Resource_asTioSafeXML(), + xsd_path='../XSD/resources.xsd', + ) + + def test_PrestashopDeleteProduct(self): + """ Check that delete during a product's sync invalidate the product. """ + # Initialize the instance and prestashop + product_module = self.portal.product_module + self.initPrestashopTest() + product = self.product_module.newContent( + portal_type='Product', + title='Tee-Shirt', + reference='0123456789', + use='sale', + ) + product.validate() + transaction.commit() + self.tic() + + # Run the sync of products and check product's data after sync + self.assertEqual(len(self.prestashop.product_module()), 0) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.prestashop.product_module()), 1) + # Remove the product in ERP5 and check that after sync in prestashop + self.product_module.manage_delObjects([product.getId(), ]) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.prestashop.product_module()), 0) + + def test_PrestashopUpdateSimpleElement(self): + """ This test checks the simple update after sync of products. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.loadSQLDump( + self.connection, + '%s/dump_product_sync_12.sql' % self.ps_dump_path, + ) + self.initMapping(self.prestashop) + # create and init the product + product = self.product_module.newContent( + portal_type='Product', + title='Ballon de Foot', + reference='0123456789', + ean13_code='1234567890128', + use='sale', + sale_supply_line_base_price=2000.4, + purchase_supply_line_base_price=1000.4, + ) + product.validate() + product.setVariationBaseCategoryList(['ball_size', 'colour']) + product.setVariationCategoryList( + ['ball_size/x4', 'ball_size/x5', 'colour/black', 'colour/white'], + ) + transaction.commit() + self.tic() + + # Run the sync of products and check product's data after sync + self.assertEqual(len(self.prestashop.product_module()), 0) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.prestashop.product_module()), 1) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.product_module()[0].asXML(), + tiosafe_xml=self.root_xml % product.Resource_asTioSafeXML(), + xsd_path='../XSD/resources.xsd', + ) + # Update the data, run the sync and check the data after the update + product.setSaleSupplyLineBasePrice(20.0) + product.setPurchaseSupplyLineBasePrice(20.0) + product.setEan13Code('0987654321098') + self.assertEqual(len(self.prestashop.product_module()), 1) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.prestashop.product_module()), 1) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.product_module()[0].asXML(), + tiosafe_xml=self.root_xml % product.Resource_asTioSafeXML(), + xsd_path='../XSD/resources.xsd', + ) + + def test_PrestashopComplexeUpdateElement(self): + """ + This test checks the complexe update after sync of products. + It updates some element, adds others and removes the last. + """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.loadSQLDump( + self.connection, + '%s/dump_product_sync_12.sql' % self.ps_dump_path, + ) + # Define the specific mapping, initMapping declare the categories in ERP5 + self.initMapping() + mapping_dict_list = [ + { 'title': 'Taille du Ballon', + 'path': 'TailleduBallon', + 'source_reference': 'Taille du Ballon', + 'destination_reference':'ball', }, + { 'title': 'Couleur', + 'path': 'Couleur', + 'source_reference': 'Couleur', + 'destination_reference': 'colour', }, + { 'title': 'Blanc', + 'path': 'Couleur/Blanc', + 'source_reference': 'Blanc', + 'destination_reference': 'white', }, + { 'title': 'Noir', + 'path': 'Couleur/Noir', + 'source_reference': 'Noir', + 'destination_reference': 'black', }, + { 'title': 'Rouge', + 'path': 'Couleur/Rouge', + 'source_reference': 'Rouge', + 'destination_reference': 'red', }, + ] + for mapping in mapping_dict_list: + self.createMapping(integration_site=self.prestashop, **mapping) + # create and init the product + product = self.product_module.newContent( + portal_type='Product', + title='Ballon de Plage', + reference='a5962z', + use='sale', + sale_supply_line_base_price=200.25, + purchase_supply_line_base_price=100.25, + ) + product.validate() + product.setVariationBaseCategoryList(['colour']) + product.setVariationCategoryList(['colour/black', 'colour/white']) + individual_variation_dict_list = [ + {'variation_base_category': 'ball', 'title': 's4', }, + {'variation_base_category': 'ball', 'title': 's5', }, + ] + for individual_variation in individual_variation_dict_list: + product.newContent( + portal_type='Product Individual Variation', + **individual_variation + ) + transaction.commit() + self.tic() + + # Run the sync of products and check product's data after sync + self.assertEqual(len(self.prestashop.product_module()), 0) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.prestashop.product_module()), 1) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.product_module()[0].asXML(), + tiosafe_xml=self.root_xml % product.Resource_asTioSafeXML(), + xsd_path='../XSD/resources.xsd', + ) + # The first update remove, add and update some elements but not realise an + # hard work on variations + product.setEan13Code('1357913579130') + product.setVariationCategoryList(['colour/white', 'colour/red']) + individual_variation = product.portal_catalog( + portal_type='Product Individual Variation', + parent_uid=product.getUid(), + title='s5', + )[0].getObject() + individual_variation.setTitle('s6') + self.assertEqual(len(self.prestashop.product_module()), 1) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.prestashop.product_module()), 1) + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.product_module()[0].asXML(), + tiosafe_xml=self.root_xml % product.Resource_asTioSafeXML(), + xsd_path='../XSD/resources.xsd', + ) + # The second update remove variations (individuals and shareds) + product.setVariationCategoryList(['colour/white', ]) + product.manage_delObjects([individual_variation.getId(), ]) + self.assertEqual(len(self.prestashop.product_module()), 1) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.prestashop.product_module()), 1) + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.product_module()[0].asXML(), + tiosafe_xml=self.root_xml % product.Resource_asTioSafeXML(), + xsd_path='../XSD/resources.xsd', + ) + # The third update allows to add variations (individuals and shareds) + product.setVariationCategoryList( + ['colour/white', 'colour/red', 'colour/white'], + ) + individual_variation_dict_list = [ + {'variation_base_category': 'ball', 'title': 's5', }, + {'variation_base_category': 'ball', 'title': 's6', }, + ] + for individual_variation in individual_variation_dict_list: + product.newContent( + portal_type='Product Individual Variation', + **individual_variation + ) + self.assertEqual(len(self.prestashop.product_module()), 1) + self.loadSync([self.prestashop.product_module, ]) + self.assertEqual(len(self.prestashop.product_module()), 1) + self.checkTioSafeXML( + plugin_xml=self.root_xml % self.prestashop.product_module()[0].asXML(), + tiosafe_xml=self.root_xml % product.Resource_asTioSafeXML(), + xsd_path='../XSD/resources.xsd', + ) + diff --git a/product/ERP5TioSafe/tests/testSaleOrderERP5Synchronization.py b/product/ERP5TioSafe/tests/testSaleOrderERP5Synchronization.py new file mode 100644 index 0000000000000000000000000000000000000000..45fb921c11b11afa69e892e9ef6ce55abe95feaa --- /dev/null +++ b/product/ERP5TioSafe/tests/testSaleOrderERP5Synchronization.py @@ -0,0 +1,1059 @@ +############################################################################## +# +# Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved. +# Hervé Poulain <herve@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +import transaction +from DateTime import DateTime +from Products.ERP5TioSafe.tests.testPrestashopMixin import testPrestashopMixin + +class testSaleOrderERP5Synchronization(testPrestashopMixin): + """ This class allows to check different cases of Slae Order's sync. """ + + def getBusinessTemplateList(self): + return testPrestashopMixin.getBusinessTemplateList(self) + ('erp5_accounting', + 'erp5_invoicing', + 'erp5_simplified_invoicing', + ) + + def afterSetUp(self): + """ This method is called after the SetUp method. """ + # Shortcut for modules and tools + self.person_module = self.portal.person_module + self.organisation_module = self.portal.organisation_module + self.product_module = self.portal.product_module + self.service_module = self.portal.service_module + self.sale_order_module = self.portal.sale_order_module + self.currency_module = self.portal.currency_module + self.sale_trade_condition_module = self.portal.sale_trade_condition_module + self.portal_categories = self.portal.portal_categories + self.connection = self.portal.erp5_sql_connection + self.prestashop = self.portal.portal_integrations.prestashop + self.root_xml = '<journal>\n%s\n</journal>' + self.delivery = self.service_module.tiosafe_delivery_service + self.discount = self.service_module.tiosafe_discount_service + + def test_PrestashopSimplestXMLSync(self): + """ Check the sync of the simplest XML for a sale order. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.initMapping(self.prestashop) + self.createUnknownObject() + self.validateRules() + self.loadSQLDump( + self.connection, + '%s/dump_sale_order_sync_01.sql' % self.ps_dump_path, + ) + transaction.commit() + self.tic() + + # Run sync process and check result + self.assertEqual(len(self.sale_order_module.contentValues()), 0) + self.assertEqual(len(self.product_module.contentValues()), 1) + self.assertEqual(len(self.person_module.contentValues()), 1) + self.loadSync([ + getattr(self.prestashop, module) + for module in ['person_module', 'product_module', 'sale_order_module'] + ]) + self.assertEqual(len(self.sale_order_module.contentValues()), 1) + self.assertEqual(len(self.product_module.contentValues()), 5) + self.assertEqual(len(self.person_module.contentValues()), 2) + sale_order = self.sale_order_module.contentValues()[0] + person = self.person_module.searchFolder( + portal_type='Person', + title='Jean GRAY', + )[0].getObject() + product = self.product_module.searchFolder( + portal_type='Product', + title='Stylo', + )[0].getObject() + currency = self.currency_module.contentValues()[0] + trade_condition = self.sale_trade_condition_module['tiosafe_sale_trade_condition'] + self.assertEqual(sale_order.getSourceValue(), self.organisation) + self.assertEqual(sale_order.getSourceSectionValue(), self.organisation) + self.assertEqual(sale_order.getDestinationValue(), person) + self.assertEqual(sale_order.getDestinationSectionValue(), person) + self.assertEqual(sale_order.getPriceCurrencyValue(), currency) + self.assertEqual(sale_order.getSpecialiseValueList(), [trade_condition, ]) + self.assertEqual(sale_order.getReference(), '1') + self.assertEqual( + str(sale_order.getStartDate()), str(DateTime('2010-06-14')), + ) + self.assertEqual( + str(sale_order.getStopDate()), str(DateTime('2010-06-16')), + ) + self.assertEqual(round(sale_order.getTotalPrice(), 6), 8.772241) + self.assertEqual(sale_order.getSimulationState(), 'confirmed') + sale_order_line_list = sale_order.contentValues( + portal_type='Sale Order Line', + ) + self.assertEqual(len(sale_order_line_list), 2) + for line in sale_order_line_list: + if line.getTitle() == 'Delivery': + self.assertEqual(line.getResourceValue(), self.delivery) + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_normal_rate', + ) + self.assertEqual(line.getQuantity(), 1.0) + self.assertEqual(round(line.getPrice(), 6), 6.672241) + self.assertEqual(line.getPriceCurrencyValue(), currency) + elif line.getTitle() == 'Stylo': + self.assertEqual(line.getResourceValue(), product) + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_normal_rate', + ) + self.assertEqual(line.getQuantity(), 1.0) + self.assertEqual(round(line.getPrice(), 6), 2.1) + self.assertEqual(line.getPriceCurrencyValue(), currency) + else: + self.failUnless(line.getTitle() in ['Delivery', 'Stylo']) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + tiosafe_xml=self.root_xml % sale_order.Transaction_asTioSafeXML(), + plugin_xml=self.root_xml % self.prestashop.sale_order_module()[0].asXML(), + xsd_path='../XSD/transactions.xsd', + ) + + def test_PrestashopSyncWithIndividualVariation(self): + """ + Check the sync of sale order with individual variation on the product. + """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.initMapping() + self.createUnknownObject() + self.validateRules() + # Integration site country + mapping_dict_list = [ + { 'title': 'Country', + 'path': 'Country', + 'source_reference': 'Country', + 'destination_reference': 'region', }, + { 'title': 'France', + 'path': 'Country/France', + 'source_reference': 'France', + 'destination_reference': 'france', }, + { 'title': 'Allemagne', + 'path': 'Country/Allemagne', + 'source_reference': 'Allemagne', + 'destination_reference': 'europe/western_europe/allemagne', }, + { 'title': 'Taille du Ballon', + 'path': 'TailleduBallon', + 'source_reference': 'Taille du Ballon', + 'destination_reference': 'ball_size', }, + { 'title': 'Couleur', + 'path': 'Couleur', + 'source_reference': 'Couleur', + 'destination_reference': 'colour', }, + { 'title': 'Payment Mode', + 'path': 'PaymentMode', + 'source_reference': 'Payment Mode', + 'destination_reference': 'payment_mode', }, + { 'title': 'CB', + 'path': 'PaymentMode/CB', + 'source_reference': 'CB', + 'destination_reference': 'cb', }, + { 'title': 'Cheque', + 'path': 'PaymentMode/Cheque', + 'source_reference': 'Cheque', + 'destination_reference': 'cb', }, + ] + for mapping in mapping_dict_list: + self.createMapping(integration_site=self.prestashop, **mapping) + self.loadSQLDump( + self.connection, + '%s/dump_sale_order_sync_02.sql' % self.ps_dump_path, + ) + transaction.commit() + self.tic() + + # Run sync process and check result + self.assertEqual(len(self.sale_order_module.contentValues()), 0) + self.assertEqual(len(self.product_module.contentValues()), 1) + self.assertEqual(len(self.person_module.contentValues()), 1) + self.loadSync([ + getattr(self.prestashop, module) + for module in ['person_module', 'product_module', 'sale_order_module'] + ]) + self.assertEqual(len(self.sale_order_module.contentValues()), 1) + self.assertEqual(len(self.product_module.contentValues()), 5) + self.assertEqual(len(self.person_module.contentValues()), 2) + sale_order = self.sale_order_module.contentValues()[0] + person = self.person_module.searchFolder( + portal_type='Person', + title='Jean GRAY', + )[0].getObject() + product = self.product_module.searchFolder( + portal_type='Product', + title='Ballon', + )[0].getObject() + currency = self.currency_module.contentValues()[0] + trade_condition = self.sale_trade_condition_module['tiosafe_sale_trade_condition'] + self.assertEqual(sale_order.getSourceValue(), self.organisation) + self.assertEqual(sale_order.getSourceSectionValue(), self.organisation) + self.assertEqual(sale_order.getDestinationValue(), person) + self.assertEqual(sale_order.getDestinationSectionValue(), person) + self.assertEqual(sale_order.getPriceCurrencyValue(), currency) + self.assertEqual(sale_order.getSpecialiseValueList(), [trade_condition, ]) + self.assertEqual(sale_order.getReference(), '1') + self.assertEqual( + str(sale_order.getStartDate()), str(DateTime('2010-06-14')), + ) + self.assertEqual( + str(sale_order.getStopDate()), str(DateTime('2010-06-16')), + ) + self.assertEqual(round(sale_order.getTotalPrice(), 6), 87.472241) + self.assertEqual(sale_order.getSimulationState(), 'confirmed') + sale_order_line_list = sale_order.contentValues( + portal_type='Sale Order Line', + ) + self.assertEqual(len(sale_order_line_list), 3) + product_relative_url = product.getRelativeUrl() + for line in sale_order_line_list: + if line.getId() == '1': # Ballon / (Taille du Ballon/s4) + self.assertEqual(line.getTitle(), 'Ballon - Taille du Ballon : s4') + self.assertEqual(line.getResourceValue(), product) + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_normal_rate', + ) + self.assertEqual(line.movement_0.getQuantity(), 2.0) + self.assertEqual(round(line.movement_0.getPrice(), 6), 20.2) + self.assertEqual(line.getPriceCurrencyValue(), currency) + self.assertEqual( + line.getVariationCategoryList(), + ['ball_size/%s/1' % product_relative_url, ], + ) + elif line.getId() == '2': # Ballon / (Taille du Ballon/s5) + self.assertEqual(line.getTitle(), 'Ballon - Taille du Ballon : s5') + self.assertEqual(line.getResourceValue(), product) + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_normal_rate', + ) + self.assertEqual(line.movement_0.getQuantity(), 2.0) + self.assertEqual(round(line.movement_0.getPrice(), 6), 20.2) + self.assertEqual(line.getPriceCurrencyValue(), currency) + self.assertEqual( + line.getVariationCategoryList(), + ['ball_size/%s/2' % product_relative_url, ], + ) + elif line.getId() == '3': + self.assertEqual(line.getTitle(), 'Delivery') + self.assertEqual(line.getResourceValue(), self.delivery) + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_normal_rate', + ) + self.assertEqual(line.getQuantity(), 1.0) + self.assertEqual(round(line.getPrice(), 6), 6.672241) + self.assertEqual(line.getPriceCurrencyValue(), currency) + else: + raise 'A line has not been checked' + # Check the XML schema and the fixed point + self.checkTioSafeXML( + tiosafe_xml=self.root_xml % sale_order.Transaction_asTioSafeXML(), + plugin_xml=self.root_xml % self.prestashop.sale_order_module()[0].asXML(), + xsd_path='../XSD/transactions.xsd', + ) + + def test_PrestashopSyncWithSharedVariation(self): + """ Check the sync of sale order with shared variation. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.initMapping(self.prestashop) + self.createUnknownObject() + self.validateRules() + self.loadSQLDump( + self.connection, + '%s/dump_sale_order_sync_03.sql' % self.ps_dump_path, + ) + transaction.commit() + self.tic() + + # Run sync process and check result + self.assertEqual(len(self.sale_order_module.contentValues()), 0) + self.assertEqual(len(self.product_module.contentValues()), 1) + self.assertEqual(len(self.person_module.contentValues()), 1) + self.loadSync([ + getattr(self.prestashop, module) + for module in ['person_module', 'product_module', 'sale_order_module'] + ]) + self.assertEqual(len(self.sale_order_module.contentValues()), 1) + self.assertEqual(len(self.product_module.contentValues()), 5) + self.assertEqual(len(self.person_module.contentValues()), 2) + sale_order = self.sale_order_module.contentValues()[0] + person = self.person_module.searchFolder( + portal_type='Person', + title='Jean GRAY', + )[0].getObject() + product = self.product_module.searchFolder( + portal_type='Product', + title='Ballon de Foot', + )[0].getObject() + currency = self.currency_module.contentValues()[0] + trade_condition = self.sale_trade_condition_module['tiosafe_sale_trade_condition'] + self.assertEqual(sale_order.getSourceValue(), self.organisation) + self.assertEqual(sale_order.getSourceSectionValue(), self.organisation) + self.assertEqual(sale_order.getDestinationValue(), person) + self.assertEqual(sale_order.getDestinationSectionValue(), person) + self.assertEqual(sale_order.getPriceCurrencyValue(), currency) + self.assertEqual(sale_order.getSpecialiseValueList(), [trade_condition, ]) + self.assertEqual(sale_order.getReference(), '1') + self.assertEqual( + str(sale_order.getStartDate()), str(DateTime('2010-06-14')), + ) + self.assertEqual( + str(sale_order.getStopDate()), str(DateTime('2010-06-16')), + ) + self.assertEqual(round(sale_order.getTotalPrice(), 6), 807.872241) + self.assertEqual(sale_order.getSimulationState(), 'confirmed') + sale_order_line_list = sale_order.contentValues( + portal_type='Sale Order Line', + ) + self.assertEqual(len(sale_order_line_list), 3) + for line in sale_order_line_list: + if line.getId() == '1': # Ballon de Foot / (Couleur/Blanc) + self.assertEqual(line.getTitle(), 'Ballon de Foot - Couleur : Blanc') + self.assertEqual(line.getResourceValue(), product) + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_normal_rate', + ) + self.assertEqual(line.movement_0.getQuantity(), 2.0) + self.assertEqual(round(line.movement_0.getPrice(), 6), 200.3) + self.assertEqual(line.getPriceCurrencyValue(), currency) + self.assertEqual( + line.getVariationCategoryList(), + ['colour/white', ], + ) + elif line.getId() == '2': # Ballon de Foot / (Couleur/Noir) + self.assertEqual(line.getTitle(), 'Ballon de Foot - Couleur : Noir') + self.assertEqual(line.getResourceValue(), product) + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_normal_rate', + ) + self.assertEqual(line.movement_0.getQuantity(), 2.0) + self.assertEqual(round(line.movement_0.getPrice(), 6), 200.3) + self.assertEqual(line.getPriceCurrencyValue(), currency) + self.assertEqual( + line.getVariationCategoryList(), + ['colour/black', ], + ) + elif line.getId() == '3': + self.assertEqual(line.getTitle(), 'Delivery') + self.assertEqual(line.getResourceValue(), self.delivery) + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_normal_rate', + ) + self.assertEqual(line.getQuantity(), 1.0) + self.assertEqual(round(line.getPrice(), 6), 6.672241) + self.assertEqual(line.getPriceCurrencyValue(), currency) + else: + raise 'A line has not been checked' + # Check the XML schema and the fixed point + self.checkTioSafeXML( + tiosafe_xml=self.root_xml % sale_order.Transaction_asTioSafeXML(), + plugin_xml=self.root_xml % self.prestashop.sale_order_module()[0].asXML(), + xsd_path='../XSD/transactions.xsd', + ) + + def test_PrestashopSyncDifferentKindVariation(self): + """ Check the sync of sale order with the two kind of variations. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.initMapping() + self.createUnknownObject() + self.validateRules() + # Integration site country + mapping_dict_list = [ + { 'title': 'Country', + 'path': 'Country', + 'source_reference': 'Country', + 'destination_reference': 'region', }, + { 'title': 'France', + 'path': 'Country/France', + 'source_reference': 'France', + 'destination_reference': 'france', }, + { 'title': 'Allemagne', + 'path': 'Country/Allemagne', + 'source_reference': 'Allemagne', + 'destination_reference': 'europe/western_europe/allemagne', }, + { 'title': 'Taille du Ballon', + 'path': 'TailleduBallon', + 'source_reference': 'Taille du Ballon', + 'destination_reference': 'ball_size', }, + { 'title': 'Couleur', + 'path': 'Couleur', + 'source_reference': 'Couleur', + 'destination_reference': 'colour', }, + { 'title': 'Blanc', + 'path': 'Couleur/Blanc', + 'source_reference': 'Blanc', + 'destination_reference': 'white', }, + { 'title': 'Noir', + 'path': 'Couleur/Noir', + 'source_reference': 'Noir', + 'destination_reference': 'black', }, + { 'title': 'Payment Mode', + 'path': 'PaymentMode', + 'source_reference': 'Payment Mode', + 'destination_reference': 'payment_mode', }, + { 'title': 'CB', + 'path': 'PaymentMode/CB', + 'source_reference': 'CB', + 'destination_reference': 'cb', }, + { 'title': 'Cheque', + 'path': 'PaymentMode/Cheque', + 'source_reference': 'Cheque', + 'destination_reference': 'cb', }, + ] + for mapping in mapping_dict_list: + self.createMapping(integration_site=self.prestashop, **mapping) + self.loadSQLDump( + self.connection, + '%s/dump_sale_order_sync_04.sql' % self.ps_dump_path, + ) + transaction.commit() + self.tic() + + # Run sync process and check result + self.assertEqual(len(self.sale_order_module.contentValues()), 0) + self.assertEqual(len(self.product_module.contentValues()), 1) + self.assertEqual(len(self.person_module.contentValues()), 1) + self.loadSync([ + getattr(self.prestashop, module) + for module in ['person_module', 'product_module', 'sale_order_module'] + ]) + self.assertEqual(len(self.sale_order_module.contentValues()), 1) + self.assertEqual(len(self.product_module.contentValues()), 5) + self.assertEqual(len(self.person_module.contentValues()), 2) + sale_order = self.sale_order_module.contentValues()[0] + person = self.person_module.searchFolder( + portal_type='Person', + title='Jean GRAY', + )[0].getObject() + product = self.product_module.searchFolder( + portal_type='Product', + title='Ballon de Basket', + )[0].getObject() + currency = self.currency_module.contentValues()[0] + trade_condition = self.sale_trade_condition_module['tiosafe_sale_trade_condition'] + self.assertEqual(sale_order.getSourceValue(), self.organisation) + self.assertEqual(sale_order.getSourceSectionValue(), self.organisation) + self.assertEqual(sale_order.getDestinationValue(), person) + self.assertEqual(sale_order.getDestinationSectionValue(), person) + self.assertEqual(sale_order.getPriceCurrencyValue(), currency) + self.assertEqual(sale_order.getSpecialiseValueList(), [trade_condition, ]) + self.assertEqual(sale_order.getReference(), '1') + self.assertEqual( + str(sale_order.getStartDate()), str(DateTime('2010-06-14')), + ) + self.assertEqual( + str(sale_order.getStopDate()), str(DateTime('2010-06-16')), + ) + self.assertEqual(round(sale_order.getTotalPrice(), 6), 16009.872241) + self.assertEqual(sale_order.getSimulationState(), 'confirmed') + sale_order_line_list = sale_order.contentValues( + portal_type='Sale Order Line', + ) + self.assertEqual(len(sale_order_line_list), 3) + product_relative_url = product.getRelativeUrl() + # See movement rather than line + for line in sale_order_line_list: + if line.getId() == '1': # Ballon de Foot / (Couleur/Blanc) / (Taille du Ballon/s5) + self.assertEqual( + line.getTitle(), + 'Ballon de Basket - Couleur : Blanc, Taille du Ballon : s4', + ) + self.assertEqual(line.getResourceValue(), product) + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_normal_rate', + ) + self.assertEqual(line.movement_0_0.getQuantity(), 4.0) + self.assertEqual(round(line.movement_0_0.getPrice(), 6), 2000.4) + self.assertEqual(line.getPriceCurrencyValue(), currency) + self.assertSameSet( + line.getVariationCategoryList(), + ['ball_size/%s/1' % product_relative_url, 'colour/white', ], + ) + elif line.getId() == '2': # Ballon de Foot / (Couleur/Noir) / (Taille du Ballon/s4) + self.assertEqual( + line.getTitle(), + 'Ballon de Basket - Couleur : Noir, Taille du Ballon : s5', + ) + self.assertEqual(line.getResourceValue(), product) + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_normal_rate', + ) + self.assertEqual(line.movement_0_0.getQuantity(), 4.0) + self.assertEqual(round(line.movement_0_0.getPrice(), 6), 2000.4) + self.assertEqual(line.getPriceCurrencyValue(), currency) + self.assertSameSet( + line.getVariationCategoryList(), + ['ball_size/%s/2' % product_relative_url, 'colour/black', ], + ) + elif line.getId() == '3': + self.assertEqual(line.getTitle(), 'Delivery') + self.assertEqual(line.getResourceValue(), self.delivery) + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_normal_rate', + ) + self.assertEqual(line.getQuantity(), 1.0) + self.assertEqual(round(line.getPrice(), 6), 6.672241) + self.assertEqual(line.getPriceCurrencyValue(), currency) + else: + raise 'A line has not been checked' + # Check the XML schema and the fixed point + self.checkTioSafeXML( + tiosafe_xml=self.root_xml % sale_order.Transaction_asTioSafeXML(), + plugin_xml=self.root_xml % self.prestashop.sale_order_module()[0].asXML(), + xsd_path='../XSD/transactions.xsd', + ) + + def test_PrestashopDiscountSync(self): + """ Check the sync of sale order with discount. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.initMapping(self.prestashop) + self.createUnknownObject() + self.validateRules() + self.loadSQLDump( + self.connection, + '%s/dump_sale_order_sync_05.sql' % self.ps_dump_path, + ) + transaction.commit() + self.tic() + + # Run sync process and check result + self.assertEqual(len(self.sale_order_module.contentValues()), 0) + self.assertEqual(len(self.product_module.contentValues()), 1) + self.assertEqual(len(self.person_module.contentValues()), 1) + self.loadSync([ + getattr(self.prestashop, module) + for module in ['person_module', 'product_module', 'sale_order_module'] + ]) + self.assertEqual(len(self.sale_order_module.contentValues()), 1) + self.assertEqual(len(self.product_module.contentValues()), 5) + self.assertEqual(len(self.person_module.contentValues()), 2) + sale_order = self.sale_order_module.contentValues()[0] + person = self.person_module.searchFolder( + portal_type='Person', + title='Jean GRAY', + )[0].getObject() + product = self.product_module.searchFolder( + portal_type='Product', + title='Stylo', + )[0].getObject() + currency = self.currency_module.contentValues()[0] + trade_condition = self.sale_trade_condition_module['tiosafe_sale_trade_condition'] + self.assertEqual(sale_order.getSourceValue(), self.organisation) + self.assertEqual(sale_order.getSourceSectionValue(), self.organisation) + self.assertEqual(sale_order.getDestinationValue(), person) + self.assertEqual(sale_order.getDestinationSectionValue(), person) + self.assertEqual(sale_order.getPriceCurrencyValue(), currency) + self.assertEqual(sale_order.getSpecialiseValueList(), [trade_condition, ]) + self.assertEqual(sale_order.getReference(), '1') + self.assertEqual( + str(sale_order.getStartDate()), str(DateTime('2010-06-14')), + ) + self.assertEqual( + str(sale_order.getStopDate()), str(DateTime('2010-06-16')), + ) + self.assertEqual(round(sale_order.getTotalPrice(), 6), 3.772241) + self.assertEqual(sale_order.getSimulationState(), 'confirmed') + sale_order_line_list = sale_order.contentValues( + portal_type='Sale Order Line', + ) + self.assertEqual(len(sale_order_line_list), 3) + for line in sale_order_line_list: + if line.getTitle() == 'Delivery': + self.assertEqual(line.getTitle(), 'Delivery') + self.assertEqual(line.getResourceValue(), self.delivery) + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_normal_rate', + ) + self.assertEqual(line.getQuantity(), 1.0) + self.assertEqual(round(line.getPrice(), 6), 6.672241) + self.assertEqual(line.getPriceCurrencyValue(), currency) + elif line.getTitle() == 'Discount': + self.assertEqual(line.getTitle(), 'Discount') + self.assertEqual(line.getResourceValue(), self.discount) + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_exempted', + ) + self.assertEqual(line.getQuantity(), 1.0) + self.assertEqual(round(line.getPrice(), 6), -5.0) + self.assertEqual(line.getPriceCurrencyValue(), currency) + elif line.getTitle() == 'Stylo': + self.assertEqual(line.getTitle(), 'Stylo') + self.assertEqual(line.getResourceValue(), product) + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_normal_rate', + ) + self.assertEqual(line.getQuantity(), 1.0) + self.assertEqual(round(line.getPrice(), 6), 2.1) + self.assertEqual(line.getPriceCurrencyValue(), currency) + else: + self.failUnless(line.getTitle() in ['Delivery', 'Stylo', 'Discount']) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + tiosafe_xml=self.root_xml % sale_order.Transaction_asTioSafeXML(), + plugin_xml=self.root_xml % self.prestashop.sale_order_module()[0].asXML(), + xsd_path='../XSD/transactions.xsd', + ) + + def test_PrestashopSyncWithoutDestination(self): + """ Check the sync of sale order without destination. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.initMapping(self.prestashop) + self.createUnknownObject() + self.validateRules() + person_unknown = self.person_module['404'] + self.loadSQLDump( + self.connection, + '%s/dump_sale_order_sync_06.sql' % self.ps_dump_path, + ) + transaction.commit() + self.tic() + + # Run sync process and check result + self.assertEqual(len(self.sale_order_module.contentValues()), 0) + self.assertEqual(len(self.product_module.contentValues()), 1) + self.assertEqual(len(self.person_module.contentValues()), 1) + self.loadSync([ + getattr(self.prestashop, module) + for module in ['person_module', 'product_module', 'sale_order_module'] + ]) + self.assertEqual(len(self.sale_order_module.contentValues()), 1) + self.assertEqual(len(self.product_module.contentValues()), 5) + self.assertEqual(len(self.person_module.contentValues()), 2) + sale_order = self.sale_order_module.contentValues()[0] + product = self.product_module.searchFolder( + portal_type='Product', + title='Stylo', + )[0].getObject() + currency = self.currency_module.contentValues()[0] + trade_condition = self.sale_trade_condition_module['tiosafe_sale_trade_condition'] + self.assertEqual(sale_order.getSourceValue(), self.organisation) + self.assertEqual(sale_order.getSourceSectionValue(), self.organisation) + self.assertEqual(sale_order.getDestinationValue(), person_unknown) + self.assertEqual(sale_order.getDestinationSectionValue(), person_unknown) + self.assertEqual(sale_order.getPriceCurrencyValue(), currency) + self.assertEqual(sale_order.getSpecialiseValueList(), [trade_condition, ]) + self.assertEqual(sale_order.getReference(), '1') + self.assertEqual( + str(sale_order.getStartDate()), str(DateTime('2010-06-14')), + ) + self.assertEqual( + str(sale_order.getStopDate()), str(DateTime('2010-06-16')), + ) + self.assertEqual(round(sale_order.getTotalPrice(), 6), 8.772241) + self.assertEqual(sale_order.getSimulationState(), 'confirmed') + sale_order_line_list = sale_order.contentValues( + portal_type='Sale Order Line', + ) + self.assertEqual(len(sale_order_line_list), 2) + for line in sale_order_line_list: + if line.getTitle() == 'Delivery': + self.assertEqual(line.getTitle(), 'Delivery') + self.assertEqual(line.getResourceValue(), self.delivery) + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_normal_rate', + ) + self.assertEqual(line.getQuantity(), 1.0) + self.assertEqual(round(line.getPrice(), 6), 6.672241) + self.assertEqual(line.getPriceCurrencyValue(), currency) + elif line.getTitle() == 'Stylo': + self.assertEqual(line.getTitle(), 'Stylo') + self.assertEqual(line.getResourceValue(), product) + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_normal_rate', + ) + self.assertEqual(line.getQuantity(), 1.0) + self.assertEqual(round(line.getPrice(), 6), 2.1) + self.assertEqual(line.getPriceCurrencyValue(), currency) + else: + self.failUnless(line.getTitle() in ['Delivery', 'Stylo']) + # Check the XML schema and the fixed point + self.checkTioSafeXML( + tiosafe_xml=self.root_xml % sale_order.Transaction_asTioSafeXML(), + plugin_xml=self.root_xml % self.prestashop.sale_order_module()[0].asXML(), + xsd_path='../XSD/transactions.xsd', + ) + + def test_PrestashopSyncWithoutProduct(self): + """ Check the sync of sale order with a non-existant product. """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.initMapping(self.prestashop) + self.createUnknownObject() + self.validateRules() + product_unknown = self.product_module['404'] + self.loadSQLDump( + self.connection, + '%s/dump_sale_order_sync_07.sql' % self.ps_dump_path, + ) + transaction.commit() + self.tic() + + # Run sync process and check result + self.assertEqual(len(self.sale_order_module.contentValues()), 0) + self.assertEqual(len(self.product_module.contentValues()), 1) + self.assertEqual(len(self.person_module.contentValues()), 1) + self.loadSync([ + getattr(self.prestashop, module) + for module in ['person_module', 'product_module', 'sale_order_module'] + ]) + self.assertEqual(len(self.sale_order_module.contentValues()), 1) + self.assertEqual(len(self.product_module.contentValues()), 5) + self.assertEqual(len(self.person_module.contentValues()), 2) + sale_order = self.sale_order_module.contentValues()[0] + person = self.person_module.searchFolder( + portal_type='Person', + title='Jean GRAY', + )[0].getObject() + currency = self.currency_module.contentValues()[0] + trade_condition = self.sale_trade_condition_module['tiosafe_sale_trade_condition'] + self.assertEqual(sale_order.getSourceValue(), self.organisation) + self.assertEqual(sale_order.getSourceSectionValue(), self.organisation) + self.assertEqual(sale_order.getDestinationValue(), person) + self.assertEqual(sale_order.getDestinationSectionValue(), person) + self.assertEqual(sale_order.getPriceCurrencyValue(), currency) + self.assertEqual(sale_order.getSpecialiseValueList(), [trade_condition, ]) + self.assertEqual(sale_order.getReference(), '1') + self.assertEqual( + str(sale_order.getStartDate()), str(DateTime('2010-06-14')), + ) + self.assertEqual( + str(sale_order.getStopDate()), str(DateTime('2010-06-16')), + ) + self.assertEqual(round(sale_order.getTotalPrice(), 6), 16009.872241) + self.assertEqual(sale_order.getSimulationState(), 'confirmed') + sale_order_line_list = sale_order.contentValues( + portal_type='Sale Order Line', + ) + self.assertEqual(len(sale_order_line_list), 3) + for line in sale_order_line_list: + if line.getTitle() == 'Ballon de Basket - Couleur : Blanc, Taille du Ballon : s4': + self.assertEqual( + line.getTitle(), + 'Ballon de Basket - Couleur : Blanc, Taille du Ballon : s4', + ) + self.assertEqual(line.getResourceValue(), product_unknown) + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_normal_rate', + ) + self.assertEqual(line.getQuantity(), 4.0) + self.assertEqual(round(line.getPrice(), 6), 2000.4) + self.assertEqual(line.getPriceCurrencyValue(), currency) + # FIXME: Is variation are keep even if the product is removed ?? (cf. dump) +# self.assertEqual(line.movement_0_0.getQuantity(), 4.0) +# self.assertEqual(round(line.movement_0_0.getPrice(), 6), 2000.4) +# self.assertEqual( +# line.getVariationCategoryList(), +# ['ball_size/product_module/2/1', 'colour/white', ], +# ) + elif line.getTitle() == 'Ballon de Basket - Couleur : Noir, Taille du Ballon : s5': + self.assertEqual( + line.getTitle(), + 'Ballon de Basket - Couleur : Noir, Taille du Ballon : s5', + ) + self.assertEqual(line.getResourceValue(), product_unknown) + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_normal_rate', + ) + self.assertEqual(line.getQuantity(), 4.0) + self.assertEqual(round(line.getPrice(), 6), 2000.4) + self.assertEqual(line.getPriceCurrencyValue(), currency) + # FIXME: Is variation are keep even if the product is removed ?? (cf. dump) +# self.assertEqual(line.movement_0_0.getQuantity(), 4.0) +# self.assertEqual(round(line.movement_0_0.getPrice(), 6), 2000.4) +# self.assertEqual( +# line.getVariationCategoryList(), +# ['ball_size/product_module/2/2', 'colour/black', ], +# ) + elif line.getTitle() == 'Delivery': # Ballon de Basket / (Couleur/Noir) / (Taille du Ballon/s5) + self.assertEqual(line.getTitle(), 'Delivery') + self.assertEqual(line.getResourceValue(), self.delivery) + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_normal_rate', + ) + self.assertEqual(line.getQuantity(), 1.0) + self.assertEqual(round(line.getPrice(), 6), 6.672241) + self.assertEqual(line.getPriceCurrencyValue(), currency) + else: + raise 'A line has not been checked' + # Check the XML schema and the fixed point + self.checkTioSafeXML( + tiosafe_xml=self.root_xml % sale_order.Transaction_asTioSafeXML(), + plugin_xml=self.root_xml % self.prestashop.sale_order_module()[0].asXML(), + xsd_path='../XSD/transactions.xsd', + ) + + def test_PrestashopGenerateAccounting(self): + """ + This test realises a sync of sale order and generate the accounting to + check that it works. + """ + # Initialize the instance and prestashop + self.initPrestashopTest() + self.initMapping(self.prestashop) + self.createUnknownObject() + self.validateRules() + self.loadSQLDump( + self.connection, + '%s/dump_sale_order_sync_08.sql' % self.ps_dump_path, + ) + transaction.commit() + self.tic() + + # Run sync process and check result + self.assertEqual(len(self.sale_order_module.contentValues()), 0) + self.assertEqual(len(self.product_module.contentValues()), 1) + self.assertEqual(len(self.person_module.contentValues()), 1) + self.loadSync([ + getattr(self.prestashop, module) + for module in ['person_module', 'product_module', 'sale_order_module'] + ]) + self.assertEqual(len(self.sale_order_module.contentValues()), 1) + self.assertEqual(len(self.product_module.contentValues()), 5) + self.assertEqual(len(self.person_module.contentValues()), 2) + sale_order = self.sale_order_module.contentValues()[0] + person = self.person_module.searchFolder( + portal_type='Person', + title='Jean GRAY', + )[0].getObject() + product = self.product_module.searchFolder( + portal_type='Product', + title='Stylo', + )[0].getObject() + # TODO: What about the vat ????? + vat_normal = self.service_module.searchFolder( + portal_type='Service', + title='VAT Normal', + )[0].getObject() + currency = self.currency_module.contentValues()[0] + trade_condition = self.sale_trade_condition_module['tiosafe_sale_trade_condition'] + self.assertEqual(sale_order.getSourceValue(), self.organisation) + self.assertEqual(sale_order.getSourceSectionValue(), self.organisation) + self.assertEqual(sale_order.getDestinationValue(), person) + self.assertEqual(sale_order.getDestinationSectionValue(), person) + self.assertEqual(sale_order.getPriceCurrencyValue(), currency) + self.assertEqual(sale_order.getSpecialiseValueList(), [trade_condition, ]) + self.assertEqual(sale_order.getReference(), '1') + self.assertEqual( + str(sale_order.getStartDate()), str(DateTime('2010-06-14')), + ) + self.assertEqual( + str(sale_order.getStopDate()), str(DateTime('2010-06-16')), + ) + self.assertEqual(round(sale_order.getTotalPrice(), 6), 8.772241) + self.assertEqual(sale_order.getSimulationState(), 'confirmed') + sale_order_line_list = sale_order.contentValues( + portal_type='Sale Order Line', + ) + self.assertEqual(len(sale_order_line_list), 2) + for line in sale_order_line_list: + if line.getTitle() == 'Delivery': + self.assertEqual(line.getTitle(), 'Delivery') + self.assertEqual(line.getResourceValue(), self.delivery) + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_normal_rate', + ) + self.assertEqual(line.getQuantity(), 1.0) + self.assertEqual(round(line.getPrice(), 6), 6.672241) + self.assertEqual(line.getPriceCurrencyValue(), currency) + elif line.getTitle() == 'Stylo': + self.assertEqual(line.getTitle(), 'Stylo') + self.assertEqual(line.getResourceValue(), product) + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_normal_rate', + ) + self.assertEqual(line.getQuantity(), 1.0) + self.assertEqual(round(line.getPrice(), 6), 2.1) + self.assertEqual(line.getPriceCurrencyValue(), currency) + else: + self.failUnless(line.getTitle() in ['Delivery', 'Stylo']) + + raise 'A line has not been checked' + # Check the accounting + sale_packing_list = sale_order.getCausalityRelatedValue( + portal_type='Sale Packing List', + ) + self.assertNotEqual(sale_packing_list, None) + # Ship the sale packing list + sale_packing_list.start() + self.assertEqual(sale_packing_list.getSimulationState(), 'started') + transaction.commit() + self.tic() + self.assertEqual( + len(sale_packing_list.contentValues()), + len(sale_packing_list.contentValues( + portal_type='Sale Packing List Line'), + ), + 2, + ) + # Check the sale invoice and the lines + invoice = sale_packing_list.getCausalityRelatedValue( + portal_type='Sale Invoice Transaction', + ) + self.assertNotEqual(invoice, None) + invoice_line_list = invoice.getMovementList(portal_type='Invoice Line') + self.assertEqual(len(invoice_line_list), 3) + for line in invoice_line_list: + if line.getResourceValue() == self.delivery: + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_normal_rate', + ) + self.assertEqual(line.getQuantity(), 1.0) + self.assertEqual(line.getPrice(), line.getTotalPrice(), 6.672241) + elif line.getResourceValue() == product: + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/base/taxable/vat/vat_normal_rate', + ) + self.assertEqual(line.getQuantity(), 1.0) + self.assertEqual(line.getPrice(), line.getTotalPrice(), 2.1) + elif line.getResourceValue() == vat_normal: + self.assertEqual( + line.getBaseContribution(), + 'base_amount/trade/l10n/fr/vat/purchase_sale/national', + ) + self.assertEqual(line.getQuantity(), 6.672241 + 2.1) + self.assertEqual(line.getPrice(), 0.196) + self.assertEqual(line.getTotalPrice(), 6.672241 * 0.196 + 2.1 * 0.196) + else: + raise 'The lines must contain VAT, Product or Delivery, nothing else.' + # Check the XML schema and the fixed point + self.checkTioSafeXML( + tiosafe_xml=self.root_xml % sale_order.Transaction_asTioSafeXML(), + plugin_xml=self.root_xml % self.prestashop.sale_order_module()[0].asXML(), + xsd_path='../XSD/transactions.xsd', + ) + + def test_PrestashopUpdateDoNothing(self): + """ + Check that the update of a sale order after the sync do nothing + """ + # Initialize the instance and prestashop + portal_sync = self.portal.portal_synchronizations + self.initPrestashopTest() + self.initMapping(self.prestashop) + self.createUnknownObject() + self.validateRules() + self.loadSQLDump( + self.connection, + '%s/dump_sale_order_sync_01.sql' % self.ps_dump_path, + ) + transaction.commit() + self.tic() + # Run sync process and check result + self.assertEqual(len(self.sale_order_module.contentValues()), 0) + self.assertEqual(len(self.product_module.contentValues()), 1) + self.assertEqual(len(self.person_module.contentValues()), 1) + self.loadSync([ + getattr(self.prestashop, module) + for module in ['person_module', 'product_module', 'sale_order_module'] + ]) + self.assertEqual(len(self.sale_order_module.contentValues()), 1) + self.assertEqual(len(self.product_module.contentValues()), 5) + self.assertEqual(len(self.person_module.contentValues()), 2) + self.assertEqual(str(self.sale_order_module.objectValues()[0].getStartDate()), '2010/06/14') + # Update the sale order + self.loadSQLDump( + self.connection, + '%s/dump_sale_order_sync_09.sql' % self.ps_dump_path, + ) + transaction.commit() + self.tic() + self.loadSync([ + getattr(self.prestashop, module) + for module in ['sale_order_module',] + ]) + self.assertEqual(str(self.sale_order_module.objectValues()[0].getStartDate()), '2010/06/14') + + + def test_PrestashopDeleteDoNothing(self): + """ + Check that the delete of a sale order after the sync did nothing + """ + # Initialize the instance and prestashop + portal_sync = self.portal.portal_synchronizations + self.initPrestashopTest() + self.initMapping(self.prestashop) + self.createUnknownObject() + self.validateRules() + self.loadSQLDump( + self.connection, + '%s/dump_sale_order_sync_01.sql' % self.ps_dump_path, + ) + transaction.commit() + self.tic() + # Run sync process and check result + self.assertEqual(len(self.sale_order_module.contentValues()), 0) + self.assertEqual(len(self.product_module.contentValues()), 1) + self.assertEqual(len(self.person_module.contentValues()), 1) + self.loadSync([ + getattr(self.prestashop, module) + for module in ['person_module', 'product_module', 'sale_order_module'] + ]) + self.assertEqual(len(self.sale_order_module.contentValues()), 1) + self.assertEqual(len(self.product_module.contentValues()), 5) + self.assertEqual(len(self.person_module.contentValues()), 2) + self.assertEqual(self.sale_order_module.objectValues()[0].getSimulationState(), "confirmed") + # load a dump in which the sale order no longer exists + self.loadSQLDump( + self.connection, + '%s/dump_sale_order_sync_10.sql' % self.ps_dump_path, + ) + transaction.commit() + self.tic() + self.loadSync([ + getattr(self.prestashop, module) + for module in ['sale_order_module',] + ]) + self.assertEqual(self.sale_order_module.objectValues()[0].getSimulationState(), "confirmed") + diff --git a/product/ERP5TioSafe/tests/testTioSafeMixin.py b/product/ERP5TioSafe/tests/testTioSafeMixin.py new file mode 100644 index 0000000000000000000000000000000000000000..41f7284619bfce62d174d8b57460ebac3e1602bd --- /dev/null +++ b/product/ERP5TioSafe/tests/testTioSafeMixin.py @@ -0,0 +1,354 @@ +############################################################################## +# +# Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved. +# Aurelien Calonne <aurel@nexedi.com> +# Hervé Poulain <herve@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +import os +import subprocess +import transaction +from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase +from AccessControl.SecurityManagement import newSecurityManager +from zLOG import LOG, ERROR +from lxml import etree +from StringIO import StringIO +from Products.ERP5Type.tests.runUnitTest import tests_home +from difflib import unified_diff + +class testTioSafeMixin(ERP5TypeTestCase): + """ This class provides the main generics elements of test. """ + + def getSynchronizationTool(self): + """ return the tool """ + return self.portal.portal_synchronizations + + def getBusinessTemplateList(self): + """ Return the list of BT required by unit tests. """ + return ( + 'erp5_base', + 'erp5_pdm', + 'erp5_trade', + 'erp5_accounting', + 'erp5_invoicing', + 'erp5_simplified_invoicing', + 'erp5_syncml', + 'erp5_tiosafe_core', + 'erp5_tiosafe_test', + 'erp5_tiosafe_accounting', + 'erp5_tiosafe_prestashop', + 'erp5_oauth', + ) + + def beforeTearDown(self): + """ Call the methods which remove all created elements. """ + # remove the main elements, person, account + for module_id in ["person_module", "product_module", "sale_order_module"]: + module = getattr(self.portal, module_id) + module.manage_delObjects([x for x in module.objectIds()]) + + # delete the category integration mapping of the full integration site + for integration_site in self.portal.portal_integrations.contentValues(): + self.deleteMapping(integration_site) + + # reset the pub/sub + for sync in self.portal.portal_synchronizations.contentValues(): + if sync.getPortalType() == 'Publication': + sync.resetSubscriberList() + else: + sync.resetSignatureList() + sync.resetAnchorList() + + # drop the prestashop tables + self.loadSQLDump( + self.portal.erp5_sql_connection, + 'dump/prestashop/dump_99_drop_tables.sql', + ) + transaction.commit() + self.tic() + + def makeFilePath(self, file_path): + """ This method allows to build a file path to work with the file. """ + return '%s/%s' % (os.path.dirname(__file__), file_path) + + def loadSQLDump(self, connection, file_path): + """ This methods allows to generate a database dump. """ + file = open(self.makeFilePath(file_path), 'r') + sql = file.read().replace(';', ';\0') + connection.manage_test(sql) + + def executeQuery(self, connection, query): + """ + This method execute an SQL query in the database. These two elements are + give as parameters. + """ + connection.manage_test(query) + + def executePHP(self, integration_site, file_path, **kw): + """ Execute a php script with the parameter given through kw. """ + # Build the args of the php command + php_args = '$_GET["site_path"] = "%s";' % integration_site.getRelativeUrl() + for key, value in kw.items(): + php_args += '$_GET["%s"] = "%s";' % (key, value) + php_args += 'include("%s");' % self.makeFilePath(file_path) + # Execute the php command and return the result + process = subprocess.Popen( + ['php', '-r', php_args, ], + stdout=subprocess.PIPE, + ) + return process.stdout.read() + + def login(self): + acl_users = self.portal.acl_users + acl_users._doAddUser('TioSafeUser', 'TioSafeUserPassword', ['Manager'], []) + user = acl_users.getUserById('TioSafeUser').__of__(acl_users) + newSecurityManager(None, user) + + def updateSynchronizationObjects(self): + """ Change the url string of publication & subscription for tests """ + sync_server_path = "file://%s/sync_server" % tests_home + sync_client_path = "file://%s/sync_client" % tests_home + portal_sync = self.getSynchronizationTool() + + for pub in portal_sync.objectValues(portal_type="SyncML Publication"): + pub.edit( + url_string=sync_server_path, + subscription_url_string=sync_server_path, + ) + for sub in portal_sync.objectValues(portal_type="SyncML Subscription"): + sub.edit( + url_string=sync_server_path, + subscription_url_string=sync_client_path, + user_id='TioSafeUser', + password='TioSafeUserPassword', + ) + + def synchronize(self, publication, subscription): + """ This method allows to run the synchronization. """ + portal_sync = self.getSynchronizationTool() + # To simulate sync which works by networks, the unittest will use file. + # The XML frames will be exchange by file. + # Reset files because we work on synchronization by this way. + # Reset Publication URL + file = open(subscription.getUrlString()[len('file:/'):], 'w') + file.write('') + file.close() + # Reset Subscription URL + file = open(subscription.getSubscriptionUrlString()[len('file:/'):], 'w') + file.write('') + file.close() + transaction.commit() + self.tic() + # Number of message exchange during synchronization + nb_message = 1 + # Run synchronization + result = portal_sync.SubSync(subscription.getPath()) + while result['has_response'] == 1: + portal_sync.PubSync(publication.getPath()) + transaction.commit() + LOG("COMMIT", 300, "COMMIT") + self.tic() + result = portal_sync.SubSync(subscription.getPath()) + transaction.commit() + LOG("COMMIT", 300, "COMMIT") + self.tic() + nb_message += 1 + result['has_response'] + return nb_message + + def loadSync(self, sync_list=None, **kw): + """ This method allows to call sync on each element of a list. """ + # ZopeTestCase._print('\nSynchronize Persons and Products\n') + for module in sync_list: + LOG('Synchronization... ', 0, str(module.getId())) + self.synchronize( + publication=module.getSourceSectionValue(), + subscription=module.getDestinationSectionValue(), + ) + + def getConnectionPlugin(self, site, plugin_type=None): + """ + Return a specific conneciton plugin + """ + # XXX-AUREL implement type when needed + if plugin_type is not None: + raise NotImplementedError + return site.objectValues(portal_type=['Web Service Connector',])[0] + + def createMapping(self, integration_site=None, title=None, path=None, + source_reference=None, destination_reference=None): + """ + This method allows to declare a mapping through the elements give as + parameters in the integration site a mapping with the corresponding ERP5 + category. + """ + # XXX-Aurel why don't we use the dict pass as parameter ? + base = integration_site + path_list = path.split('/') + keyword = {} + for link in path_list: + if getattr(base, link, None) is not None: + base = getattr(base, link, None) + else: + keyword['portal_type'] = 'Integration Category Mapping' + keyword['title'] = title + keyword['id'] = link + keyword['source_reference'] = source_reference + if base == integration_site: + keyword['portal_type'] = 'Integration Base Category Mapping' + keyword['destination_reference'] = destination_reference + if len(path_list) != 1: + continue + else: + keyword['destination_reference'] = base.getDestinationReference() + "/" + destination_reference + # create the mapping + base.newContent(**keyword) + + def initMapping(self, integration_site=None): + """ This method create the mapping in the integration site. """ + # integration site mapping + if integration_site is not None and \ + integration_site.getPortalType() == 'Integration Site': + # think to order the list of creation of mappings + mapping_dict_list = [ + { 'title': 'Country', + 'path': 'Country', + 'source_reference': 'Country', + 'destination_reference': 'region', }, + { 'title': 'France', + 'path': 'Country/France', + 'source_reference': 'France', + 'destination_reference': 'france', }, + { 'title': 'Allemagne', + 'path': 'Country/Allemagne', + 'source_reference': 'Allemagne', + 'destination_reference': 'europe/western_europe/allemagne', }, + { 'title': 'Taille du Ballon', + 'path': 'TailleduBallon', + 'source_reference': 'Taille du Ballon', + 'destination_reference': 'ball_size', }, + { 'title': 's4', + 'path': 'TailleduBallon/s4', + 'source_reference': 's4', + 'destination_reference': 'x4', }, + { 'title': 's5', + 'path': 'TailleduBallon/s5', + 'source_reference': 's5', + 'destination_reference': 'x5', }, + { 'title': 's6', + 'path': 'TailleduBallon/s6', + 'source_reference': 's6', + 'destination_reference': 'x6', }, + { 'title': 'Couleur', + 'path': 'Couleur', + 'source_reference': 'Couleur', + 'destination_reference': 'colour', }, + { 'title': 'Blanc', + 'path': 'Couleur/Blanc', + 'source_reference': 'Blanc', + 'destination_reference': 'white', }, + { 'title': 'Noir', + 'path': 'Couleur/Noir', + 'source_reference': 'Noir', + 'destination_reference': 'black', }, + { 'title': 'Rouge', + 'path': 'Couleur/Rouge', + 'source_reference': 'Rouge', + 'destination_reference': 'red', }, + { 'title': 'Payment Mode', + 'path': 'PaymentMode', + 'source_reference': 'Payment Mode', + 'destination_reference': 'payment_mode', }, + { 'title': 'CB', + 'path': 'PaymentMode/CB', + 'source_reference': 'CB', + 'destination_reference': 'cb', }, + { 'title': 'Cheque', + 'path': 'PaymentMode/Cheque', + 'source_reference': 'Cheque', + 'destination_reference': 'cb', }, + ] + # browses the list of categories dict + for mapping in mapping_dict_list: + self.createMapping(integration_site=integration_site, **mapping) + + transaction.commit() + self.tic() + + def deleteMapping(self, integration_site): + """ Remove the category integration mapping of integration site. """ + for category in integration_site.contentValues( + portal_type='Integration Base Category Mapping'): + integration_site.manage_delObjects(category.getId()) + + def createUnknownObject(self): + """ This method declare the unknown element like Persons and Product. """ + person_module = self.portal.person_module + product_module = self.portal.product_module + # Person unknown + if getattr(person_module, '404', None) is None: + person_module.newContent( + portal_type='Person', + id='404', + title='Unknown', + default_email_text='unknown@person.com', + # FIXME: Require to build source/destination because email is required + ) + # Product unknown + if getattr(product_module, '404', None) is None: + product_module.newContent( + portal_type='Product', + id='404', + title='Unknown', + reference="Unknown", + ) + + def checkTioSafeXML(self, plugin_xml=None, tiosafe_xml=None, xsd_path=None): + """ + This methods allows to check the xmls with the xsd and to check that + the two xml are the same. + """ + self.assertTrue(self.validateXMLSchema(plugin_xml, xsd_path)) + self.assertTrue(self.validateXMLSchema(tiosafe_xml, xsd_path)) + try: + self.assertEqual(plugin_xml, tiosafe_xml) + except AssertionError: + diff = "\n" + for x in unified_diff(plugin_xml.split('\n'), tiosafe_xml.split('\n'), "plugin", "tiosafe", lineterm=''): + diff += "%s\n" %(x) + raise AssertionError, diff + + def validateXMLSchema(self, xml, file_path): + """ This method allows to check and validate the schema of an xml. """ + file = open(self.makeFilePath(file_path) ,'r') + xml_schema = ''.join(file.readlines()) + xml_schema = StringIO(xml_schema) + xml_schema = etree.parse(xml_schema) + xml_schema = etree.XMLSchema(xml_schema) + xml = etree.XML(xml) + validated = xml_schema.validate(xml) + if validated is False: + LOG("validateXMLSchema failed with", ERROR, "%s" %(xml_schema.error_log.filter_from_errors()[0])) + return validated + diff --git a/product/ERP5TioSafe/tool.png b/product/ERP5TioSafe/tool.png new file mode 100644 index 0000000000000000000000000000000000000000..681679219796ba6657aba4a13518b632ac71e05f Binary files /dev/null and b/product/ERP5TioSafe/tool.png differ