Fix look and feel on shipment/reception

This commit is contained in:
Laurent Destailleur 2023-09-03 22:12:34 +02:00
parent 82f69c68b1
commit 4cb97704cc
3 changed files with 11 additions and 9 deletions

View File

@ -862,7 +862,7 @@ if (empty($reshook)) {
* View
*/
$title = $langs->trans("Shipment");
$title = $object->ref.' - '.$langs->trans("Shipment");
if ($action == 'create2') {
$title = $langs->trans("CreateShipment");
}
@ -1370,7 +1370,7 @@ if ($action == 'create') {
//var_dump($dbatch);
$batchStock = + $dbatch->qty; // To get a numeric
$deliverableQty = min($quantityToBeDelivered, $batchStock);
print '<!-- subj='.$subj.'/'.$nbofsuggested.' --><tr '.((($subj + 1) == $nbofsuggested) ? $bc[$var] : '').'>';
print '<!-- subj='.$subj.'/'.$nbofsuggested.' --><tr '.((($subj + 1) == $nbofsuggested) ? 'oddeven' : '').'>';
print '<td colspan="3" ></td><td class="center">';
print '<input class="qtyl" name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="'.$deliverableQty.'">';
print '</td>';
@ -1442,7 +1442,7 @@ if ($action == 'create') {
$deliverableQty = min($quantityToBeDelivered, $stock);
$deliverableQty = max(0, $deliverableQty);
// Quantity to send
print '<!-- subj='.$subj.'/'.$nbofsuggested.' --><tr '.((($subj + 1) == $nbofsuggested) ? $bc[$var] : '').'>';
print '<!-- subj='.$subj.'/'.$nbofsuggested.' --><tr '.((($subj + 1) == $nbofsuggested) ? 'oddeven' : '').'>';
print '<td colspan="3" ></td><td class="center"><!-- qty to ship (no lot management for product line indiceAsked='.$indiceAsked.') -->';
if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if (isset($alreadyQtySetted[$line->fk_product][intval($warehouse_id)])) {
@ -1582,7 +1582,7 @@ if ($action == 'create') {
}
$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = $deliverableQty + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)];
print '<!-- subj='.$subj.'/'.$nbofsuggested.' --><tr '.((($subj + 1) == $nbofsuggested) ? $bc[$var] : '').'><td colspan="3"></td><td class="center">';
print '<!-- subj='.$subj.'/'.$nbofsuggested.' --><tr '.((($subj + 1) == $nbofsuggested) ?'oddeven' : '').'><td colspan="3"></td><td class="center">';
print '<input class="qtyl '.$tooltipClass.'" title="'.$tooltipTitle.'" name="'.$inputName.'" id="'.$inputName.'" type="text" size="4" value="'.$deliverableQty.'">';
print '</td>';

View File

@ -48,7 +48,7 @@ if (isModEnabled('project')) {
}
// Load translation files required by the page
$langs->loadLangs(array("sendings", "companies", "bills", 'deliveries', 'orders', 'stocks', 'other', 'propal'));
$langs->loadLangs(array("sendings", "companies", "bills", 'deliveries', 'orders', 'stocks', 'other', 'propal', 'receptions'));
if (isModEnabled('productbatch')) {
$langs->load('productbatch');

View File

@ -1037,14 +1037,16 @@ if ($action == 'create') {
print '<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#autofill").click(function() {';
jQuery("#autofill").click(function(event) {
event.preventDefault();';
$i = 1;
while ($i <= $numAsked) {
print 'jQuery("#qtyl'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n";
$i++;
}
print '});
jQuery("#autoreset").click(function() {';
jQuery("#autoreset").click(function(event) {
event.preventDefault();';
$i = 1;
while ($i <= $numAsked) {
print 'jQuery("#qtyl'.$i.'").val(0);'."\n";
@ -1072,8 +1074,8 @@ if ($action == 'create') {
print '<td>'.$langs->trans("BuyingPrice").'</td>';
}
if (isModEnabled('productbatch')) {
print ' <br>(<a href="#" id="autofill">'.$langs->trans("Fill").'</a>';
print ' / <a href="#" id="autoreset">'.$langs->trans("Reset").'</a>)';
print ' <br><center><a href="#" id="autofill"><span class="fas fa-fill pictofixedwidth" style=""></span> '.$langs->trans("Fill").'</a>';
print ' &nbsp; &nbsp; <a href="#" id="autoreset"><span class="fas fa-eraser pictofixedwidth" style=""></span>'.$langs->trans("Reset").'</a></center><br>';
}
print '</td>';
if (isModEnabled('stock')) {