Fixing style errors.
This commit is contained in:
parent
cf9c9ec882
commit
3cc65989c1
@ -1021,10 +1021,9 @@ if ($action == 'create') {
|
|||||||
$object->loadExpeditions();
|
$object->loadExpeditions();
|
||||||
|
|
||||||
|
|
||||||
$alreadyQtyBatchSetted = $alreadyQtySetted = array();
|
$alreadyQtyBatchSetted = $alreadyQtySetted = array();
|
||||||
|
|
||||||
if ($numAsked)
|
if ($numAsked) {
|
||||||
{
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Description").'</td>';
|
print '<td>'.$langs->trans("Description").'</td>';
|
||||||
print '<td class="center">'.$langs->trans("QtyOrdered").'</td>';
|
print '<td class="center">'.$langs->trans("QtyOrdered").'</td>';
|
||||||
@ -1049,12 +1048,12 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$warehouse_id = GETPOST('entrepot_id', 'int');
|
$warehouse_id = GETPOST('entrepot_id', 'int');
|
||||||
$warehousePicking = array();
|
$warehousePicking = array();
|
||||||
// get all warehouse children for picking
|
// get all warehouse children for picking
|
||||||
if($warehouse_id > 0){
|
if ($warehouse_id > 0) {
|
||||||
$warehousePicking[] = $warehouse_id;
|
$warehousePicking[] = $warehouse_id;
|
||||||
$warehouseObj = new Entrepot($db);
|
$warehouseObj = new Entrepot($db);
|
||||||
$warehouseObj->get_children_warehouses($warehouse_id,$warehousePicking);
|
$warehouseObj->get_children_warehouses($warehouse_id, $warehousePicking);
|
||||||
}
|
}
|
||||||
|
|
||||||
$indiceAsked = 0;
|
$indiceAsked = 0;
|
||||||
@ -1306,7 +1305,7 @@ if ($action == 'create') {
|
|||||||
// Define nb of lines suggested for this order line
|
// Define nb of lines suggested for this order line
|
||||||
$nbofsuggested = 0;
|
$nbofsuggested = 0;
|
||||||
|
|
||||||
uasort ( $product->stock_warehouse , function ($a, $b){
|
uasort( $product->stock_warehouse, function ($a, $b) {
|
||||||
if ($a->real == $b->real) { return 0; }
|
if ($a->real == $b->real) { return 0; }
|
||||||
return ($a->real < $b->real) ? -1 : 1;
|
return ($a->real < $b->real) ? -1 : 1;
|
||||||
});
|
});
|
||||||
@ -1318,8 +1317,7 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
$tmpwarehouseObject = new Entrepot($db);
|
$tmpwarehouseObject = new Entrepot($db);
|
||||||
foreach ($product->stock_warehouse as $warehouse_id => $stock_warehouse) { // $stock_warehouse is product_stock
|
foreach ($product->stock_warehouse as $warehouse_id => $stock_warehouse) { // $stock_warehouse is product_stock
|
||||||
|
if (!empty($warehousePicking) && !in_array($warehouse_id, $warehousePicking)) {
|
||||||
if(!empty($warehousePicking) && !in_array($warehouse_id, $warehousePicking)){
|
|
||||||
// if a warehouse was selected by user, picking is limited to this warehouse and his children
|
// if a warehouse was selected by user, picking is limited to this warehouse and his children
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1333,11 +1331,10 @@ if ($action == 'create') {
|
|||||||
print '<!-- subj='.$subj.'/'.$nbofsuggested.' --><tr '.((($subj + 1) == $nbofsuggested) ? $bc[$var] : '').'>';
|
print '<!-- subj='.$subj.'/'.$nbofsuggested.' --><tr '.((($subj + 1) == $nbofsuggested) ? $bc[$var] : '').'>';
|
||||||
print '<td colspan="3" ></td><td class="center"><!-- qty to ship (no lot management for product line indiceAsked='.$indiceAsked.') -->';
|
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 ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
|
||||||
if(isset($alreadyQtySetted[$line->fk_product][intval($warehouse_id)])){
|
if (isset($alreadyQtySetted[$line->fk_product][intval($warehouse_id)])) {
|
||||||
$deliverableQty = min($quantityToBeDelivered, $stock - $alreadyQtySetted[$line->fk_product][intval($warehouse_id)]);
|
$deliverableQty = min($quantityToBeDelivered, $stock - $alreadyQtySetted[$line->fk_product][intval($warehouse_id)]);
|
||||||
}
|
} else {
|
||||||
else{
|
if (!isset($alreadyQtySetted[$line->fk_product])) {
|
||||||
if(!isset($alreadyQtySetted[$line->fk_product])){
|
|
||||||
$alreadyQtySetted[$line->fk_product] = array();
|
$alreadyQtySetted[$line->fk_product] = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1347,14 +1344,14 @@ if ($action == 'create') {
|
|||||||
if ($deliverableQty < 0) $deliverableQty = 0;
|
if ($deliverableQty < 0) $deliverableQty = 0;
|
||||||
|
|
||||||
$tooltip = '';
|
$tooltip = '';
|
||||||
if(!empty($alreadyQtySetted[$line->fk_product][intval($warehouse_id)])){
|
if (!empty($alreadyQtySetted[$line->fk_product][intval($warehouse_id)])) {
|
||||||
$tooltip = ' class="classfortooltip" title="'.$langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtySetted[$line->fk_product][intval($warehouse_id)].'" ';
|
$tooltip = ' class="classfortooltip" title="'.$langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtySetted[$line->fk_product][intval($warehouse_id)].'" ';
|
||||||
}
|
}
|
||||||
|
|
||||||
$alreadyQtySetted[$line->fk_product][intval($warehouse_id)] = $deliverableQty + $alreadyQtySetted[$line->fk_product][intval($warehouse_id)];
|
$alreadyQtySetted[$line->fk_product][intval($warehouse_id)] = $deliverableQty + $alreadyQtySetted[$line->fk_product][intval($warehouse_id)];
|
||||||
|
|
||||||
$inputName = 'qtyl'.$indiceAsked.'_'.$subj;
|
$inputName = 'qtyl'.$indiceAsked.'_'.$subj;
|
||||||
if(GETPOSTISSET($inputName)){
|
if (GETPOSTISSET($inputName)) {
|
||||||
$deliverableQty = GETPOST($inputName, 'int');
|
$deliverableQty = GETPOST($inputName, 'int');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1416,7 +1413,7 @@ if ($action == 'create') {
|
|||||||
$tmpwarehouseObject = new Entrepot($db);
|
$tmpwarehouseObject = new Entrepot($db);
|
||||||
$productlotObject = new Productlot($db);
|
$productlotObject = new Productlot($db);
|
||||||
|
|
||||||
uasort ( $product->stock_warehouse , function ($a, $b){
|
uasort( $product->stock_warehouse, function ($a, $b) {
|
||||||
if ($a->real == $b->real) { return 0; }
|
if ($a->real == $b->real) { return 0; }
|
||||||
return ($a->real < $b->real) ? -1 : 1;
|
return ($a->real < $b->real) ? -1 : 1;
|
||||||
});
|
});
|
||||||
@ -1459,17 +1456,15 @@ if ($action == 'create') {
|
|||||||
$tmpwarehouseObject->fetch($warehouse_id);
|
$tmpwarehouseObject->fetch($warehouse_id);
|
||||||
if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) {
|
if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) {
|
||||||
foreach ($stock_warehouse->detail_batch as $dbatch) {
|
foreach ($stock_warehouse->detail_batch as $dbatch) {
|
||||||
|
|
||||||
$batchStock = + $dbatch->qty; // To get a numeric
|
$batchStock = + $dbatch->qty; // To get a numeric
|
||||||
if(isset($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)])){
|
if (isset($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)])) {
|
||||||
$deliverableQty = min($quantityToBeDelivered, $batchStock - $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)]);
|
$deliverableQty = min($quantityToBeDelivered, $batchStock - $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)]);
|
||||||
}
|
} else {
|
||||||
else{
|
if (!isset($alreadyQtyBatchSetted[$line->fk_product])) {
|
||||||
if(!isset($alreadyQtyBatchSetted[$line->fk_product])){
|
|
||||||
$alreadyQtyBatchSetted[$line->fk_product] = array();
|
$alreadyQtyBatchSetted[$line->fk_product] = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isset($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch])){
|
if (!isset($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch])) {
|
||||||
$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch] = array();
|
$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch] = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1479,12 +1474,12 @@ if ($action == 'create') {
|
|||||||
if ($deliverableQty < 0) $deliverableQty = 0;
|
if ($deliverableQty < 0) $deliverableQty = 0;
|
||||||
|
|
||||||
$inputName = 'qtyl'.$indiceAsked.'_'.$subj;
|
$inputName = 'qtyl'.$indiceAsked.'_'.$subj;
|
||||||
if(GETPOSTISSET($inputName)){
|
if (GETPOSTISSET($inputName)) {
|
||||||
$deliverableQty = GETPOST($inputName, 'int');
|
$deliverableQty = GETPOST($inputName, 'int');
|
||||||
}
|
}
|
||||||
|
|
||||||
$tooltip = '';
|
$tooltip = '';
|
||||||
if(!empty($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)])){
|
if (!empty($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)])) {
|
||||||
$tooltip = ' class="classfortooltip" title="'.$langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)].'" ';
|
$tooltip = ' class="classfortooltip" title="'.$langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)].'" ';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user