Skip to content
Snippets Groups Projects
Commit ffecdc13 authored by Phf's avatar Phf
Browse files

[CORE] déplacement de la création des tables du module dans le script de...

[CORE] déplacement de la création des tables du module dans le script de migration (#new_ask_price).
parent a1d2f426
No related branches found
No related tags found
No related merge requests found
CREATE TABLE `llx_askpricesupplier` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`ref` varchar(30) NOT NULL,
`entity` int(11) NOT NULL DEFAULT '1',
`ref_ext` varchar(255) DEFAULT NULL,
`ref_int` varchar(255) DEFAULT NULL,
`fk_soc` int(11) DEFAULT NULL,
`fk_projet` int(11) DEFAULT NULL,
`tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`datec` datetime DEFAULT NULL,
`date_valid` datetime DEFAULT NULL,
`date_cloture` datetime DEFAULT NULL,
`fk_user_author` int(11) DEFAULT NULL,
`fk_user_modif` int(11) DEFAULT NULL,
`fk_user_valid` int(11) DEFAULT NULL,
`fk_user_cloture` int(11) DEFAULT NULL,
`fk_statut` smallint(6) NOT NULL DEFAULT '0',
`price` double DEFAULT '0',
`remise_percent` double DEFAULT '0',
`remise_absolue` double DEFAULT '0',
`remise` double DEFAULT '0',
`total_ht` double(24,8) DEFAULT '0.00000000',
`tva` double(24,8) DEFAULT '0.00000000',
`localtax1` double(24,8) DEFAULT '0.00000000',
`localtax2` double(24,8) DEFAULT '0.00000000',
`total` double(24,8) DEFAULT '0.00000000',
`fk_account` int(11) DEFAULT NULL,
`fk_currency` varchar(3) DEFAULT NULL,
`fk_cond_reglement` int(11) DEFAULT NULL,
`fk_mode_reglement` int(11) DEFAULT NULL,
`note_private` text,
`note_public` text,
`model_pdf` varchar(255) DEFAULT NULL,
`date_livraison` date DEFAULT NULL,
`fk_shipping_method` int(11) DEFAULT NULL,
`import_key` varchar(14) DEFAULT NULL,
`extraparams` varchar(255) DEFAULT NULL,
PRIMARY KEY (`rowid`),
UNIQUE KEY `uk_askpricesupplier_ref` (`ref`,`entity`),
KEY `idx_askpricesupplier_fk_soc` (`fk_soc`),
KEY `idx_askpricesupplier_fk_user_author` (`fk_user_author`),
KEY `idx_askpricesupplier_fk_user_valid` (`fk_user_valid`),
KEY `idx_askpricesupplier_fk_user_cloture` (`fk_user_cloture`),
KEY `idx_askpricesupplier_fk_projet` (`fk_projet`),
KEY `idx_askpricesupplier_fk_account` (`fk_account`),
KEY `idx_askpricesupplier_fk_currency` (`fk_currency`),
CONSTRAINT `fk_askpricesupplier_fk_projet` FOREIGN KEY (`fk_projet`) REFERENCES `llx_projet` (`rowid`),
CONSTRAINT `fk_askpricesupplier_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`),
CONSTRAINT `fk_askpricesupplier_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`),
CONSTRAINT `fk_askpricesupplier_fk_user_cloture` FOREIGN KEY (`fk_user_cloture`) REFERENCES `llx_user` (`rowid`),
CONSTRAINT `fk_askpricesupplier_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8
CREATE TABLE `llx_askpricesupplier_extrafields` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`fk_object` int(11) NOT NULL,
`import_key` varchar(14) DEFAULT NULL,
PRIMARY KEY (`rowid`),
KEY `idx_askpricesupplier_extrafields` (`fk_object`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
\ No newline at end of file
CREATE TABLE `llx_askpricesupplierdet` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`fk_askpricesupplier` int(11) NOT NULL,
`fk_parent_line` int(11) DEFAULT NULL,
`fk_product` int(11) DEFAULT NULL,
`label` varchar(255) DEFAULT NULL,
`description` text,
`fk_remise_except` int(11) DEFAULT NULL,
`tva_tx` double(6,3) DEFAULT '0.000',
`localtax1_tx` double(6,3) DEFAULT '0.000',
`localtax1_type` varchar(10) DEFAULT NULL,
`localtax2_tx` double(6,3) DEFAULT '0.000',
`localtax2_type` varchar(10) DEFAULT NULL,
`qty` double DEFAULT NULL,
`remise_percent` double DEFAULT '0',
`remise` double DEFAULT '0',
`price` double DEFAULT NULL,
`subprice` double(24,8) DEFAULT '0.00000000',
`total_ht` double(24,8) DEFAULT '0.00000000',
`total_tva` double(24,8) DEFAULT '0.00000000',
`total_localtax1` double(24,8) DEFAULT '0.00000000',
`total_localtax2` double(24,8) DEFAULT '0.00000000',
`total_ttc` double(24,8) DEFAULT '0.00000000',
`product_type` int(11) DEFAULT '0',
`info_bits` int(11) DEFAULT '0',
`buy_price_ht` double(24,8) DEFAULT '0.00000000',
`fk_product_fournisseur_price` int(11) DEFAULT NULL,
`special_code` int(11) DEFAULT '0',
`rang` int(11) DEFAULT '0',
`ref_fourn` varchar(30) DEFAULT NULL,
PRIMARY KEY (`rowid`),
KEY `idx_askpricesupplierdet_fk_askpricesupplierdet` (`fk_askpricesupplier`),
KEY `idx_askpricesupplierdet_fk_product` (`fk_product`),
CONSTRAINT `fk_askpricesupplierdet_fk_askpricesupplier` FOREIGN KEY (`fk_askpricesupplier`) REFERENCES `llx_askpricesupplier` (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8
CREATE TABLE `llx_askpricesupplierdet_extrafields` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`fk_object` int(11) NOT NULL,
`import_key` varchar(14) DEFAULT NULL,
PRIMARY KEY (`rowid`),
KEY `idx_askpricesupplierdet_extrafields` (`fk_object`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
\ No newline at end of file
......@@ -217,7 +217,6 @@ class modAskPriceSupplier extends DolibarrModules
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','askpricesupplier',".$conf->entity.")",
);
$result=$this->_load_tables('/comm/askpricesupplier/sql/');
return $this->_init($sql, $options);
}
......
......@@ -101,3 +101,112 @@ create table llx_contratdet_extrafields
ALTER TABLE llx_contratdet_extrafields ADD INDEX idx_contratdet_extrafields (fk_object);
ALTER TABLE llx_product_fournisseur_price ADD COLUMN delivery_time_days integer;
-- Module AskPriceSupplier --
CREATE TABLE `llx_askpricesupplier` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`ref` varchar(30) NOT NULL,
`entity` int(11) NOT NULL DEFAULT '1',
`ref_ext` varchar(255) DEFAULT NULL,
`ref_int` varchar(255) DEFAULT NULL,
`fk_soc` int(11) DEFAULT NULL,
`fk_projet` int(11) DEFAULT NULL,
`tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`datec` datetime DEFAULT NULL,
`date_valid` datetime DEFAULT NULL,
`date_cloture` datetime DEFAULT NULL,
`fk_user_author` int(11) DEFAULT NULL,
`fk_user_modif` int(11) DEFAULT NULL,
`fk_user_valid` int(11) DEFAULT NULL,
`fk_user_cloture` int(11) DEFAULT NULL,
`fk_statut` smallint(6) NOT NULL DEFAULT '0',
`price` double DEFAULT '0',
`remise_percent` double DEFAULT '0',
`remise_absolue` double DEFAULT '0',
`remise` double DEFAULT '0',
`total_ht` double(24,8) DEFAULT '0.00000000',
`tva` double(24,8) DEFAULT '0.00000000',
`localtax1` double(24,8) DEFAULT '0.00000000',
`localtax2` double(24,8) DEFAULT '0.00000000',
`total` double(24,8) DEFAULT '0.00000000',
`fk_account` int(11) DEFAULT NULL,
`fk_currency` varchar(3) DEFAULT NULL,
`fk_cond_reglement` int(11) DEFAULT NULL,
`fk_mode_reglement` int(11) DEFAULT NULL,
`note_private` text,
`note_public` text,
`model_pdf` varchar(255) DEFAULT NULL,
`date_livraison` date DEFAULT NULL,
`fk_shipping_method` int(11) DEFAULT NULL,
`import_key` varchar(14) DEFAULT NULL,
`extraparams` varchar(255) DEFAULT NULL,
PRIMARY KEY (`rowid`),
UNIQUE KEY `uk_askpricesupplier_ref` (`ref`,`entity`),
KEY `idx_askpricesupplier_fk_soc` (`fk_soc`),
KEY `idx_askpricesupplier_fk_user_author` (`fk_user_author`),
KEY `idx_askpricesupplier_fk_user_valid` (`fk_user_valid`),
KEY `idx_askpricesupplier_fk_user_cloture` (`fk_user_cloture`),
KEY `idx_askpricesupplier_fk_projet` (`fk_projet`),
KEY `idx_askpricesupplier_fk_account` (`fk_account`),
KEY `idx_askpricesupplier_fk_currency` (`fk_currency`),
CONSTRAINT `fk_askpricesupplier_fk_projet` FOREIGN KEY (`fk_projet`) REFERENCES `llx_projet` (`rowid`),
CONSTRAINT `fk_askpricesupplier_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`),
CONSTRAINT `fk_askpricesupplier_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`),
CONSTRAINT `fk_askpricesupplier_fk_user_cloture` FOREIGN KEY (`fk_user_cloture`) REFERENCES `llx_user` (`rowid`),
CONSTRAINT `fk_askpricesupplier_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
CREATE TABLE `llx_askpricesupplierdet` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`fk_askpricesupplier` int(11) NOT NULL,
`fk_parent_line` int(11) DEFAULT NULL,
`fk_product` int(11) DEFAULT NULL,
`label` varchar(255) DEFAULT NULL,
`description` text,
`fk_remise_except` int(11) DEFAULT NULL,
`tva_tx` double(6,3) DEFAULT '0.000',
`localtax1_tx` double(6,3) DEFAULT '0.000',
`localtax1_type` varchar(10) DEFAULT NULL,
`localtax2_tx` double(6,3) DEFAULT '0.000',
`localtax2_type` varchar(10) DEFAULT NULL,
`qty` double DEFAULT NULL,
`remise_percent` double DEFAULT '0',
`remise` double DEFAULT '0',
`price` double DEFAULT NULL,
`subprice` double(24,8) DEFAULT '0.00000000',
`total_ht` double(24,8) DEFAULT '0.00000000',
`total_tva` double(24,8) DEFAULT '0.00000000',
`total_localtax1` double(24,8) DEFAULT '0.00000000',
`total_localtax2` double(24,8) DEFAULT '0.00000000',
`total_ttc` double(24,8) DEFAULT '0.00000000',
`product_type` int(11) DEFAULT '0',
`info_bits` int(11) DEFAULT '0',
`buy_price_ht` double(24,8) DEFAULT '0.00000000',
`fk_product_fournisseur_price` int(11) DEFAULT NULL,
`special_code` int(11) DEFAULT '0',
`rang` int(11) DEFAULT '0',
`ref_fourn` varchar(30) DEFAULT NULL,
PRIMARY KEY (`rowid`),
KEY `idx_askpricesupplierdet_fk_askpricesupplierdet` (`fk_askpricesupplier`),
KEY `idx_askpricesupplierdet_fk_product` (`fk_product`),
CONSTRAINT `fk_askpricesupplierdet_fk_askpricesupplier` FOREIGN KEY (`fk_askpricesupplier`) REFERENCES `llx_askpricesupplier` (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
CREATE TABLE `llx_askpricesupplier_extrafields` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`fk_object` int(11) NOT NULL,
`import_key` varchar(14) DEFAULT NULL,
PRIMARY KEY (`rowid`),
KEY `idx_askpricesupplier_extrafields` (`fk_object`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `llx_askpricesupplierdet_extrafields` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`fk_object` int(11) NOT NULL,
`import_key` varchar(14) DEFAULT NULL,
PRIMARY KEY (`rowid`),
KEY `idx_askpricesupplierdet_extrafields` (`fk_object`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
-- End Module AskPriceSupplier --
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment