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 "</td>\n";
print "</tr>\n"; print "</tr>\n";
/* Disabled. Would be better to be managed with a user cookie
if (!empty($conf->productbatch->enabled)) { if (!empty($conf->productbatch->enabled)) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>' . $langs->trans("ShowAllBatchByDefault") . '</td>'; print '<td>' . $langs->trans("ShowAllBatchByDefault") . '</td>';
@ -757,6 +758,7 @@ if (!empty($conf->productbatch->enabled)) {
print "</td>\n"; print "</td>\n";
print "</tr>\n"; print "</tr>\n";
} }
*/
print '</table>'; 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 // conf->currency
if (empty($this->global->MAIN_MONNAIE)) { if (empty($this->global->MAIN_MONNAIE)) {
$this->global->MAIN_MONNAIE = 'EUR'; $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 AutoCloseMO=Close automatically the Manufacturing Order if quantities to consume and to produce are reached
NoStockChangeOnServices=No stock change on services NoStockChangeOnServices=No stock change on services
ProductQtyToConsumeByMO=Product quantity still to consume by open MO 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 AddNewConsumeLines=Add new line to consume
ProductsToConsume=Products to consume ProductsToConsume=Products to consume
ProductsToProduce=Products to produce ProductsToProduce=Products to produce

View File

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