forked from Wavyzz/dolibarr
ADD: Allow import and export of customer prices and price level together
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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')) {
|
||||
|
||||
Reference in New Issue
Block a user