From 9decd4b54634c6402a9826ae4c5e54bc6492bfed Mon Sep 17 00:00:00 2001 From: sparkyx Date: Thu, 31 May 2007 20:16:15 +0000 Subject: [PATCH] Fix bug with the ledger of purchase --- html/fid.php | 7 ++++--- html/js/ajax_fiche.js | 14 ++++++++++---- include/user_form_ach.php | 26 +++++++++++++------------- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/html/fid.php b/html/fid.php index ea2cf0673..81811b9ac 100644 --- a/html/fid.php +++ b/html/fid.php @@ -10,15 +10,16 @@ if ( isset($_SESSION['isValid']) && $_SESSION['isValid'] == 1) $deb_cred=($_GET['d']=='cred')?"jrn_def_fiche_cred":"jrn_def_fiche_deb"; $jrn=$_GET['j']; $filter_jrn=Getdbvalue($cn,"select $deb_cred from jrn_def where jrn_def_id=$jrn"); - $array=GetArray($cn,"select vw_name,vw_addr,vw_cp,vw_sell,tva_id + $array=GetArray($cn,"select vw_name,vw_addr,vw_cp,vw_buy,vw_sell,tva_id from vw_fiche_attr where quick_code=upper('".$_GET['FID']."') and fd_id in ($filter_jrn)" ); echo_debug("fid",__LINE__,$array); $name=$array[0]['vw_name']." ".$array[0]['vw_addr']." ".$array[0]['vw_cp']; - $price=$array[0]['vw_sell']; + $sell=$array[0]['vw_sell']; + $buy=$array[0]['vw_buy']; $tva_id=$array[0]['tva_id']; - $a=( $array != null)?"$name/$price/$tva_id":""; + $a=( $array != null)?"$name/$sell/$buy/$tva_id":""; } else $a="not connected"; diff --git a/html/js/ajax_fiche.js b/html/js/ajax_fiche.js index 1b41163c0..321aada41 100644 --- a/html/js/ajax_fiche.js +++ b/html/js/ajax_fiche.js @@ -61,16 +61,22 @@ function ajaxFid(p_ctl,p_deb,p_jrn){ var ctl_toSet=document.getElementById(toSet); ctl_toSet.style.color='black'; ctl_toSet.innerHTML=a_resp[0]; - nPrice=p_ctl+"_sell"; + nSell=p_ctl+"_sell"; + nBuy=p_ctl+"_buy"; nTva_id=p_ctl+"_tva_id"; - if ( document.getElementById(nPrice) != null ) { + if ( document.getElementById(nSell) != null ) { - document.getElementById(nPrice).value=a_resp[1]; + document.getElementById(nSell).value=a_resp[1]; } + if ( document.getElementById(nBuy) != null ) { + + document.getElementById(nBuy).value=a_resp[2]; + } + if ( document.getElementById(nTva_id) != null ) { - document.getElementById(nTva_id).value=a_resp[2]; + document.getElementById(nTva_id).value=a_resp[3]; } } } diff --git a/include/user_form_ach.php b/include/user_form_ach.php index bdbc0f022..add660f7c 100644 --- a/include/user_form_ach.php +++ b/include/user_form_ach.php @@ -38,7 +38,7 @@ require_once("class_parm_code.php"); *