';
print '| ';
print '';
print '';
-
+
print '';
if (! empty($conf->global->SUPPLIER_ORDER_EDIT_BUYINGPRICE_DURING_RECEIPT)) // Not tested !
{
@@ -567,23 +577,38 @@ if ($id > 0 || ! empty($ref)) {
{
print '';
}
-
+
// hidden fields for js function
print '';
print '';
print ' | ';
}
- // Dispatch
+
+ // Qty to dispatch
print '';
print '';
+ print ' | ';
+
+ print '';
+ if (! empty($conf->productbatch->enabled) && $objp->tobatch == 1) {
+ $type = 'batch';
+ //print img_picto($langs->trans('AddDispatchBatchLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine(' . $i . ',\'' . $type . '\')"');
+ print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine(' . $i . ',\'' . $type . '\')"');
+ }
+ else
+ {
+ $type = 'dispatch';
+ print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine(' . $i . ',\'' . $type . '\')"');
+ }
+
print ' | ';
// Warehouse
print '';
if (count($listwarehouses) > 1) {
- print $formproduct->selectWarehouses(GETPOST("entrepot" . $suffix), "entrepot" . $suffix, '', 1, 0, $objp->fk_product);
+ print $formproduct->selectWarehouses(GETPOST("entrepot" . $suffix), "entrepot" . $suffix, '', 1, 0, $objp->fk_product, '', 1);
} elseif (count($listwarehouses) == 1) {
- print $formproduct->selectWarehouses(GETPOST("entrepot" . $suffix), "entrepot" . $suffix, '', 0, 0, $objp->fk_product);
+ print $formproduct->selectWarehouses(GETPOST("entrepot" . $suffix), "entrepot" . $suffix, '', 0, 0, $objp->fk_product, '', 1);
} else {
$langs->load("errors");
print $langs->trans("ErrorNoWarehouseDefined");
@@ -604,10 +629,10 @@ if ($id > 0 || ! empty($ref)) {
print '';
print " \n";
- if ($nbproduct)
+ if ($nbproduct)
{
$checkboxlabel=$langs->trans("CloseReceivedSupplierOrdersAutomatically", $langs->transnoentitiesnoconv($object->statuts[5]));
-
+
print '
';
print $langs->trans("Comment") . ' : ';
print ' ';
print ' '.$checkboxlabel;
-
+
print ' 0 || ! empty($ref)) {
if (! $nbproduct) {
if (empty($conf->global->SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED))
print ' '.$langs->trans("NoPredefinedProductToDispatch").' '; // No predefined line at all
- else
+ else
print ' '.$langs->trans("NoMorePredefinedProductToDispatch").' '; // No predefined line that remain to be dispatched.
}
@@ -637,7 +662,7 @@ if ($id > 0 || ! empty($ref)) {
dol_fiche_end();
-
+
// List of lines already dispatched
$sql = "SELECT p.ref, p.label,";
$sql .= " e.rowid as warehouse_id, e.label as entrepot,";
diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php
index 68976e9b7c7..700ce7a770a 100644
--- a/htdocs/fourn/commande/document.php
+++ b/htdocs/fourn/commande/document.php
@@ -100,7 +100,7 @@ if ($object->id > 0)
$head = ordersupplier_prepare_head($object);
- dol_fiche_head($head, 'documents', $langs->trans('SupplierOrder'), 0, 'order');
+ dol_fiche_head($head, 'documents', $langs->trans('SupplierOrder'), -1, 'order');
// Construit liste des fichiers
@@ -114,7 +114,7 @@ if ($object->id > 0)
// Supplier order card
$linkback = ' '.$langs->trans("BackToList").'';
-
+
$morehtmlref=' ';
// Ref supplier
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1);
@@ -155,13 +155,13 @@ if ($object->id > 0)
}
}
$morehtmlref.=' ';
-
- dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
-
+ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+
+
print ' ';
print ' ';
-
+
print ' ';
print '| '.$langs->trans("NbOfAttachedFiles").' | '.count($filearray).' | ';
print '| '.$langs->trans("TotalSizeOfAttachedFiles").' | '.$totalsize.' '.$langs->trans("bytes").' | ';
@@ -170,8 +170,8 @@ if ($object->id > 0)
print "\n";
dol_fiche_end();
-
-
+
+
$modulepart = 'commande_fournisseur';
$permission = $user->rights->fournisseur->commande->creer;
$permtoedit = $user->rights->fournisseur->commande->creer;
diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php
index 50b310a55e5..bbc688264b8 100644
--- a/htdocs/fourn/commande/info.php
+++ b/htdocs/fourn/commande/info.php
@@ -100,7 +100,7 @@ $now=dol_now();
$head = ordersupplier_prepare_head($object);
-dol_fiche_head($head, 'info', $langs->trans("SupplierOrder"), 0, 'order');
+dol_fiche_head($head, 'info', $langs->trans("SupplierOrder"), -1, 'order');
// Supplier order card
@@ -197,7 +197,7 @@ if (!empty($object->id))
$param='&id='.$object->id;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
-
+
print load_fiche_titre($langs->trans("ActionsOnOrder"),'','');
// List of actions on element
diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php
index a3334baa5d9..45e4bd80e3a 100644
--- a/htdocs/fourn/commande/note.php
+++ b/htdocs/fourn/commande/note.php
@@ -75,19 +75,19 @@ if ($id > 0 || ! empty($ref))
if ($result >= 0)
{
$object->fetch_thirdparty();
-
+
$author = new User($db);
$author->fetch($object->user_author_id);
$head = ordersupplier_prepare_head($object);
$title=$langs->trans("SupplierOrder");
- dol_fiche_head($head, 'note', $title, 0, 'order');
+ dol_fiche_head($head, 'note', $title, -1, 'order');
// Supplier order card
-
+
$linkback = ''.$langs->trans("BackToList").'';
-
+
$morehtmlref='';
// Ref supplier
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1);
@@ -128,19 +128,19 @@ if ($id > 0 || ! empty($ref))
}
}
$morehtmlref.=' ';
-
- dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
-
+ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+
+
print '';
print ' ';
-
-
+
+
$cssclass="titlefield";
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
print ' ';
-
+
dol_fiche_end();
}
else
diff --git a/htdocs/fourn/js/lib_dispatch.js b/htdocs/fourn/js/lib_dispatch.js
index c58a4e1fe9d..84f74c30c54 100644
--- a/htdocs/fourn/js/lib_dispatch.js
+++ b/htdocs/fourn/js/lib_dispatch.js
@@ -26,16 +26,20 @@
*
* @param index int index of produt line. 0 = first product line
* @param type string type of dispatch (batch = batch dispatch, dispatch = non batch dispatch)
+ * @param mode string 'qtymissing' will create new line with qty missing, 'lessone' will keep 1 in old line and the rest in new one
*/
-function addDispatchLine(index,type)
+function addDispatchLine(index, type, mode)
{
+ mode = mode || 'qtymissing'
+
+ console.log("Split line type="+type+" index="+index+" mode="+mode);
var $row = $("tr[name='"+type+'_0_'+index+"']").clone(true), // clone first batch line to jQuery object
nbrTrs = $("tr[name^='"+type+"_'][name$='_"+index+"']").length, // position of line for batch
qtyOrdered = parseFloat($("#qty_ordered_"+(nbrTrs - 1)+"_"+index).val()),
qty = parseFloat($("#qty_"+(nbrTrs - 1)+"_"+index).val()),
qtyDispatched;
- if (type === 'batch')
+ if (mode === 'lessone')
{
qtyDispatched = parseFloat($("#qty_dispatched_"+(nbrTrs - 1)+"_"+index).val()) + 1;
}
@@ -63,15 +67,22 @@ function addDispatchLine(index,type)
/* Suffix of lines are: _ trs.length _ index */
$("#qty_"+nbrTrs+"_"+index).focus();
$("#qty_dispatched_"+(nbrTrs)+"_"+index).val(qtyDispatched);
- if (type === 'batch')
+
+ //hide all buttons then show only the last one
+ $("tr[name^='"+type+"_'][name$='_"+index+"'] .splitbutton").hide();
+ $("tr[name^='"+type+"_'][name$='_"+index+"']:last .splitbutton").show();
+
+ if (mode === 'lessone')
{
$("#qty_"+(nbrTrs)+"_"+index).val(qty-1);
$("#qty_"+(nbrTrs-1)+"_"+index).val(1);
}
else
{
-
$("#qty_"+nbrTrs+"_"+index).val(qtyOrdered - qtyDispatched);
- }
+ }
+
+ //set focus on lot of new line (if it exists)
+ $("#lot_number_"+(nbrTrs)+"_"+index).focus();
}
}
\ No newline at end of file
diff --git a/htdocs/product/admin/product_lot_extrafields.php b/htdocs/product/admin/product_lot_extrafields.php
index 28b4ee7db1d..fb1cdfcb704 100644
--- a/htdocs/product/admin/product_lot_extrafields.php
+++ b/htdocs/product/admin/product_lot_extrafields.php
@@ -75,7 +75,7 @@ print load_fiche_titre($title,$linkback,'title_setup');
$head = product_lot_admin_prepare_head();
-dol_fiche_head($head, 'attributes', $textobject, 0, 'stock');
+dol_fiche_head($head, 'attributes', $textobject, -1, 'stock');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|