diff --git a/htdocs/install/mysql/data/llx_const.sql b/htdocs/install/mysql/data/llx_const.sql index ced4a0d8427..99da23f53a5 100644 --- a/htdocs/install/mysql/data/llx_const.sql +++ b/htdocs/install/mysql/data/llx_const.sql @@ -97,3 +97,9 @@ insert into llx_const (name, value, type, visible, entity) VALUES ('CONTRACT_ADD insert into llx_const (name, value, type, visible, entity) VALUES ('USERGROUP_ADDON_PDF_ODT_PATH', 'DOL_DATA_ROOT/doctemplates/usergroups', 'chaine', 0, 1); insert into llx_const (name, value, type, visible, entity) VALUES ('USER_ADDON_PDF_ODT_PATH', 'DOL_DATA_ROOT/doctemplates/users', 'chaine', 0, 1); + +-- +-- PRODUCTS +-- +INSERT INTO llx_const (name, entity, value, type, visible) VALUES ('PRODUCT_PRICE_BASE_TYPE', 0, 'HT', 'string', 0); + diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index 834cc178979..14c176b1c20 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -46,4 +46,7 @@ UPDATE llx_establishment SET ref = rowid WHERE ref IS NULL; ALTER TABLE llx_establishment MODIFY COLUMN ref varchar(30) NOT NULL; ALTER TABLE llx_establishment MODIFY COLUMN name varchar(128); +INSERT INTO llx_const (name, entity, value, type, visible) VALUES ('PRODUCT_PRICE_BASE_TYPE', 0, 'HT', 'string', 0); + ALTER TABLE llx_subscription MODIFY COLUMN datef DATETIME; + diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index fb4379f5e1a..a1bbc45f970 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -106,6 +106,7 @@ NoteNotVisibleOnBill=Note (not visible on invoices, proposals...) ServiceLimitedDuration=If product is a service with limited duration: MultiPricesAbility=Multiple price segments per product/service (each customer is in one price segment) MultiPricesNumPrices=Number of prices +DefaultPriceType=Base of prices per default (with versus without tax) when adding new sale prices AssociatedProductsAbility=Activate virtual products (kits) AssociatedProducts=Virtual products AssociatedProductsNumber=Number of products composing this virtual product diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 9219eb2d1cd..c4b720bb7be 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -106,6 +106,7 @@ NoteNotVisibleOnBill=Note (non visible sur les factures, propals...) ServiceLimitedDuration=Si produit de type service à durée limitée : MultiPricesAbility=Plusieurs niveaux de prix par produit/service (chaque client est dans un et un seul niveau) MultiPricesNumPrices=Nombre de prix +DefaultPriceType=Type de prix par default AssociatedProductsAbility=Pris en charge des produits virtuels (kits) AssociatedProducts=Produits virtuels AssociatedProductsNumber=Nbre de sous-produits constituant ce produit virtuel diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 5427b6620dc..f0095059053 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -124,6 +124,9 @@ if ($action == 'other') } } + $value = GETPOST('price_base_type', 'alpha'); + $res = dolibarr_set_const($db, "PRODUCT_PRICE_BASE_TYPE", $value, 'chaine', 0, '', $conf->entity); + $value = GETPOST('PRODUIT_SOUSPRODUITS', 'alpha'); $res = dolibarr_set_const($db, "PRODUIT_SOUSPRODUITS", $value, 'chaine', 0, '', $conf->entity); @@ -571,6 +574,14 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ print ''; } +//Default product price base type +print ''; +print ''.$langs->trans("DefaultPriceType").''; +print ''; +print $form->selectPriceBaseType($conf->global->PRODUCT_PRICE_BASE_TYPE, "price_base_type"); +print ''; +print ''; + // sousproduits activation/desactivation print ''; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 8ab7d6be41a..385e656458a 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1176,7 +1176,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) // Price print ''.$langs->trans("SellingPrice").''; print ''; - print $form->selectPriceBaseType($object->price_base_type, "price_base_type"); + print $form->selectPriceBaseType($conf->global->PRODUCT_PRICE_BASE_TYPE, "price_base_type"); print ''; // Min price