Merge pull request #14579 from ATM-Consulting/10.0_FIX_wrong_supplier_unit_price_calculation_when_accepting_supplier_price_proposal

FIX: unit price divided by quantity when accepting supplier price pro…
This commit is contained in:
Laurent Destailleur 2020-08-28 17:48:11 +02:00 committed by GitHub
commit 4d622316a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1810,7 +1810,7 @@ class SupplierProposal extends CommonObject
if(!empty($conf->multicurrency->enabled) && !empty($product->multicurrency_code)) list($fk_multicurrency, $multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $product->multicurrency_code);
$productsupplier->id = $product->fk_product;
$productsupplier->update_buyprice($product->qty, $product->subprice, $user, 'HT', $this->thirdparty, '', $ref_fourn, $product->tva_tx, 0, 0, 0, $product->info_bits, '', '', array(), '', $product->multicurrency_subprice, 'HT', $multicurrency_tx, $product->multicurrency_code, '', '', '');
$productsupplier->update_buyprice($product->qty, $product->total_ht, $user, 'HT', $this->thirdparty, '', $ref_fourn, $product->tva_tx, 0, 0, 0, $product->info_bits, '', '', array(), '', $product->multicurrency_total_ht, 'HT', $multicurrency_tx, $product->multicurrency_code, '', '', '' );
}
return 1;
@ -1849,7 +1849,7 @@ class SupplierProposal extends CommonObject
public function createPriceFournisseur($product, $user)
{
global $conf;
$price=price2num($product->subprice*$product->qty, 'MU');
$qty=price2num($product->qty);
$unitPrice = price2num($product->subprice, 'MU');