Fix dispatch, only edit received lines on draft reception.
No stock movement on reception.
This commit is contained in:
parent
0271645d8e
commit
7101c2445d
@ -410,7 +410,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->fourn
|
|||||||
$error++;
|
$error++;
|
||||||
} else {
|
} else {
|
||||||
// If module stock is enabled and the stock increase is done on purchase order dispatching
|
// If module stock is enabled and the stock increase is done on purchase order dispatching
|
||||||
if ($entrepot > 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) {
|
if ($entrepot > 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) && empty($supplierorderdispatch->fk_reception)) {
|
||||||
$mouv = new MouvementStock($db);
|
$mouv = new MouvementStock($db);
|
||||||
if ($product > 0) {
|
if ($product > 0) {
|
||||||
$mouv->origin = &$object;
|
$mouv->origin = &$object;
|
||||||
@ -1287,19 +1287,22 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action != 'editline' || $lineid != $objp->dispatchlineid) {
|
if ($action != 'editline' || $lineid != $objp->dispatchlineid) {
|
||||||
print '<td class="linecoledit center">';
|
if (empty($reception->id) || ($reception->statut == Reception::STATUS_DRAFT)) { // only allow edit on draft reception
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editline&lineid='.$objp->dispatchlineid.'#line_'.$objp->dispatchlineid.'">';
|
print '<td class="linecoledit center">';
|
||||||
print img_edit();
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editline&lineid='.$objp->dispatchlineid.'#line_'.$objp->dispatchlineid.'">';
|
||||||
print '</a>';
|
print img_edit();
|
||||||
print '</td>';
|
print '</a>';
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="linecoldelete center">';
|
print '<td class="linecoldelete center">';
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=ask_deleteline&lineid='.$objp->dispatchlineid.'#dispatch_received_products">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=ask_deleteline&lineid='.$objp->dispatchlineid.'#dispatch_received_products">';
|
||||||
print img_delete();
|
print img_delete();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
} else {
|
||||||
|
print '<td></td><td></td>';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<td class="center valignmiddle">';
|
print '<td class="center valignmiddle">';
|
||||||
print '<input type="submit" class="button button-save" id="savelinebutton" name="save" value="'.$langs->trans("Save").'" />';
|
print '<input type="submit" class="button button-save" id="savelinebutton" name="save" value="'.$langs->trans("Save").'" />';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user