Start to debug batch/serial module
This commit is contained in:
parent
c3b74e66ff
commit
7afe9de1c0
@ -249,8 +249,8 @@ source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.productbatch]
|
||||
file_filter = htdocs/langs/<lang>/products.lang
|
||||
source_file = htdocs/langs/en_US/products.lang
|
||||
file_filter = htdocs/langs/<lang>/productbatch.lang
|
||||
source_file = htdocs/langs/en_US/productbatch.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
|
||||
@ -864,7 +864,7 @@ else
|
||||
// Batch number management
|
||||
if (! empty($conf->productbatch->enabled))
|
||||
{
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Status").' ('.$langs->trans("Batch").')</td><td colspan="3">';
|
||||
print '<tr><td>'.$langs->trans("ManageLotSerial").'</td><td colspan="3">';
|
||||
$statutarray=array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"));
|
||||
print $form->selectarray('status_batch',$statutarray,GETPOST('status_batch'));
|
||||
print '</td></tr>';
|
||||
@ -1441,7 +1441,7 @@ else
|
||||
if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
||||
print ajax_object_onoff($object, 'status_batch', 'tobatch', 'ProductStatusOnBatch', 'ProductStatusNotOnBatch');
|
||||
} else {
|
||||
print $object->getLibStatut(2,2);
|
||||
print $object->getLibStatut(0,2);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -296,8 +296,8 @@ if ($id > 0 || $ref)
|
||||
print '</td></tr>';
|
||||
|
||||
if ($conf->productbatch->enabled) {
|
||||
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("l_sellby").')</td><td>';
|
||||
print $product->getLibStatut(2,2);
|
||||
print '<tr><td>'.$langs->trans("ManageLotSerial").'</td><td>';
|
||||
print $product->getLibStatut(0,2);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -471,15 +471,18 @@ if ($id > 0 || $ref)
|
||||
//eat-by date
|
||||
if ((! empty($conf->productbatch->enabled)) && $product->hasbatch()) {
|
||||
print '<tr>';
|
||||
print '<td width="15%">'.$langs->trans("l_eatby").'</td><td width="15%">';
|
||||
print '<td colspan="2">'.$langs->trans("batch_number").'</td><td colspan="4">';
|
||||
print '<input type="text" name="batch_number" size="40" value="'.GETPOST("batch_number").'">';
|
||||
print '</td>';
|
||||
print '</tr><tr>';
|
||||
print '<td colspan="2">'.$langs->trans("l_eatby").'</td><td>';
|
||||
$form->select_date('','eatby','','',1,"");
|
||||
print '</td>';
|
||||
print '<td width="15%">'.$langs->trans("l_sellby").'</td><td width="15%">';
|
||||
print '<td></td>';
|
||||
print '<td>'.$langs->trans("l_sellby").'</td><td>';
|
||||
$form->select_date('','sellby','','',1,"");
|
||||
print '</td>';
|
||||
print '<td width="15%">'.$langs->trans("batch_number").'</td><td width="15%">';
|
||||
print '<input type="text" name="batch_number" size="40" value="'.GETPOST("batch_number").'">';
|
||||
print '</td></tr>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
@ -591,9 +594,10 @@ print '<td align="right">'.$langs->trans("SellPriceMin").'</td>';
|
||||
print '<td align="right">'.$langs->trans("EstimatedStockValueSellShort").'</td>';
|
||||
print '</tr>';
|
||||
if ( (! empty($conf->productbatch->enabled)) && $product->hasbatch()) {
|
||||
print '<tr class="liste_titre"><td width="10%"></td><td align="right" width="10%">'.$langs->trans("l_eatby").'</td>';
|
||||
print '<td align="right" width="10%">'.$langs->trans("l_sellby").'</td>';
|
||||
print '<tr class="liste_titre"><td width="10%"></td>';
|
||||
print '<td align="right" width="10%">'.$langs->trans("batch_number").'</td>';
|
||||
print '<td align="right" width="10%">'.$langs->trans("l_eatby").'</td>';
|
||||
print '<td align="right" width="10%">'.$langs->trans("l_sellby").'</td>';
|
||||
print '<td align="right" colspan="5"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@ -644,15 +648,18 @@ if ($resql)
|
||||
$totalvalue = $totalvalue + price2num($obj->pmp*$obj->reel,'MU'); // Ditto : Show PMP from movement or from product
|
||||
$totalvaluesell = $totalvaluesell + price2num($product->price*$obj->reel,'MU'); // Ditto : Show PMP from movement or from product
|
||||
//Batch Detail
|
||||
if ((! empty($conf->productbatch->enabled)) && $product->hasbatch()) {
|
||||
if ((! empty($conf->productbatch->enabled)) && $product->hasbatch())
|
||||
{
|
||||
$details=Productbatch::findAll($db,$obj->product_stock_id);
|
||||
if ($details<0) dol_print_error($db);
|
||||
foreach ($details as $pdluo) {
|
||||
print "\n".'<tr><td width="10%"></td><td width="10%" align="right">'. dol_print_date($pdluo->eatby,'day') .'</td>';
|
||||
print '<td align="right" width="10%">'. dol_print_date($pdluo->sellby,'day') .'</td>';
|
||||
print '<td align="right" width="10%">'.$pdluo->batch.'</td>';
|
||||
print '<td align="right" width="10%">'.$pdluo->qty.($pdluo->qty<0?' '.img_warning():'').'</td>';
|
||||
print '<td colspan="4" width="50%"></td></tr>';
|
||||
foreach ($details as $pdluo)
|
||||
{
|
||||
print "\n".'<tr><td></td>';
|
||||
print '<td align="right">'.$pdluo->batch.'</td>';
|
||||
print '<td align="right">'. dol_print_date($pdluo->eatby,'day') .'</td>';
|
||||
print '<td align="right">'. dol_print_date($pdluo->sellby,'day') .'</td>';
|
||||
print '<td align="right">'.$pdluo->qty.($pdluo->qty<0?' '.img_warning():'').'</td>';
|
||||
print '<td colspan="4"></td></tr>';
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user