diff --git a/html/js/ajax_fiche.js b/html/js/ajax_fiche.js
index 7757915cb..60106c556 100644
--- a/html/js/ajax_fiche.js
+++ b/html/js/ajax_fiche.js
@@ -116,8 +116,8 @@ function successFid(request,json) {
if ( ftva_id != 'none') { set_value(ftva_id,answer.tva_id);}
if ( flabel != 'none') { set_value(flabel,answer.name);}
- if ( fpurchase != 'none') { set_value(fpurchase,answer.buy);}
if ( fsale != 'none') { set_value(fsale,answer.sell);}
+ if ( fpurchase != 'none') { set_value(fpurchase,answer.buy);}
}
diff --git a/include/class_acc_ledger_purchase.php b/include/class_acc_ledger_purchase.php
index 832ddf536..d897c5b22 100644
--- a/include/class_acc_ledger_purchase.php
+++ b/include/class_acc_ledger_purchase.php
@@ -937,7 +937,9 @@ array
// name of the field to update with the name of the card
$W1->set_attribute('label','e_march'.$i.'_label');
// name of the field with the price
- $W1->set_attribute('purchase','e_march'.$i.'_price');
+ $W1->set_attribute('purchase','e_march'.$i.'_price'); /* autocomplete */
+ $W1->set_attribute('price','e_march'.$i.'_price'); /* via search */
+
// name of the field with the TVA_ID
$W1->set_attribute('tvaid','e_march'.$i.'_tva_id');
// Add the callback function to filter the card on the jrn