From 2547d96ffd7e88ded871cb22420585f8b84de9eb Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 20 Feb 2015 09:26:53 +0100 Subject: [PATCH] New : Use supplier default payment terms when creating a replenish order --- htdocs/product/stock/replenish.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 6bcabecbe9d..3c8f3746c45 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -184,13 +184,14 @@ if ($action == 'order' && isset($_POST['valid'])) } } else { $order->socid = $suppliersid[$i]; + $order->fetch_thirdparty(); //trick to know which orders have been generated this way $order->source = 42; foreach ($supplier['lines'] as $line) { $order->lines[] = $line; } - $order->cond_reglement_id = 0; - $order->mode_reglement_id = 0; + $order->cond_reglement_id = $order->thirdparty->cond_reglement_supplier_id; + $order->mode_reglement_id = $order->thirdparty->mode_reglement_supplier_id; $id = $order->create($user); if ($id < 0) { $fail++;