2
0
forked from Wavyzz/dolibarr

ADD: Allow import and export of customer prices and price level together

This commit is contained in:
Mélina JOUM
2025-02-20 16:32:36 +01:00
parent de8a55fa9d
commit 7c20c7a7c0
3 changed files with 8 additions and 8 deletions

View File

@@ -325,7 +325,7 @@ class modProduct extends DolibarrModules
$this->export_sql_order[$r] = ' GROUP BY p.rowid'; // FIXME The group by used a generic value to say "all fields in select except function fields"
}
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
// Exports product multiprice
$r++;
$this->export_code[$r] = $this->rights_class.'_'.$r;
@@ -361,7 +361,7 @@ class modProduct extends DolibarrModules
$this->export_sql_end[$r] .= ' ORDER BY p.ref, pr.price_level';
}
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
// Exports product multiprice
$r++;
$this->export_code[$r] = $this->rights_class.'_'.$r;
@@ -895,7 +895,7 @@ class modProduct extends DolibarrModules
$this->import_updatekeys_array[$r] = array('sp.fk_product' => 'ProductOrService', 'sp.ref_fourn' => 'SupplierRef', 'sp.fk_soc' => 'Supplier', 'sp.quantity' => "QtyMin");
}
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
// Import products multiprices
$r++;
$this->import_code[$r] = $this->rights_class.'_multiprice';

View File

@@ -285,7 +285,7 @@ class modService extends DolibarrModules
}
if (!isModEnabled("product")) { // We enable next import templates only if module product not already enabled (to avoid duplicate entries)
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
// Exports product multiprice
$r++;
$this->export_code[$r] = $this->rights_class.'_'.$r;
@@ -319,7 +319,7 @@ class modService extends DolibarrModules
$this->export_sql_end[$r] .= ' WHERE p.entity IN ('.getEntity('product').')'; // For product and service profile
}
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
// Exports product multiprice
$r++;
$this->export_code[$r] = $this->rights_class.'_'.$r;
@@ -801,7 +801,7 @@ class modService extends DolibarrModules
$this->import_updatekeys_array[$r] = array('sp.fk_product' => 'ProductOrService', 'sp.ref_fourn' => 'SupplierRef', 'sp.fk_soc' => 'Supplier');
}
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
// Import products multiprices
$r++;
$this->import_code[$r] = $this->rights_class.'_multiprice';

View File

@@ -287,7 +287,7 @@ class modSociete extends DolibarrModules
if (getDolGlobalString('SOCIETE_USEPREFIX')) {
$this->export_fields_array[$r]['s.prefix'] = 'Prefix';
}
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
$this->export_fields_array[$r]['s.price_level'] = 'PriceLevel';
}
if (getDolGlobalString('ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY')) {
@@ -602,7 +602,7 @@ class modSociete extends DolibarrModules
's.fk_multicurrency' => 'MulticurrencyUsed',
's.multicurrency_code' => 'MulticurrencyCurrency'
);
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
$this->import_fields_array[$r]['s.price_level'] = 'PriceLevel';
}
if (getDolGlobalString('ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY')) {