From 3b33dad8fdb41cdb09f77aade27c98f437cae4ee Mon Sep 17 00:00:00 2001
From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com>
Date: Wed, 20 Jun 2018 14:40:32 +0200
Subject: [PATCH 1/2] Add supplier ref
Hi
In all common case the supplier send a receipt with the parcel on which is writen his product ref (because this is his reference) with the quantity in the parcel and if he is smart/nice our reference.
By adding the supplier ref column the supplier order dispatch is easier.
Tks.
---
htdocs/fourn/commande/dispatch.php | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php
index 5b4adc39638..2c4fbe9e799 100644
--- a/htdocs/fourn/commande/dispatch.php
+++ b/htdocs/fourn/commande/dispatch.php
@@ -492,7 +492,7 @@ if ($id > 0 || ! empty($ref)) {
$db->free($resql);
}
- $sql = "SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, SUM(l.qty) as qty,";
+ $sql = "SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, SUM(l.qty) as qty, l.ref AS sref,";
$sql .= " p.ref, p.label, p.tobatch, p.fk_default_warehouse";
$sql .= " FROM " . MAIN_DB_PREFIX . "commande_fournisseurdet as l";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON l.fk_product=p.rowid";
@@ -514,6 +514,7 @@ if ($id > 0 || ! empty($ref)) {
print '
| ';
print ' | ';
print ' | ';
+ print '' . $langs->trans("SupplierRef") . ' | ';
print '' . $langs->trans("QtyOrdered") . ' | ';
print '' . $langs->trans("QtyDispatchedShort") . ' | ';
print '' . $langs->trans("QtyToDispatchShort") . ' | ';
@@ -590,6 +591,9 @@ if ($id > 0 || ! empty($ref)) {
if (! empty($objp->remise_percent) && empty($conf->global->STOCK_EXCLUDE_DISCOUNT_FOR_PMP))
$up_ht_disc = price2num($up_ht_disc * (100 - $objp->remise_percent) / 100, 'MU');
+ // Supplier ref
+ print ''.$objp->sref.' | ';
+
// Qty ordered
print '' . $objp->qty . ' | ';
From 569291763fef8a1822cd6ed9a9aba52f5fbe9e5e Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Fri, 29 Jun 2018 19:17:44 +0200
Subject: [PATCH 2/2] Update dispatch.php
---
htdocs/fourn/commande/dispatch.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php
index 2c4fbe9e799..609aa792511 100644
--- a/htdocs/fourn/commande/dispatch.php
+++ b/htdocs/fourn/commande/dispatch.php
@@ -492,7 +492,7 @@ if ($id > 0 || ! empty($ref)) {
$db->free($resql);
}
- $sql = "SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, SUM(l.qty) as qty, l.ref AS sref,";
+ $sql = "SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref AS sref, SUM(l.qty) as qty,";
$sql .= " p.ref, p.label, p.tobatch, p.fk_default_warehouse";
$sql .= " FROM " . MAIN_DB_PREFIX . "commande_fournisseurdet as l";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON l.fk_product=p.rowid";