Debug v14

This commit is contained in:
Laurent Destailleur 2021-05-25 23:26:03 +02:00
parent f252748dbf
commit f9d6438bae
4 changed files with 26 additions and 16 deletions

View File

@ -744,6 +744,7 @@ if ($conf->use_javascript_ajax) {
print "</td>\n";
print "</tr>\n";
/* Disabled. Would be better to be managed with a user cookie
if (!empty($conf->productbatch->enabled)) {
print '<tr class="oddeven">';
print '<td>' . $langs->trans("ShowAllBatchByDefault") . '</td>';
@ -757,6 +758,7 @@ if (!empty($conf->productbatch->enabled)) {
print "</td>\n";
print "</tr>\n";
}
*/
print '</table>';

View File

@ -533,6 +533,10 @@ class Conf
}
}
if (!isset($this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT)) {
$this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT = 1;
}
// conf->currency
if (empty($this->global->MAIN_MONNAIE)) {
$this->global->MAIN_MONNAIE = 'EUR';

View File

@ -70,7 +70,7 @@ ProductionForRef=Production of %s
AutoCloseMO=Close automatically the Manufacturing Order if quantities to consume and to produce are reached
NoStockChangeOnServices=No stock change on services
ProductQtyToConsumeByMO=Product quantity still to consume by open MO
ProductQtyToProduceByMO=Product quentity still to produce by open MO
ProductQtyToProduceByMO=Product quantity still to produce by open MO
AddNewConsumeLines=Add new line to consume
ProductsToConsume=Products to consume
ProductsToProduce=Products to produce

View File

@ -531,43 +531,44 @@ if ($id > 0 || $ref) {
llxHeader('', $title, $helpurl);
if (! empty($conf->use_javascript_ajax)) {
?>
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$(".collapse_batch").click(function() {
console.log("We click on collapse_batch");
var id_entrepot = $(this).attr('id').replace('ent', '');
if($(this).text().indexOf('+') > 0) {
$(".batch_warehouse" + id_entrepot).show();
$(this).html('(-)&nbsp;');
$(this).html('(-)');
}
else {
$(".batch_warehouse" + id_entrepot).hide();
$(this).html('(+)&nbsp;');
$(this).html('(+)');
}
return false;
});
$("#show_all").click(function() {
console.log("We click on show_all");
$("[class^=batch_warehouse]").show();
$("[class^=collapse_batch]").html('(-)&nbsp;');
$("[class^=collapse_batch]").html('(-)');
return false;
});
$("#hide_all").click(function() {
console.log("We click on hide_all");
$("[class^=batch_warehouse]").hide();
$("[class^=collapse_batch]").html('(+)&nbsp;');
$("[class^=collapse_batch]").html('(+)');
return false;
});
});
</script>
<?php
}
if ($result > 0) {
$head = product_prepare_head($object);
@ -908,18 +909,18 @@ if (!$variants) {
if ((!empty($conf->productbatch->enabled)) && $object->hasbatch()) {
$colspan = 3;
print '<tr class="liste_titre"><td width="14%">';
print '<a id="show_all" href="#">'.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'</a><br>';
print '<a id="hide_all" href="#">'.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").'</a>&nbsp;';
print $form->textwithpicto('', $langs->trans('CollapseBatchDetailHelp'), 1, 'help', '');
print '<a id="show_all" href="#">'.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'</a> &nbsp; ';
print '<a id="hide_all" href="#">'.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").'</a>';
//print '&nbsp;'.$form->textwithpicto('', $langs->trans('CollapseBatchDetailHelp'), 1, 'help', '');
print '</td>';
print '<td class="right">'.$langs->trans("batch_number").'</td>';
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
$colspan--;
print '<td class="center width75">'.$langs->trans("EatByDate").'</td>';
print '<td class="center width100">'.$langs->trans("EatByDate").'</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
$colspan--;
print '<td class="center width75">'.$langs->trans("SellByDate").'</td>';
print '<td class="center width100">'.$langs->trans("SellByDate").'</td>';
}
print '<td colspan="'.$colspan.'"></td>';
print '<td></td>';
@ -967,10 +968,13 @@ if (!$variants) {
$stock_real = price2num($obj->reel, 'MS');
print '<tr class="oddeven">';
print '<td colspan="4">';
print $entrepotstatic->getNomUrl(1);
if (!empty($conf->productbatch->enabled)) {
print '<a class="collapse_batch" id="ent' . $entrepotstatic->id . '" href="#">' . (empty($conf->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT) ? '(+)' : '(-)') . '&nbsp;</a>';
print '<a class="collapse_batch marginleftonly" id="ent' . $entrepotstatic->id . '" href="#">';
print (empty($conf->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT) ? '(+)' : '(-)');
print '</a>';
}
print $entrepotstatic->getNomUrl(1).'</td>';
print '</td>';
print '<td class="right">'.$stock_real.($stock_real < 0 ? ' '.img_warning() : '').'</td>';
// PMP
print '<td class="right">'.(price2num($object->pmp) ? price2num($object->pmp, 'MU') : '').'</td>';