FIX - php V8 expedition card

This commit is contained in:
BB2A Anthony Berton 2022-06-27 08:42:33 +02:00
parent 0b138167f6
commit 324b145833

View File

@ -982,7 +982,7 @@ if ($action == 'create') {
print "</td></tr>\n"; print "</td></tr>\n";
// Other attributes // Other attributes
$parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'cols' => '3', 'socid' => $socid); $parameters = array('objectsrc' => isset($objectsrc) ? $objectsrc : '', 'colspan' => ' colspan="3"', 'cols' => '3', 'socid' => $socid);
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $expe, $action); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $expe, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
@ -1178,7 +1178,7 @@ if ($action == 'create') {
// Qty already shipped // Qty already shipped
print '<td class="center">'; print '<td class="center">';
$quantityDelivered = $object->expeditions[$line->id]; $quantityDelivered = isset($object->expeditions[$line->id]) ? $object->expeditions[$line->id] : '';
print $quantityDelivered; print $quantityDelivered;
print '<input name="qtydelivered'.$indiceAsked.'" id="qtydelivered'.$indiceAsked.'" type="hidden" value="'.$quantityDelivered.'">'; print '<input name="qtydelivered'.$indiceAsked.'" id="qtydelivered'.$indiceAsked.'" type="hidden" value="'.$quantityDelivered.'">';
print ''.$unit_order.'</td>'; print ''.$unit_order.'</td>';
@ -1188,14 +1188,16 @@ if ($action == 'create') {
if ($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) { if ($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
$quantityToBeDelivered = 0; $quantityToBeDelivered = 0;
} else { } else {
$quantityToBeDelivered = $quantityAsked - $quantityDelivered; if (isset($quantityAsked) and isset($quantityDelivered)) {
$quantityToBeDelivered = is_float($quantityAsked) - is_float($quantityDelivered);
}
} }
$warehouseObject = null; $warehouseObject = null;
if (count($warehousePicking) == 1 || !($line->fk_product > 0) || empty($conf->stock->enabled)) { // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection if (count($warehousePicking) == 1 || !($line->fk_product > 0) || empty($conf->stock->enabled)) { // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection
print '<!-- Case warehouse already known or product not a predefined product -->'; print '<!-- Case warehouse already known or product not a predefined product -->';
//ship from preselected location //ship from preselected location
$stock = + $product->stock_warehouse[$warehouse_id]->real; // Convert to number $stock = + isSET($product->stock_warehouse[$warehouse_id]->real) ? $product->stock_warehouse[$warehouse_id]->real : 0; // Convert to number
$deliverableQty = min($quantityToBeDelivered, $stock); $deliverableQty = min($quantityToBeDelivered, $stock);
if ($deliverableQty < 0) { if ($deliverableQty < 0) {
$deliverableQty = 0; $deliverableQty = 0;