NEW : Stock limit for alert and desired optimal stock by product and warehouse import

This commit is contained in:
Gauthier PC portable 024 2023-04-03 11:50:06 +02:00
parent 6a878d9c13
commit 9a05c16edc
2 changed files with 27 additions and 1 deletions

View File

@ -620,6 +620,31 @@ class modProduct extends DolibarrModules
$this->import_updatekeys_array[$r] = array('p.ref'=>'Ref');
if (!empty($conf->barcode->enabled)) $this->import_updatekeys_array[$r] = array_merge($this->import_updatekeys_array[$r], array('p.barcode'=>'BarCode')); //only show/allow barcode as update key if Barcode module enabled
if(!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE)) {
// Import products limit and desired stock by product and warehouse
$r++;
$this->import_code[$r] = $this->rights_class.'_stock_by_warehouse';
$this->import_label[$r] = "ProductStockWarehouse"; // 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('pwp'=>MAIN_DB_PREFIX.'product_warehouse_properties');
$this->import_fields_array[$r] = array('pwp.fk_product'=>"Product*",
'pwp.fk_entrepot'=>"Warehouse*", 'pwp.seuil_stock_alerte'=>"StockLimit",
'pwp.desiredstock'=>"DesiredStock");
$this->import_convertvalue_array[$r] = array(
'pwp.fk_product'=>array('rule'=>'fetchidfromref', 'classfile'=>'/product/class/product.class.php', 'class'=>'Product', 'method'=>'fetch', 'element'=>'Product')
,'pwp.fk_entrepot'=>array('rule'=>'fetchidfromref', 'classfile'=>'/product/stock/class/entrepot.class.php', 'class'=>'Entrepot', 'method'=>'fetch', 'element'=>'Entrepot')
);
$this->import_examplevalues_array[$r] = array('pwp.fk_product'=>"ref:PRODUCT_REF or id:123456",
'pwp.fk_entrepot'=>"ref:WAREHOUSE_REF or id:123456",
'pwp.seuil_stock_alerte'=>"100",
'pwp.desiredstock'=>"110"
);
$this->import_updatekeys_array[$r] = array('pwp.fk_product'=>'Product', 'pwp.fk_entrepot'=>'Warehouse');
}
if (!empty($conf->fournisseur->enabled))
{
// Import suppliers prices (note: this code is duplicated in module Service)

View File

@ -173,6 +173,7 @@ OptionMULTIPRICESIsOn=Option "several prices per segment" is on. It means a prod
ProductStockWarehouseCreated=Stock limit for alert and desired optimal stock correctly created
ProductStockWarehouseUpdated=Stock limit for alert and desired optimal stock correctly updated
ProductStockWarehouseDeleted=Stock limit for alert and desired optimal stock correctly deleted
ProductStockWarehouse=Stock limit for alert and desired optimal stock by product and warehouse
AddNewProductStockWarehouse=Set new limit for alert and desired optimal stock
AddStockLocationLine=Decrease quantity then click to add another warehouse for this product
InventoryDate=Inventory date
@ -240,4 +241,4 @@ InventoryRealQtyHelp=Set value to 0 to reset qty<br>Keep field empty, or remove
UpdateByScaning=Update by scaning
UpdateByScaningProductBarcode=Update by scan (product barcode)
UpdateByScaningLot=Update by scan (lot|serial barcode)
DisableStockChangeOfSubProduct=Deactivate the stock change for all the subproducts of this Kit during this movement.
DisableStockChangeOfSubProduct=Deactivate the stock change for all the subproducts of this Kit during this movement.