|
@@ -148,31 +148,31 @@ class modStock extends DolibarrModules
|
|
|
$this->rights[4][4] = 'mouvement';
|
|
|
$this->rights[4][5] = 'creer';
|
|
|
|
|
|
- if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
|
|
-
|
|
|
- $this->rights[5][0] = 1011;
|
|
|
- $this->rights[5][1] = 'inventoryReadPermission'; // Permission label
|
|
|
- $this->rights[5][3] = 0; // Permission by default for new user (0/1)
|
|
|
- $this->rights[5][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
|
|
- $this->rights[5][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
|
|
-
|
|
|
- $this->rights[6][0] = 1012;
|
|
|
- $this->rights[6][1] = 'inventoryCreatePermission'; // Permission label
|
|
|
- $this->rights[6][3] = 0; // Permission by default for new user (0/1)
|
|
|
- $this->rights[6][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
|
|
- $this->rights[6][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
|
|
-
|
|
|
- $this->rights[8][0] = 1014;
|
|
|
- $this->rights[8][1] = 'inventoryValidatePermission'; // Permission label
|
|
|
- $this->rights[8][3] = 0; // Permission by default for new user (0/1)
|
|
|
- $this->rights[8][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
|
|
- $this->rights[8][5] = 'validate'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
|
|
-
|
|
|
- $this->rights[9][0] = 1015;
|
|
|
- $this->rights[9][1] = 'inventoryChangePMPPermission'; // Permission label
|
|
|
- $this->rights[9][3] = 0; // Permission by default for new user (0/1)
|
|
|
- $this->rights[9][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
|
|
- $this->rights[9][5] = 'changePMP'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
|
|
+ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
|
|
+ {
|
|
|
+ $this->rights[5][0] = 1011;
|
|
|
+ $this->rights[5][1] = 'inventoryReadPermission'; // Permission label
|
|
|
+ $this->rights[5][3] = 0; // Permission by default for new user (0/1)
|
|
|
+ $this->rights[5][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
|
|
+ $this->rights[5][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
|
|
+
|
|
|
+ $this->rights[6][0] = 1012;
|
|
|
+ $this->rights[6][1] = 'inventoryCreatePermission'; // Permission label
|
|
|
+ $this->rights[6][3] = 0; // Permission by default for new user (0/1)
|
|
|
+ $this->rights[6][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
|
|
+ $this->rights[6][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
|
|
+
|
|
|
+ $this->rights[8][0] = 1014;
|
|
|
+ $this->rights[8][1] = 'inventoryValidatePermission'; // Permission label
|
|
|
+ $this->rights[8][3] = 0; // Permission by default for new user (0/1)
|
|
|
+ $this->rights[8][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
|
|
+ $this->rights[8][5] = 'validate'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
|
|
+
|
|
|
+ $this->rights[9][0] = 1015;
|
|
|
+ $this->rights[9][1] = 'inventoryChangePMPPermission'; // Permission label
|
|
|
+ $this->rights[9][3] = 0; // Permission by default for new user (0/1)
|
|
|
+ $this->rights[9][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
|
|
+ $this->rights[9][5] = 'changePMP'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
|
|
}
|
|
|
|
|
|
// Main menu entries
|
|
@@ -199,7 +199,7 @@ class modStock extends DolibarrModules
|
|
|
'p.tms'=>'DateModification','p.pmp'=>'PMPValue','p.cost_price'=>'CostPrice'
|
|
|
);
|
|
|
$this->export_TypeFields_array[$r]=array(
|
|
|
- 'e.rowid'=>'List:entrepot:ref','e.ref'=>'Text','e.lieu'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text','p.rowid'=>"List:product:label",
|
|
|
+ 'e.rowid'=>'List:entrepot:ref::stock','e.ref'=>'Text','e.lieu'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text','p.rowid'=>"List:product:label::product",
|
|
|
'p.ref'=>"Text",'p.fk_product_type'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.note'=>"Text",'p.price'=>"Numeric",'p.tva_tx'=>'Numeric',
|
|
|
'p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date','p.pmp'=>'Numeric','p.cost_price'=>'Numeric',
|
|
|
'ps.reel'=>'Numeric'
|
|
@@ -211,7 +211,7 @@ class modStock extends DolibarrModules
|
|
|
'p.datec'=>'product','p.tms'=>'product','p.pmp'=>'product','p.cost_price'=>'product','ps.reel'=>'stock'
|
|
|
);
|
|
|
$this->export_aggregate_array[$r]=array('ps.reel'=>'SUM'); // TODO Not used yet
|
|
|
- $this->export_dependencies_array[$r]=array('stock'=>array('p.rowid','e.rowid')); // We must keep this until the aggregate_array is used. To add unique key if we ask a field of a child to avoid the DISTINCT to discard them.
|
|
|
+ $this->export_dependencies_array[$r]=array('stock'=>array('p.rowid','e.rowid')); // We must keep this until the aggregate_array is used. To have a unique key, if we ask a field of a child, to avoid the DISTINCT to discard them.
|
|
|
$keyforselect='product'; $keyforelement='product'; $keyforaliasextra='extra';
|
|
|
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
|
|
$this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('ps.reel'=>'Stock'));
|
|
@@ -238,8 +238,8 @@ class modStock extends DolibarrModules
|
|
|
'p.tms'=>'DateModification','pb.rowid'=>'Id','pb.batch'=>'Batch','pb.qty'=>'Qty','pl.eatby'=>'EatByDate','pl.sellby'=>'SellByDate'
|
|
|
);
|
|
|
$this->export_TypeFields_array[$r]=array(
|
|
|
- 'e.rowid'=>'List:entrepot:ref','e.ref'=>'Text','e.lieu'=>'Text','e.description'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text',
|
|
|
- 'p.rowid'=>"List:product:label",'p.ref'=>"Text",'p.fk_product_type'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.note'=>"Text",
|
|
|
+ 'e.rowid'=>'List:entrepot:ref::stock','e.ref'=>'Text','e.lieu'=>'Text','e.description'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text',
|
|
|
+ 'p.rowid'=>"List:product:label::product",'p.ref'=>"Text",'p.fk_product_type'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.note'=>"Text",
|
|
|
'p.price'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date',
|
|
|
'pb.batch'=>'Text','pb.qty'=>'Numeric','pl.eatby'=>'Date','pl.sellby'=>'Date'
|
|
|
);
|
|
@@ -276,8 +276,8 @@ class modStock extends DolibarrModules
|
|
|
'sm.inventorycode'=>'InventoryCode'
|
|
|
);
|
|
|
$this->export_TypeFields_array[$r]=array(
|
|
|
- 'e.rowid'=>'List:entrepot:ref','e.ref'=>'Text','e.description'=>'Text','e.lieu'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text',
|
|
|
- 'p.rowid'=>"List:product:label",'p.ref'=>"Text",'p.fk_product_type'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.note'=>"Text",
|
|
|
+ 'e.rowid'=>'List:entrepot:ref::stock','e.ref'=>'Text','e.description'=>'Text','e.lieu'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text',
|
|
|
+ 'p.rowid'=>"List:product:label::product",'p.ref'=>"Text",'p.fk_product_type'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.note'=>"Text",
|
|
|
'p.price'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date',
|
|
|
'sm.rowid'=>'Numeric','sm.value'=>'Numeric','sm.datem'=>'Date','sm.batch'=>'Text','sm.label'=>'Text','sm.inventorycode'=>'Text'
|
|
|
);
|