Change order of fields for mass stock movement

This commit is contained in:
Laurent Destailleur 2020-07-20 01:01:40 +02:00
parent 9d9f865f37
commit d823bb73c0
2 changed files with 22 additions and 21 deletions

View File

@ -143,7 +143,7 @@ Replenishments=Replenishments
NbOfProductBeforePeriod=Quantity of product %s in stock before selected period (< %s) NbOfProductBeforePeriod=Quantity of product %s in stock before selected period (< %s)
NbOfProductAfterPeriod=Quantity of product %s in stock after selected period (> %s) NbOfProductAfterPeriod=Quantity of product %s in stock after selected period (> %s)
MassMovement=Mass movement MassMovement=Mass movement
SelectProductInAndOutWareHouse=Select a product, a quantity, a source warehouse and a target warehouse, then click "%s". Once this is done for all required movements, click onto "%s". SelectProductInAndOutWareHouse=Select a source warehouse and a target warehouse, a product and a quantity then click "%s". Once this is done for all required movements, click onto "%s".
RecordMovement=Record transfer RecordMovement=Record transfer
ReceivingForSameOrder=Receipts for this order ReceivingForSameOrder=Receipts for this order
StockMovementRecorded=Stock movements recorded StockMovementRecorded=Stock movements recorded

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2013-2018 Laurent Destaileur <ely@users.sourceforge.net> /* Copyright (C) 2013-2020 Laurent Destaileur <ely@users.sourceforge.net>
* Copyright (C) 2014 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2014 Regis Houssin <regis.houssin@inodbox.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@ -122,7 +122,7 @@ if ($action == 'addline')
} }
// TODO Check qty is ok for stock move. Note qty may not be enough yet, but we make a check now to report a warning. // TODO Check qty is ok for stock move. Note qty may not be enough yet, but we make a check now to report a warning.
// What is important is to have qty when doing action 'createmovements' // What is more important is to have qty when doing action 'createmovements'
if (!$error) if (!$error)
{ {
// Warning, don't forget lines already added into the $_SESSION['massstockmove'] // Warning, don't forget lines already added into the $_SESSION['massstockmove']
@ -139,9 +139,10 @@ if ($action == 'addline')
$listofdata[$id] = array('id'=>$id, 'id_product'=>$id_product, 'qty'=>$qty, 'id_sw'=>$id_sw, 'id_tw'=>$id_tw, 'batch'=>$batch); $listofdata[$id] = array('id'=>$id, 'id_product'=>$id_product, 'qty'=>$qty, 'id_sw'=>$id_sw, 'id_tw'=>$id_tw, 'batch'=>$batch);
$_SESSION['massstockmove'] = json_encode($listofdata); $_SESSION['massstockmove'] = json_encode($listofdata);
unset($id_product);
//unset($id_sw); //unset($id_sw);
//unset($id_tw); //unset($id_tw);
unset($id_product);
unset($batch);
unset($qty); unset($qty);
} }
} }
@ -338,18 +339,26 @@ print '<table class="liste centpercent">';
$param = ''; $param = '';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print getTitleFieldOfList($langs->trans('WarehouseSource'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
print getTitleFieldOfList($langs->trans('WarehouseTarget'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
print getTitleFieldOfList($langs->trans('ProductRef'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone '); print getTitleFieldOfList($langs->trans('ProductRef'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
if ($conf->productbatch->enabled) { if ($conf->productbatch->enabled) {
print getTitleFieldOfList($langs->trans('Batch'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone '); print getTitleFieldOfList($langs->trans('Batch'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
} }
print getTitleFieldOfList($langs->trans('WarehouseSource'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
print getTitleFieldOfList($langs->trans('WarehouseTarget'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
print getTitleFieldOfList($langs->trans('Qty'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'center tagtd maxwidthonsmartphone '); print getTitleFieldOfList($langs->trans('Qty'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'center tagtd maxwidthonsmartphone ');
print getTitleFieldOfList('', 0); print getTitleFieldOfList('', 0);
print '</tr>'; print '</tr>';
print '<tr class="oddeven">'; print '<tr class="oddeven">';
// From warehouse
print '<td>';
print $formproduct->selectWarehouses($id_sw, 'id_sw', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'minwidth200imp maxwidth200');
print '</td>';
// To warehouse
print '<td>';
print $formproduct->selectWarehouses($id_tw, 'id_tw', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'minwidth200imp maxwidth200');
print '</td>';
// Product // Product
print '<td class="titlefield">'; print '<td class="titlefield">';
$filtertype = 0; $filtertype = 0;
@ -360,7 +369,7 @@ if ($conf->global->PRODUIT_LIMIT_SIZE <= 0) {
$limit = $conf->global->PRODUIT_LIMIT_SIZE; $limit = $conf->global->PRODUIT_LIMIT_SIZE;
} }
$form->select_produits($id_product, 'productid', $filtertype, $limit, 0, -1, 2, '', 0, array(), 0, '1', 0, 'minwidth200imp maxwidth300', 1); $form->select_produits($id_product, 'productid', $filtertype, $limit, 0, -1, 2, '', 1, array(), 0, '1', 0, 'minwidth200imp maxwidth300', 1);
print '</td>'; print '</td>';
// Batch number // Batch number
if ($conf->productbatch->enabled) if ($conf->productbatch->enabled)
@ -369,14 +378,6 @@ if ($conf->productbatch->enabled)
print '<input type="text" name="batch" class="flat maxwidth50" value="'.$batch.'">'; print '<input type="text" name="batch" class="flat maxwidth50" value="'.$batch.'">';
print '</td>'; print '</td>';
} }
// In warehouse
print '<td>';
print $formproduct->selectWarehouses($id_sw, 'id_sw', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'minwidth200imp maxwidth200');
print '</td>';
// Out warehouse
print '<td>';
print $formproduct->selectWarehouses($id_tw, 'id_tw', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'minwidth200imp maxwidth200');
print '</td>';
// Qty // Qty
print '<td class="center"><input type="text" class="flat maxwidth50" name="qty" value="'.$qty.'"></td>'; print '<td class="center"><input type="text" class="flat maxwidth50" name="qty" value="'.$qty.'"></td>';
// Button to add line // Button to add line
@ -393,6 +394,12 @@ foreach ($listofdata as $key => $val)
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'; print '<td>';
print $warehousestatics->getNomUrl(1);
print '</td>';
print '<td>';
print $warehousestatict->getNomUrl(1);
print '</td>';
print '<td>';
print $productstatic->getNomUrl(1).' - '.$productstatic->label; print $productstatic->getNomUrl(1).' - '.$productstatic->label;
print '</td>'; print '</td>';
if ($conf->productbatch->enabled) if ($conf->productbatch->enabled)
@ -401,12 +408,6 @@ foreach ($listofdata as $key => $val)
print $val['batch']; print $val['batch'];
print '</td>'; print '</td>';
} }
print '<td>';
print $warehousestatics->getNomUrl(1);
print '</td>';
print '<td>';
print $warehousestatict->getNomUrl(1);
print '</td>';
print '<td class="center">'.$val['qty'].'</td>'; print '<td class="center">'.$val['qty'].'</td>';
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=delline&idline='.$val['id'].'">'.img_delete($langs->trans("Remove")).'</a></td>'; print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=delline&idline='.$val['id'].'">'.img_delete($langs->trans("Remove")).'</a></td>';