|
@@ -541,9 +541,12 @@ if ($id > 0 || !empty($ref)) {
|
|
|
}
|
|
|
print '<td class="right">'.$langs->trans("SupplierRef").'</td>';
|
|
|
print '<td class="right">'.$langs->trans("QtyOrdered").'</td>';
|
|
|
- print '<td class="right">'.$langs->trans("QtyDispatchedShort").'</td>';
|
|
|
- print ' <td class="right">'.$langs->trans("QtyToDispatchShort");
|
|
|
- //print '<br><a href="#" id="autoreset">'.img_picto($langs->trans("Reset"), 'eraser', 'class="pictofixedwidth opacitymedium"').$langs->trans("Reset").'</a></td>';
|
|
|
+ if ($object->status == Reception::STATUS_DRAFT) {
|
|
|
+ print '<td class="right">'.$langs->trans("QtyToReceive"); // Qty to dispatch (sum for all lines of batch detail if there is)
|
|
|
+ } else {
|
|
|
+ print '<td class="right">'.$langs->trans("QtyDispatchedShort").'</td>';
|
|
|
+ }
|
|
|
+ print '<td class="right">'.$langs->trans("Details");
|
|
|
print '<td width="32"></td>';
|
|
|
|
|
|
if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) {
|
|
@@ -683,7 +686,7 @@ if ($id > 0 || !empty($ref)) {
|
|
|
print '<td></td>'; // Warehouse column
|
|
|
|
|
|
$sql = "SELECT cfd.rowid, cfd.qty, cfd.fk_entrepot, cfd.batch, cfd.eatby, cfd.sellby, cfd.fk_product";
|
|
|
- $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as cfd";
|
|
|
+ $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as cfd"; // commande_fournisseur_dispatch should be named receptiondet_batch
|
|
|
$sql .= " WHERE cfd.fk_reception = ".((int) $object->id);
|
|
|
$sql .= " AND cfd.fk_commande = ".((int) $objectsrc->id);
|
|
|
$sql .= " AND cfd.fk_commandefourndet = ".(int) $objp->rowid;
|
|
@@ -698,7 +701,7 @@ if ($id > 0 || !empty($ref)) {
|
|
|
$suffix = "_".$j."_".$i;
|
|
|
$objd = $db->fetch_object($resultsql);
|
|
|
|
|
|
- if (isModEnabled('productbatch') && !empty($objd->batch)) {
|
|
|
+ if (isModEnabled('productbatch') && (!empty($objd->batch) || (is_null($objd->batch) && $tmpproduct->status_batch > 0))) {
|
|
|
$type = 'batch';
|
|
|
|
|
|
// Enable hooks to append additional columns
|
|
@@ -739,7 +742,7 @@ if ($id > 0 || !empty($ref)) {
|
|
|
print '</td>';
|
|
|
|
|
|
print '<td>';
|
|
|
- print '<input disabled="" type="text" class="inputlotnumber quatrevingtquinzepercent" id="lot_number'.$suffix.'" name="lot_number'.$suffix.'" value="'.$objd->batch.'">';
|
|
|
+ print '<input disabled="" type="text" class="inputlotnumber quatrevingtquinzepercent" id="lot_number'.$suffix.'" name="lot_number'.$suffix.'" value="'.(GETPOSTISSET('lot_number'.$suffix) ? GETPOST('lot_number'.$suffix) : $objd->batch).'">';
|
|
|
print '</td>';
|
|
|
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
|
|
|
print '<td class="nowraponall">';
|