Supplier order dispatch : retrieve line price from order when deleting dispatch line.
This will allows custom cost price to be reverted back in triggers and such later.
This commit is contained in:
parent
02c87f5899
commit
cb2dd77f49
@ -397,12 +397,24 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->fourn
|
||||
$qty = $supplierorderdispatch->qty;
|
||||
$entrepot = $supplierorderdispatch->fk_entrepot;
|
||||
$product = $supplierorderdispatch->fk_product;
|
||||
$price = price2num(GETPOST('price', 'alpha'), 'MU');
|
||||
$comment = $supplierorderdispatch->comment;
|
||||
$eatby = $supplierorderdispatch->eatby;
|
||||
$sellby = $supplierorderdispatch->sellby;
|
||||
$batch = $supplierorderdispatch->batch;
|
||||
|
||||
if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) {
|
||||
$price = price2num(GETPOST('price', 'alpha'), 'MU');
|
||||
}else{
|
||||
$cfl = new CommandeFournisseurLigne($db);
|
||||
$ret = $cfl->fetch($supplierorderdispatch->fk_commandefourndet);
|
||||
if($ret > 0){
|
||||
$price = $cfl->subprice;
|
||||
$price = price2num($price * (1 - ($cfl->remise_percent / 100.0)), 'MU');
|
||||
}else{
|
||||
$price = "0";
|
||||
}
|
||||
}
|
||||
|
||||
$result = $supplierorderdispatch->delete($user);
|
||||
}
|
||||
if ($result < 0) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user