Fix use supplier relative discount in replenish order creation
This commit is contained in:
parent
b5c88d5817
commit
acadef72c1
@ -211,7 +211,9 @@ if ($action == 'order' && isset($_POST['valid']))
|
|||||||
if ($resql && $db->num_rows($resql) > 0) {
|
if ($resql && $db->num_rows($resql) > 0) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
$order->fetch($obj->rowid);
|
$order->fetch($obj->rowid);
|
||||||
|
$order->fetch_thirdparty();
|
||||||
foreach ($supplier['lines'] as $line) {
|
foreach ($supplier['lines'] as $line) {
|
||||||
|
if(empty($line->remise_percent)) $line->remise_percent = $order->thirdparty->remise_supplier_percent;
|
||||||
$result = $order->addline(
|
$result = $order->addline(
|
||||||
$line->desc,
|
$line->desc,
|
||||||
$line->subprice,
|
$line->subprice,
|
||||||
@ -248,6 +250,7 @@ if ($action == 'order' && isset($_POST['valid']))
|
|||||||
//trick to know which orders have been generated this way
|
//trick to know which orders have been generated this way
|
||||||
$order->source = 42;
|
$order->source = 42;
|
||||||
foreach ($supplier['lines'] as $line) {
|
foreach ($supplier['lines'] as $line) {
|
||||||
|
if(empty($line->remise_percent)) $line->remise_percent = $order->thirdparty->remise_supplier_percent;
|
||||||
$order->lines[] = $line;
|
$order->lines[] = $line;
|
||||||
}
|
}
|
||||||
$order->cond_reglement_id = $order->thirdparty->cond_reglement_supplier_id;
|
$order->cond_reglement_id = $order->thirdparty->cond_reglement_supplier_id;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user