forked from Wavyzz/dolibarr
Debug v20
This commit is contained in:
@@ -395,6 +395,56 @@ class modStock extends DolibarrModules
|
||||
$this->export_sql_end[$r] .= ' WHERE p.rowid = sm.fk_product AND sm.fk_entrepot = e.rowid';
|
||||
$this->export_sql_end[$r] .= ' AND e.entity IN ('.getEntity('stock').')';
|
||||
|
||||
// Export inventory
|
||||
/*
|
||||
$r++;
|
||||
$this->export_code[$r] = $this->rights_class.'_movement';
|
||||
$this->export_label[$r] = "Inventories"; // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||
$this->export_icon[$r] = "movement";
|
||||
$this->export_permission[$r] = array(array("stock", "lire"));
|
||||
$this->export_fields_array[$r] = array(
|
||||
'i.rowid' => 'InventoryId', 'i.ref' => 'Inventoryref', 'i.date_inventory' => 'DateInventory',
|
||||
'id.rowid' => 'InventoryLineId', 'id.qty_view' => 'QtyViewed', 'id.qty_stock' => 'QtyStock', 'id.qty_regulated' => 'QtyRegulated',
|
||||
'id.batch' => 'Lotserial',
|
||||
'e.rowid' => 'IdWarehouse', 'e.ref' => 'LocationSummary', 'e.description' => 'DescWareHouse', 'e.lieu' => 'LieuWareHouse', 'e.address' => 'Address', 'e.zip' => 'Zip', 'e.town' => 'Town',
|
||||
'p.rowid' => "ProductId", 'p.ref' => "Ref", 'p.fk_product_type' => "Type", 'p.label' => "Label", 'p.description' => "Description", 'p.note' => "Note",
|
||||
'p.price' => "Price", 'p.tva_tx' => 'VAT', 'p.tosell' => "OnSell", 'p.tobuy' => 'OnBuy', 'p.duration' => "Duration", 'p.datec' => 'DateCreation', 'p.tms' => 'DateModification'
|
||||
);
|
||||
if (isModEnabled('barcode')) {
|
||||
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.barcode' => 'BarCode'));
|
||||
}
|
||||
$this->export_TypeFields_array[$r] = array(
|
||||
'id.rowid' => 'Numeric', 'sm.value' => 'Numeric', 'sm.datem' => 'Date', 'sm.batch' => 'Text', 'sm.label' => 'Text', 'sm.inventorycode' => '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' => "Numeric", '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'
|
||||
);
|
||||
if (isModEnabled('barcode')) {
|
||||
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.barcode' => 'Text'));
|
||||
}
|
||||
$this->export_entities_array[$r] = array(
|
||||
'e.rowid' => 'warehouse', 'e.ref' => 'warehouse', 'e.description' => 'warehouse', 'e.lieu' => 'warehouse', 'e.address' => 'warehouse', 'e.zip' => 'warehouse', 'e.town' => 'warehouse',
|
||||
'p.rowid' => "product", 'p.ref' => "product", 'p.fk_product_type' => "product", 'p.label' => "product", 'p.description' => "product", 'p.note' => "product",
|
||||
'p.price' => "product", 'p.tva_tx' => 'product', 'p.tosell' => "product", 'p.tobuy' => "product", 'p.duration' => "product", 'p.datec' => 'product', 'p.tms' => 'product'
|
||||
); // We define here only fields that use another icon that the one defined into export_icon
|
||||
if (isModEnabled('productbatch')) {
|
||||
$this->export_fields_array[$r]['sm.batch'] = 'Batch';
|
||||
$this->export_TypeFields_array[$r]['sm.batch'] = 'Text';
|
||||
$this->export_entities_array[$r]['sm.batch'] = 'movement';
|
||||
}
|
||||
if (isModEnabled('barcode')) {
|
||||
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode' => 'product'));
|
||||
}
|
||||
$this->export_aggregate_array[$r] = array('sm.value' => 'SUM'); // TODO Not used yet
|
||||
$this->export_dependencies_array[$r] = array('movement' => array('sm.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_sql_start[$r] = 'SELECT DISTINCT ';
|
||||
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'product as p, '.MAIN_DB_PREFIX.'inventory as i, '.MAIN_DB_PREFIX.'inventorydet as id, '.MAIN_DB_PREFIX.'entrepot as e';
|
||||
$this->export_sql_end[$r] .= ' WHERE p.rowid = id.fk_product AND id.fk_inventory = i.rowid AND id.fk_entrepot = e.rowid';
|
||||
$this->export_sql_end[$r] .= ' AND e.entity IN ('.getEntity('stock').')';
|
||||
*/
|
||||
|
||||
|
||||
// Imports
|
||||
//--------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user