Look and feel v14

This commit is contained in:
Laurent Destailleur 2021-03-24 01:53:08 +01:00
parent 4d1fdd8763
commit 367ff3c9f0
8 changed files with 88 additions and 39 deletions

View File

@ -487,8 +487,8 @@ print load_fiche_titre($title);
$infoarray = dol_getImageSize($dir."/".GETPOST("file", 'alpha'));
$height = $infoarray['height'];
$width = $infoarray['width'];
print $langs->trans("CurrentInformationOnImage").': ';
print $langs->trans("Width").': <strong>'.$width.'</strong> x '.$langs->trans("Height").': <strong>'.$height.'</strong><br>';
print '<span class="opacitymedium">'.$langs->trans("CurrentInformationOnImage").': ';
print $langs->trans("Width").': <strong>'.$width.'</strong> x '.$langs->trans("Height").': <strong>'.$height.'</strong></span><br>';
print '<br>'."\n";

View File

@ -106,7 +106,7 @@ LieuWareHouse=Localisation warehouse
WarehousesAndProducts=Warehouses and products
WarehousesAndProductsBatchDetail=Warehouses and products (with detail per lot/serial)
AverageUnitPricePMPShort=Weighted average price
AverageUnitPricePMPDesc=The input average unit price we had to pay to suppliers to get the product into our stock.
AverageUnitPricePMPDesc=The input average unit price we had to expense to get 1 unit of product into our stock.
SellPriceMin=Selling Unit Price
EstimatedStockValueSellShort=Value for sell
EstimatedStockValueSell=Value for sell

View File

@ -307,7 +307,7 @@ if ($resql) {
$moreforfilter = '';
if (!empty($conf->categorie->enabled)) {
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('Categories').': ';
$moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"');
$moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ');
$moreforfilter .= '</div>';
}
@ -493,7 +493,10 @@ if ($resql) {
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
print '<td class="left">'.$objp->unit_short.'</td>';
}
print '<td class="right"><a href="'.DOL_URL_ROOT.'/product/stock/movement_list.php?idproduct='.$product->id.'">'.$langs->trans("Movements").'</a></td>';
print '<td class="center">';
print img_picto($langs->trans("StockMovement"), 'movement', 'class="pictofixedwidth"');
print '<a href="'.DOL_URL_ROOT.'/product/stock/movement_list.php?idproduct='.$product->id.'">'.$langs->trans("Movements").'</a>';
print '</td>';
print '<td class="right nowrap">'.$product->LibStatut($objp->statut, 5, 0).'</td>';
print '<td class="right nowrap">'.$product->LibStatut($objp->tobuy, 5, 1).'</td>';
// Fields from hook

View File

@ -309,7 +309,7 @@ if ($resql) {
$moreforfilter = '';
if (!empty($conf->categorie->enabled)) {
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('Categories').': ';
$moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"');
$moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ');
$moreforfilter .= '</div>';
}

View File

@ -449,8 +449,10 @@ if ($action == 'create') {
}
print '<tr><td>'.$langs->trans("LastMovement").'</td><td>';
if ($lastmovementdate) {
print dol_print_date($lastmovementdate, 'dayhour').' ';
print '(<a href="'.DOL_URL_ROOT.'/product/stock/movement_list.php?id='.$object->id.'">'.$langs->trans("FullList").'</a>)';
print dol_print_date($lastmovementdate, 'dayhour');
print ' &nbsp; &nbsp; ';
print img_picto($langs->trans('LastMovement'), 'movement', 'class="pictofixedwidth"');
print '<a href="'.DOL_URL_ROOT.'/product/stock/movement_list.php?id='.$object->id.'">'.$langs->trans("FullList").'</a>';
} else {
print $langs->trans("None");
}
@ -515,11 +517,11 @@ if ($action == 'create') {
print "<tr class=\"liste_titre\">";
print_liste_field_titre("Product", "", "p.ref", "&amp;id=".$id, "", "", $sortfield, $sortorder);
print_liste_field_titre("Label", "", "p.label", "&amp;id=".$id, "", "", $sortfield, $sortorder);
print_liste_field_titre("Units", "", "ps.reel", "&amp;id=".$id, "", '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("NumberOfUnit", "", "ps.reel", "&amp;id=".$id, "", '', $sortfield, $sortorder, 'right ');
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
print_liste_field_titre("Unit", "", "p.fk_unit", "&amp;id=".$id, "", 'align="left"', $sortfield, $sortorder);
}
print_liste_field_titre("AverageUnitPricePMPShort", "", "p.pmp", "&amp;id=".$id, "", '', $sortfield, $sortorder, 'right ');
print_liste_field_titre($form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc")), "", "p.pmp", "&amp;id=".$id, "", '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("EstimatedStockValueShort", "", "", "&amp;id=".$id, "", '', $sortfield, $sortorder, 'right ');
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
print_liste_field_titre("SellPriceMin", "", "p.price", "&amp;id=".$id, "", '', $sortfield, $sortorder, 'right ');
@ -628,13 +630,15 @@ if ($action == 'create') {
if ($user->rights->stock->mouvement->creer) {
print '<td class="center"><a href="'.DOL_URL_ROOT.'/product/stock/product.php?dwid='.$object->id.'&id='.$objp->rowid.'&action=transfert&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$id).'">';
print img_picto($langs->trans("StockMovement"), 'uparrow.png', 'class="hideonsmartphone"').' '.$langs->trans("StockMovement");
print img_picto($langs->trans("TransferStock"), 'add', 'class="hideonsmartphone pictofixedwidth" style="color: #a69944"');
print $langs->trans("TransferStock");
print "</a></td>";
}
if ($user->rights->stock->creer) {
print '<td class="center"><a href="'.DOL_URL_ROOT.'/product/stock/product.php?dwid='.$object->id.'&id='.$objp->rowid.'&action=correction&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$id).'">';
print $langs->trans("StockCorrection");
print img_picto($langs->trans("CorrectStock"), 'add', 'class="hideonsmartphone pictofixedwidth" style="color: #a69944"');
print $langs->trans("CorrectStock");
print "</a></td>";
}
if (!empty($conf->global->PRODUCT_USE_UNITS)) {

View File

@ -836,9 +836,9 @@ if ($resql) {
}
if ($id > 0) {
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'stock', 0, '', '', $limit, 0, 0, 1);
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'movement', 0, '', '', $limit, 0, 0, 1);
} else {
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'stock', 0, '', '', $limit, 0, 0, 1);
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'movement', 0, '', '', $limit, 0, 0, 1);
}
// Add code for pre mass action (confirmation or email presend form)
@ -1125,7 +1125,10 @@ if ($resql) {
print '<tr class="oddeven">';
// Id movement
if (!empty($arrayfields['m.rowid']['checked'])) {
print '<td>'.$objp->mid.'</td>'; // This is primary not movement id
print '<td>';
print img_picto($langs->trans("StockMovement"), 'movement', 'class="pictofixedwidth"');
print $objp->mid;
print '</td>'; // This is primary not movement id
}
if (!empty($arrayfields['m.datem']['checked'])) {
// Date

View File

@ -564,7 +564,9 @@ if ($id > 0 || $ref) {
print '</td></tr>';
// AWP
print '<tr><td class="titlefield">'.$form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc")).'</td>';
print '<tr><td class="titlefield">';
print $form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc"));
print '</td>';
print '<td>';
if ($object->pmp > 0) {
print price($object->pmp).' '.$langs->trans("HT");
@ -765,8 +767,11 @@ if ($id > 0 || $ref) {
print '<tr><td class="tdtop">'.$langs->trans("LastMovement").'</td><td>';
if ($lastmovementdate) {
print dol_print_date($lastmovementdate, 'dayhour').' ';
print ' &nbsp; &nbsp;<a href="'.DOL_URL_ROOT.'/product/stock/movement_list.php?idproduct='.$object->id.'">'.$langs->trans("FullList").'</a>';
print ' &nbsp; &nbsp; ';
print img_picto($langs->trans("StockMovement"), 'movement', 'class="pictofixedwidth"');
print '<a href="'.DOL_URL_ROOT.'/product/stock/movement_list.php?idproduct='.$object->id.'">'.$langs->trans("FullList").'</a>';
} else {
print img_picto($langs->trans("StockMovement"), 'movement', 'class="pictofixedwidth"');
print '<a href="'.DOL_URL_ROOT.'/product/stock/movement_list.php?idproduct='.$object->id.'">'.$langs->trans("None").'</a>';
}
print "</td></tr>";
@ -811,20 +816,19 @@ if (empty($reshook)) {
if ($user->rights->stock->mouvement->creer) {
if (!$variants || !empty($conf->global->VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT)) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=correction">'.$langs->trans("CorrectStock").'</a>';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=transfert">'.$langs->trans("TransferStock").'</a>';
} else {
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("ActionAvailableOnVariantProductOnly").'">'.$langs->trans("CorrectStock").'</a>';
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("ActionAvailableOnVariantProductOnly").'">'.$langs->trans("TransferStock").'</a>';
}
} else {
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("CorrectStock").'</a>';
}
//if (($user->rights->stock->mouvement->creer) && ! $object->hasbatch())
if ($user->rights->stock->mouvement->creer) {
if (!$variants || !empty($conf->global->VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT)) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=transfert">'.$langs->trans("TransferStock").'</a>';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=correction">'.$langs->trans("CorrectStock").'</a>';
} else {
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("ActionAvailableOnVariantProductOnly").'">'.$langs->trans("TransferStock").'</a>';
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("ActionAvailableOnVariantProductOnly").'">'.$langs->trans("CorrectStock").'</a>';
}
} else {
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("CorrectStock").'</a>';
@ -850,28 +854,32 @@ if (!$variants) {
print '<td class="right">'.$langs->trans("EstimatedStockValueShort").'</td>';
print '<td class="right">'.$langs->trans("SellPriceMin").'</td>';
print '<td class="right">'.$langs->trans("EstimatedStockValueSellShort").'</td>';
print '<td></td>';
print '<td></td>';
print '</tr>';
if ((!empty($conf->productbatch->enabled)) && $object->hasbatch()) {
$colspan = 3;
print '<tr class="liste_titre"><td width="10%"></td>';
print '<td class="right" width="10%">'.$langs->trans("batch_number").'</td>';
print '<tr class="liste_titre"><td class="width25"></td>';
print '<td class="right">'.$langs->trans("batch_number").'</td>';
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
$colspan--;
print '<td class="center" width="10%">'.$langs->trans("EatByDate").'</td>';
print '<td class="center width75">'.$langs->trans("EatByDate").'</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
$colspan--;
print '<td class="center" width="10%">'.$langs->trans("SellByDate").'</td>';
print '<td class="center width75">'.$langs->trans("SellByDate").'</td>';
}
print '<td colspan="'.$colspan.'"></td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '</tr>';
}
$sql = "SELECT e.rowid, e.ref, e.lieu, e.fk_parent, e.statut, ps.reel, ps.rowid as product_stock_id, p.pmp";
$sql = "SELECT e.rowid, e.ref, e.lieu, e.fk_parent, e.statut as status, ps.reel, ps.rowid as product_stock_id, p.pmp";
$sql .= " FROM ".MAIN_DB_PREFIX."entrepot as e,";
$sql .= " ".MAIN_DB_PREFIX."product_stock as ps";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = ps.fk_product";
@ -901,7 +909,8 @@ if (!$variants) {
$entrepotstatic->label = $obj->ref;
$entrepotstatic->lieu = $obj->lieu;
$entrepotstatic->fk_parent = $obj->fk_parent;
$entrepotstatic->statut = $obj->statut;
$entrepotstatic->statut = $obj->status;
$entrepotstatic->status = $obj->status;
$stock_real = price2num($obj->reel, 'MS');
print '<tr class="oddeven">';
@ -922,10 +931,13 @@ if (!$variants) {
// Value sell
print '<td class="right">';
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
print price(price2num($object->price * $obj->reel, 'MT'), 1).'</td>';
print price(price2num($object->price * $obj->reel, 'MT'), 1);
} else {
print $langs->trans("Variable");
}
print '</td>';
print '<td></td>';
print '<td></td>';
print '</tr>';
$total += $obj->reel;
if (price2num($object->pmp)) {
@ -967,16 +979,14 @@ if (!$variants) {
print '<input type="submit" class="button button-cancel" id="cancellinebutton" name="Cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
print '</table>';
print '</form>';
print '</td></tr>';
print '</td>';
print '<td></td>';
print '<td></td>';
print '</tr>';
} else {
print "\n".'<tr><td class="right">';
print img_picto($langs->trans("Tranfer"), 'uparrow', 'class="hideonsmartphone"').' ';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;id_entrepot='.$entrepotstatic->id.'&amp;action=transfert&amp;pdluoid='.$pdluo->id.'">'.$langs->trans("TransferStock").'</a>';
// Disabled, because edition of stock content must use the "Correct stock menu".
// Do not use this, or data will be wrong (bad tracking of movement label, inventory code, ...
//print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&amp;action=editline&amp;lineid='.$pdluo->id.'#'.$pdluo->id.'">';
//print img_edit().'</a></td>';
print '<td class="right">';
print "\n".'<tr><td class="left">';
print '</td>';
print '<td class="right nowraponall">';
print $product_lot_static->getNomUrl(1);
print '</td>';
$colspan = 3;
@ -990,6 +1000,30 @@ if (!$variants) {
}
print '<td class="right" colspan="'.$colspan.'">'.$pdluo->qty.($pdluo->qty < 0 ? ' '.img_warning() : '').'</td>';
print '<td colspan="4"></td>';
print '<td>';
if ($entrepotstatic->status != $entrepotstatic::STATUS_CLOSED) {
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;id_entrepot='.$entrepotstatic->id.'&amp;action=transfert&amp;pdluoid='.$pdluo->id.'">';
print img_picto($langs->trans("TransferStock"), 'add', 'class="hideonsmartphone paddingright" style="color: #a69944"');
print $langs->trans("TransferStock");
print '</a>';
// Disabled, because edition of stock content must use the "Correct stock menu".
// Do not use this, or data will be wrong (bad tracking of movement label, inventory code, ...
//print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&amp;action=editline&amp;lineid='.$pdluo->id.'#'.$pdluo->id.'">';
//print img_edit().'</a>';
}
print '</td>';
print '<td>';
if ($entrepotstatic->status != $entrepotstatic::STATUS_CLOSED) {
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;id_entrepot='.$entrepotstatic->id.'&amp;action=correction&amp;pdluoid='.$pdluo->id.'">';
print img_picto($langs->trans("CorrectStock"), 'add', 'class="hideonsmartphone paddingright" style="color: #a69944"');
print $langs->trans("CorrectStock");
print '</a>';
// Disabled, because edition of stock content must use the "Correct stock menu".
// Do not use this, or data will be wrong (bad tracking of movement label, inventory code, ...
//print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&amp;action=editline&amp;lineid='.$pdluo->id.'#'.$pdluo->id.'">';
//print img_edit().'</a>';
}
print '</td>';
print '</tr>';
}
}
@ -1025,6 +1059,8 @@ if (!$variants) {
print $langs->trans("Variable");
}
print '</td>';
print '<td></td>';
print '<td></td>';
print "</tr>";
print "</table>";

View File

@ -72,7 +72,10 @@ print '<tr>';
if ($object->element == 'product') {
print '<td class="fieldrequired">'.$langs->trans("WarehouseSource").'</td>';
print '<td>';
print img_picto('', 'stock').$formproduct->selectWarehouses((GETPOST("dwid") ?GETPOST("dwid", 'int') : (GETPOST('id_entrepot') ?GETPOST('id_entrepot', 'int') : ($object->element == 'product' && $object->fk_default_warehouse ? $object->fk_default_warehouse : 'ifone'))), 'id_entrepot', 'warehouseopen,warehouseinternal', 1);
print img_picto('', 'stock');
$selected = (GETPOST("dwid") ?GETPOST("dwid", 'int') : (GETPOST('id_entrepot') ?GETPOST('id_entrepot', 'int') : ($object->element == 'product' && $object->fk_default_warehouse ? $object->fk_default_warehouse : 'ifone')));
$warehousestatus = 'warehouseopen,warehouseinternal';
print $formproduct->selectWarehouses($selected, 'id_entrepot', $warehousestatus, 1);
print '</td>';
}
if ($object->element == 'stock') {