From 4624fd244512a26e16d0c15a0014f34bc2c9e679 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Thu, 26 Mar 2020 09:23:19 +0100 Subject: [PATCH] Fix add mulitcurrency line in supplier proposal --- htdocs/supplier_proposal/card.php | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 2c23f578fb4..1956099b406 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -11,6 +11,7 @@ * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Ferran Marcet * Copyright (C) 2018 Frédéric France + * Copyright (C) 2020 Tobias Sekan * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -715,7 +716,7 @@ if (empty($reshook)) setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'errors'); } } - elseif ((GETPOST('price_ht') !== '' || GETPOST('price_ttc') !== '') && empty($error)) // Free product. // $price_ht is already set + elseif ((GETPOST('price_ht') !== '' || GETPOST('price_ttc') !== '' || GETPOST('multicurrency_price_ht') != '') && empty($error)) // Free product. // $price_ht is already set { $pu_ht = price2num($price_ht, 'MU'); $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); @@ -745,8 +746,31 @@ if (empty($reshook)) $price_base_type = 'HT'; $pu_ht_devise = price2num($price_ht_devise, 'MU'); - $result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $pu_ttc, $info_bits, $type, - 1, 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $ref_supplier, $fk_unit); - //$result = $object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', $remise_percent, $price_base_type, $ttc, $type,'','', $date_start, $date_end, $array_options, $fk_unit); + $result = $object->addline( + $desc, + $pu_ht, + $qty, + $tva_tx, + $localtax1_tx, + $localtax2_tx, + $idprod, + $remise_percent, + $price_base_type, + $pu_ttc, + $info_bits, + $type, + -1, // rang + 0, // special_code + GETPOST('fk_parent_line'), + $fournprice, + $buyingprice, + $label, + $array_options, + $ref_supplier, + $fk_unit, + '', // origin + 0, // origin_id + $pu_ht_devise); }