Merge pull request #1104 from FHenry/develop_T165
[ task #165 ] Add export of multiprices
This commit is contained in:
commit
4c4d11585e
@ -32,6 +32,8 @@ For users:
|
||||
- Qual: Implement same rule for return value of all command line scripts (0 when success, <>0 if error).
|
||||
- New : [ task #925 ] Add ODT document generation for Tasks in project module
|
||||
- New : [ task #924 ] Add numbering rule on task
|
||||
- New : [ task #165 ] Add import/export of multiprices
|
||||
|
||||
|
||||
|
||||
For translators:
|
||||
|
||||
@ -243,6 +243,57 @@ class modProduct extends DolibarrModules
|
||||
'sp.remise_percent'=>'0'
|
||||
);
|
||||
}
|
||||
|
||||
if (! empty($conf->global->PRODUIT_MULTIPRICES)) {
|
||||
// Exports product multiprice
|
||||
//--------
|
||||
$r++;
|
||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||
$this->export_label[$r]="ProductsMultiPrice"; // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||
$this->export_permission[$r]=array(array("produit","export"));
|
||||
$this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",
|
||||
'pr.price_base_type'=>"PriceLevelPriceBase",'pr.price_level'=>"PriceLevel",
|
||||
'pr.price'=>"PriceLevelUnitPriceHT",'pr.price_ttc'=>"PriceLevelUnitPriceTTC",
|
||||
'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC",
|
||||
'pr.tva_tx'=>'PriceLevelVATRate',
|
||||
'pr.date_price'=>'DateCreation');
|
||||
$this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",
|
||||
'pr.price_base_type'=>"product",'pr.price_level'=>"product",'pr.price'=>"product",
|
||||
'pr.price_ttc'=>"product",
|
||||
'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC",
|
||||
'pr.tva_tx'=>'product',
|
||||
'pr.date_price'=>"product");
|
||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_price as pr ON p.rowid = pr.fk_product';
|
||||
$this->export_sql_end[$r] .=' WHERE p.fk_product_type = 0 AND p.entity IN ('.getEntity("product", 1).')';
|
||||
|
||||
|
||||
// Import product multiprice
|
||||
//--------
|
||||
$r=0;
|
||||
|
||||
$r++;
|
||||
$this->import_code[$r]=$this->rights_class.'_'.$r;
|
||||
$this->import_label[$r]="ProductsMultiPrice"; // Translation key
|
||||
$this->import_icon[$r]=$this->picto;
|
||||
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
|
||||
$this->import_tables_array[$r]=array('pr'=>MAIN_DB_PREFIX.'product_price');
|
||||
$this->import_tables_creator_array[$r]=array('pr'=>'fk_user_author'); // Fields to store import user id
|
||||
$this->import_fields_array[$r]=array('pr.fk_product'=>"ProductRowid*",
|
||||
'pr.price_base_type'=>"PriceLevelPriceBase",'pr.price_level'=>"PriceLevel",
|
||||
'pr.price'=>"PriceLevelUnitPriceHT",'pr.price_ttc'=>"PriceLevelUnitPriceTTC",
|
||||
'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC",
|
||||
'pr.tva_tx'=>'PriceLevelVATRate',
|
||||
'pr.date_price'=>'DateCreation*');
|
||||
$this->import_regex_array[$r]=array('pr.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
|
||||
$this->import_examplevalues_array[$r]=array('pr.fk_product'=>"1",
|
||||
'pr.price_base_type'=>"HT",'pr.price_level'=>"1",
|
||||
'pr.price'=>"100",'pr.price_ttc'=>"110",
|
||||
'pr.price_min'=>"100",'pr.price_min_ttc'=>"110",
|
||||
'pr.tva_tx'=>'19.6',
|
||||
'pr.date_price'=>'2013-04-10');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -198,3 +198,4 @@ UnitPmp=Net unit VWAP
|
||||
CostPmpHT=Net total VWAP
|
||||
ProductUsedForBuild=Auto consumed by production
|
||||
ProductBuilded=Production completed
|
||||
ProductsMultiPrice=Product multi-price
|
||||
|
||||
@ -194,3 +194,4 @@ BuildindListInfo=Nombre de produit fabricable par entrepot, si saisie à zéro o
|
||||
QtyNeed=Affectée
|
||||
UnitPmp=Prix Achat Unitaire
|
||||
CostPmpHT=Cout à l'achat HT
|
||||
ProductsMultiPrice=Produits multi-prix
|
||||
|
||||
Loading…
Reference in New Issue
Block a user