Jump to content

How does prestashop create supplyorder id (duplicate functionality to create stock transfer ID)


Recommended Posts

Hi, 

 

I wanna create  new table with primary id as stock transfer id.

Can anyone point to me which file or function that prestashop use to create unique supplyorder ID. is it this part in classes/stock/SupplyOrder.php?

 

   public static $definition = array(
        'table' => 'supply_order',
        'primary' => 'id_supply_order',
        'fields' => array(
            'id_supplier' =>            array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
            'supplier_name' =>            array('type' => self::TYPE_STRING, 'validate' => 'isCatalogName', 'required' => false),
            'id_lang' =>                array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
            'id_warehouse' =>            array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
            'id_supply_order_state' =>    array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
            'id_currency' =>            array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
            'id_ref_currency' =>        array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
            'reference' =>                array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true),
            'date_delivery_expected' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'required' => true),
            'total_te' =>                array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
            'total_with_discount_te' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
            'total_ti' =>                array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
            'total_tax' =>                array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
            'discount_rate' =>            array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => false),
            'discount_value_te' =>        array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
            'is_template' =>            array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
            'date_add' =>                array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
            'date_upd' =>                array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
        ),
    );

 

then it will auto create unique supply order id when new Supplyorder got added ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...