';
+if (!empty($arrayfields['m.rowid']['checked'])) {
+ // Ref
+ print '| ';
+ print '';
+ print ' | ';
+}
+if (! empty($arrayfields['m.datem']['checked'])) {
+ // Date
+ print '';
+ print ' ';
+ print $form->selectDate($search_date_start?$search_date_start:-1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'), 'tzuserrel');
+ print ' ';
+ print '';
+ print $form->selectDate($search_date_end?$search_date_end:-1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'), 'tzuserrel');
+ print ' ';
+ print ' | ';
+}
+if (!empty($arrayfields['p.ref']['checked'])) {
+ // Product Ref
+ print '';
+ print '';
+ print ' | ';
+}
+if (!empty($arrayfields['p.label']['checked'])) {
+ // Product label
+ print '';
+ print '';
+ print ' | ';
+}
+// Batch
+if (!empty($arrayfields['m.batch']['checked'])) {
+ print ' | ';
+}
+if (!empty($arrayfields['pl.eatby']['checked'])) {
+ print '';
+ print ' | ';
+}
+if (!empty($arrayfields['pl.sellby']['checked'])) {
+ print '';
+ print ' | ';
+}
+// Warehouse
+if (!empty($arrayfields['e.ref']['checked'])) {
+ print '';
+ //print '';
+ print $formproduct->selectWarehouses($search_warehouse, 'search_warehouse', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'maxwidth200');
+ print ' | ';
+}
+if (!empty($arrayfields['m.fk_user_author']['checked'])) {
+ // Author
+ print '';
+ print '';
+ print ' | ';
+}
+if (!empty($arrayfields['m.inventorycode']['checked'])) {
+ // Inventory code
+ print '';
+ print '';
+ print ' | ';
+}
+if (!empty($arrayfields['m.label']['checked'])) {
+ // Label of movement
+ print '';
+ print '';
+ print ' | ';
+}
+if (!empty($arrayfields['origin']['checked'])) {
+ // Origin of movement
+ print '';
+ print ' ';
+ print ' | ';
+}
+if (!empty($arrayfields['m.fk_projet']['checked'])) {
+ // fk_project
+ print '';
+ print ' ';
+ print ' | ';
+}
+if (!empty($arrayfields['m.type_mouvement']['checked'])) {
+ // Type of movement
+ print '';
+ //print '';
+ print '';
+ print ajax_combobox('search_type_mouvement');
+ // TODO: add new function $formentrepot->selectTypeOfMovement(...) like
+ // print $formproduct->selectWarehouses($search_warehouse, 'search_warehouse', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'maxwidth200');
+ print ' | ';
+}
+if (!empty($arrayfields['m.value']['checked'])) {
+ // Qty
+ print '';
+ print '';
+ print ' | ';
+}
+if (!empty($arrayfields['m.price']['checked'])) {
+ // Price
+ print '';
+ print ' ';
+ print ' | ';
+}
+
+// Extra fields
+include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
+
+// Fields from hook
+$parameters = array('arrayfields'=>$arrayfields);
+$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
+print $hookmanager->resPrint;
+// Date creation
+if (!empty($arrayfields['m.datec']['checked'])) {
+ print '';
+ print ' | ';
+}
+// Date modification
+if (!empty($arrayfields['m.tms']['checked'])) {
+ print '';
+ print ' | ';
+}
+// Actions
+print '';
+$searchpicto = $form->showFilterAndCheckAddButtons(0);
+print $searchpicto;
+print ' | ';
+print "
\n";
+
+print '';
+ // Id movement
if (!empty($arrayfields['m.rowid']['checked'])) {
- // Ref
- print '| ';
- print '';
- print ' | ';
+ print '';
+ print img_picto($langs->trans("StockMovement"), 'movement', 'class="pictofixedwidth"');
+ print $objp->mid;
+ print ' | '; // This is primary not movement id
}
- if (! empty($arrayfields['m.datem']['checked'])) {
+ if (!empty($arrayfields['m.datem']['checked'])) {
// Date
- print '';
- print ' ';
- print $form->selectDate($search_date_start?$search_date_start:-1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'), 'tzuserrel');
- print ' ';
- print '';
- print $form->selectDate($search_date_end?$search_date_end:-1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'), 'tzuserrel');
- print ' ';
- print ' | ';
+ print ''.dol_print_date($db->jdate($objp->datem), 'dayhour', 'tzuserrel').' | ';
}
if (!empty($arrayfields['p.ref']['checked'])) {
- // Product Ref
- print '';
- print '';
- print ' | ';
+ // Product ref
+ print '';
+ print $productstatic->getNomUrl(1, 'stock', 16);
+ print " | \n";
}
if (!empty($arrayfields['p.label']['checked'])) {
// Product label
- print '';
- print '';
- print ' | ';
+ print '';
+ print $productstatic->label;
+ print " | \n";
}
- // Batch
if (!empty($arrayfields['m.batch']['checked'])) {
- print ' | ';
+ print '';
+ if ($productlot->id > 0) {
+ print $productlot->getNomUrl(1);
+ } else {
+ print $productlot->batch; // the id may not be defined if movement was entered when lot was not saved or if lot was removed after movement.
+ }
+ print ' | ';
}
if (!empty($arrayfields['pl.eatby']['checked'])) {
- print '';
- print ' | ';
+ print ''.dol_print_date($objp->eatby, 'day').' | ';
}
if (!empty($arrayfields['pl.sellby']['checked'])) {
- print '';
- print ' | ';
+ print ''.dol_print_date($objp->sellby, 'day').' | ';
}
// Warehouse
if (!empty($arrayfields['e.ref']['checked'])) {
- print '';
- //print '';
- print $formproduct->selectWarehouses($search_warehouse, 'search_warehouse', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'maxwidth200');
- print ' | ';
+ print '';
+ print $warehousestatic->getNomUrl(1);
+ print " | \n";
}
+ // Author
if (!empty($arrayfields['m.fk_user_author']['checked'])) {
- // Author
- print '';
- print '';
- print ' | ';
+ print '';
+ print $userstatic->getNomUrl(-1);
+ print " | \n";
}
if (!empty($arrayfields['m.inventorycode']['checked'])) {
// Inventory code
- print '';
- print '';
- print ' | ';
+ print 'inventorycode.'$').'&search_type_mouvement='.urlencode($objp->type_mouvement).'">'.$objp->inventorycode.' | ';
}
if (!empty($arrayfields['m.label']['checked'])) {
// Label of movement
- print '';
- print '';
- print ' | ';
+ print ''.$objp->label.' | ';
}
if (!empty($arrayfields['origin']['checked'])) {
// Origin of movement
- print '';
- print ' ';
- print ' | ';
+ print ''.$origin.' | ';
}
if (!empty($arrayfields['m.fk_projet']['checked'])) {
// fk_project
- print '';
- print ' ';
+ print ' | ';
+ if ($objp->fk_project != 0) {
+ print $movement->get_origin($objp->fk_project, 'project');
+ }
print ' | ';
}
if (!empty($arrayfields['m.type_mouvement']['checked'])) {
// Type of movement
- print '';
- //print '';
- print '';
- print ajax_combobox('search_type_mouvement');
- // TODO: add new function $formentrepot->selectTypeOfMovement(...) like
- // print $formproduct->selectWarehouses($search_warehouse, 'search_warehouse', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'maxwidth200');
+ print ' | ';
+ print $movement->getTypeMovement();
print ' | ';
}
if (!empty($arrayfields['m.value']['checked'])) {
// Qty
- print '';
- print '';
+ print ' | ';
+ if ($objp->qty > 0) {
+ print '';
+ print '+';
+ print $objp->qty;
+ print '';
+ } else {
+ print '';
+ print $objp->qty;
+ print '';
+ }
print ' | ';
}
if (!empty($arrayfields['m.price']['checked'])) {
// Price
- print '';
- print ' ';
+ print ' | ';
+ if ($objp->price != 0) {
+ print price($objp->price);
+ }
print ' | ';
}
// Extra fields
- include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
-
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters = array('arrayfields'=>$arrayfields);
- $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
+ $parameters = array('arrayfields'=>$arrayfields, 'objp'=>$objp, 'i'=>$i, 'totalarray'=>&$totalarray);
+ $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
- // Date creation
- if (!empty($arrayfields['m.datec']['checked'])) {
- print '';
- print ' | ';
+
+ // Action column
+ print '';
+ if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
+ $selected = 0;
+ if (in_array($objp->mid, $arrayofselected)) {
+ $selected = 1;
+ }
+ print '';
}
- // Date modification
- if (!empty($arrayfields['m.tms']['checked'])) {
- print ' | ';
- print ' | ';
- }
- // Actions
- print '';
- $searchpicto = $form->showFilterAndCheckAddButtons(0);
- print $searchpicto;
print ' | ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+
print "
\n";
-
- print '';
- // Id movement
- if (!empty($arrayfields['m.rowid']['checked'])) {
- print '| ';
- print img_picto($langs->trans("StockMovement"), 'movement', 'class="pictofixedwidth"');
- print $objp->mid;
- print ' | '; // This is primary not movement id
- }
- if (!empty($arrayfields['m.datem']['checked'])) {
- // Date
- print ''.dol_print_date($db->jdate($objp->datem), 'dayhour', 'tzuserrel').' | ';
- }
- if (!empty($arrayfields['p.ref']['checked'])) {
- // Product ref
- print '';
- print $productstatic->getNomUrl(1, 'stock', 16);
- print " | \n";
- }
- if (!empty($arrayfields['p.label']['checked'])) {
- // Product label
- print '';
- print $productstatic->label;
- print " | \n";
- }
- if (!empty($arrayfields['m.batch']['checked'])) {
- print '';
- if ($productlot->id > 0) {
- print $productlot->getNomUrl(1);
- } else {
- print $productlot->batch; // the id may not be defined if movement was entered when lot was not saved or if lot was removed after movement.
- }
- print ' | ';
- }
- if (!empty($arrayfields['pl.eatby']['checked'])) {
- print ''.dol_print_date($objp->eatby, 'day').' | ';
- }
- if (!empty($arrayfields['pl.sellby']['checked'])) {
- print ''.dol_print_date($objp->sellby, 'day').' | ';
- }
- // Warehouse
- if (!empty($arrayfields['e.ref']['checked'])) {
- print '';
- print $warehousestatic->getNomUrl(1);
- print " | \n";
- }
- // Author
- if (!empty($arrayfields['m.fk_user_author']['checked'])) {
- print '';
- print $userstatic->getNomUrl(-1);
- print " | \n";
- }
- if (!empty($arrayfields['m.inventorycode']['checked'])) {
- // Inventory code
- print 'inventorycode.'$').'&search_type_mouvement='.urlencode($objp->type_mouvement).'">'.$objp->inventorycode.' | ';
- }
- if (!empty($arrayfields['m.label']['checked'])) {
- // Label of movement
- print ''.$objp->label.' | ';
- }
- if (!empty($arrayfields['origin']['checked'])) {
- // Origin of movement
- print ''.$origin.' | ';
- }
- if (!empty($arrayfields['m.fk_projet']['checked'])) {
- // fk_project
- print '';
- if ($objp->fk_project != 0) {
- print $movement->get_origin($objp->fk_project, 'project');
- }
- print ' | ';
- }
- if (!empty($arrayfields['m.type_mouvement']['checked'])) {
- // Type of movement
- print '';
- print $movement->getTypeMovement();
- print ' | ';
- }
- if (!empty($arrayfields['m.value']['checked'])) {
- // Qty
- print '';
- if ($objp->qty > 0) {
- print '';
- print '+';
- print $objp->qty;
- print '';
- } else {
- print '';
- print $objp->qty;
- print '';
- }
- print ' | ';
- }
- if (!empty($arrayfields['m.price']['checked'])) {
- // Price
- print '';
- if ($objp->price != 0) {
- print price($objp->price);
- }
- print ' | ';
- }
-
- // Extra fields
- include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
- // Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'objp'=>$objp, 'i'=>$i, 'totalarray'=>&$totalarray);
- $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
-
- // Action column
- print '';
- if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
- $selected = 0;
- if (in_array($objp->mid, $arrayofselected)) {
- $selected = 1;
- }
- print '';
- }
- print ' | ';
- if (!$i) {
- $totalarray['nbfield']++;
- }
-
- print "
\n";
- $i++;
- }
- $db->free($resql);
-
- print "