BUG change field name for e_march_sell & _buy
This commit is contained in:
parent
b8ba6babc5
commit
57632975d2
3 changed files with 21 additions and 21 deletions
|
|
@ -38,8 +38,8 @@ function trim(s) {
|
|||
*/
|
||||
function clean_Fid(p_ctl)
|
||||
{
|
||||
nSell=p_ctl+"_sell";
|
||||
nBuy=p_ctl+"_buy";
|
||||
nSell=p_ctl+"_price";
|
||||
nBuy=p_ctl+"_price";
|
||||
nTva_id=p_ctl+"_tva_id";
|
||||
if ( $(nSell) ) { $(nSell).value=""; }
|
||||
if ( $(nBuy) ) { $(nBuy).value="";}
|
||||
|
|
@ -101,8 +101,8 @@ function successFid(request,json) {
|
|||
$(toSet).style.color="red";
|
||||
clean_Fid(ctl);
|
||||
} else {
|
||||
var nSell=ctl+"_sell";
|
||||
var nBuy=ctl+"_buy";
|
||||
var nSell=ctl+"_price";
|
||||
var nBuy=ctl+"_price";
|
||||
var nTva_id=ctl+"_tva_id";
|
||||
$(toSet).innerHTML=data;
|
||||
$(toSet).style.color="black";
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ function ledger_sold_add_row(){
|
|||
|
||||
newNode.innerHTML=new_tt;
|
||||
$("e_march"+nb.value+"_label").innerHTML=' ';
|
||||
$("e_march"+nb.value+"_sell").value='0';
|
||||
$("e_march"+nb.value+"_price").value='0';
|
||||
$("e_march"+nb.value).value="";
|
||||
$("e_quant"+nb.value).value="1";
|
||||
|
||||
|
|
@ -416,9 +416,9 @@ function compute_sold(p_ctl_nb) {
|
|||
return;
|
||||
}
|
||||
var tva_id=$('e_march'+p_ctl_nb+'_tva_id').value;
|
||||
$('e_march'+p_ctl_nb+'_sell').value=trim($('e_march'+p_ctl_nb+'_sell').value);
|
||||
$('e_march'+p_ctl_nb+'_price').value=trim($('e_march'+p_ctl_nb+'_price').value);
|
||||
|
||||
var price=$('e_march'+p_ctl_nb+'_sell').value;
|
||||
var price=$('e_march'+p_ctl_nb+'_price').value;
|
||||
$('e_quant'+p_ctl_nb).value=trim($('e_quant'+p_ctl_nb).value);
|
||||
var quantity=$('e_quant'+p_ctl_nb).value;
|
||||
|
||||
|
|
@ -559,7 +559,7 @@ function ledger_purchase_add_row(){
|
|||
new_tt=new_tt.replace(/sold\(0\)/g,"sold("+nb.value+")");
|
||||
newNode.innerHTML=new_tt;
|
||||
$("e_march"+nb.value+"_label").innerHTML=' ';
|
||||
$("e_march"+nb.value+"_sell").value='0';
|
||||
$("e_march"+nb.value+"_price").value='0';
|
||||
$("e_march"+nb.value).value="";
|
||||
$("e_quant"+nb.value).value="1";
|
||||
nb.value++;
|
||||
|
|
@ -583,8 +583,8 @@ function compute_purchase(p_ctl_nb) {
|
|||
|
||||
var tva_id=$('e_march'+p_ctl_nb+'_tva_id').value;
|
||||
|
||||
$('e_march'+p_ctl_nb+'_buy').value=trim($('e_march'+p_ctl_nb+'_buy').value);
|
||||
var price=$('e_march'+p_ctl_nb+'_buy').value;
|
||||
$('e_march'+p_ctl_nb+'_price').value=trim($('e_march'+p_ctl_nb+'_price').value);
|
||||
var price=$('e_march'+p_ctl_nb+'_price').value;
|
||||
|
||||
$('e_quant'+p_ctl_nb).value=trim($('e_quant'+p_ctl_nb).value);
|
||||
var quantity=$('e_quant'+p_ctl_nb).value;
|
||||
|
|
@ -670,7 +670,7 @@ $('e_march'+p_ctl+'_tva_amount').value=0;
|
|||
function clean_sold( p_ctl_nb)
|
||||
{
|
||||
if ( $("e_march"+p_ctl_nb) ) { $("e_march"+p_ctl_nb).value=trim($("e_march"+p_ctl_nb).value); }
|
||||
if ($('e_march'+p_ctl_nb+'_sell')) { $('e_march'+p_ctl_nb+'_sell').value='';}
|
||||
if ($('e_march'+p_ctl_nb+'_price')) { $('e_march'+p_ctl_nb+'_price').value='';}
|
||||
if ( $('e_quant'+p_ctl_nb)) { $('e_quant'+p_ctl_nb).value='1'; }
|
||||
if ( $('tva_march'+p_ctl_nb+'_show') ) { $('tva_march'+p_ctl_nb+'_show').value='0';}
|
||||
if ($('tva_march'+p_ctl_nb)) { $('tva_march'+p_ctl_nb).value=0;}
|
||||
|
|
@ -680,7 +680,7 @@ function clean_sold( p_ctl_nb)
|
|||
}
|
||||
function clean_purchase(p_ctl_nb) {
|
||||
var qcode=$("e_march"+p_ctl_nb).value;
|
||||
$('e_march'+p_ctl_nb+'_buy').value='';
|
||||
$('e_march'+p_ctl_nb+'_price').value='';
|
||||
$('e_quant'+p_ctl_nb).value='1';
|
||||
$('e_march'+p_ctl_nb+'_tva_amount').value='0';
|
||||
$('tva_march'+p_ctl_nb).value=0;
|
||||
|
|
|
|||
|
|
@ -74,37 +74,37 @@ function SetValue(p_ctl,p_value)
|
|||
* i = ctl _name
|
||||
* p_id = code id (fiche.f_id)
|
||||
*¨p_label = label
|
||||
* p_sell vw_fiche_attr.vw_sell
|
||||
* p_buy vw_fiche_attr.vw_buy
|
||||
* p_price vw_fiche_attr.vw_price
|
||||
* p_price vw_fiche_attr.vw_price
|
||||
* p_tva_id vw_fiche_attr.tva_id
|
||||
* p_tva_label vw_fiche_attr.tva_label
|
||||
*/
|
||||
function SetData(i,p_id,p_label,p_sell,p_buy,p_tva_id, p_tva_label)
|
||||
function SetData(i,p_id,p_label,p_price,p_price,p_tva_id, p_tva_label)
|
||||
{
|
||||
SetValue(i,p_id);
|
||||
// for the form we use 1. and for span 2.
|
||||
//1. document.form_detail.eval(a).value=p_buy;
|
||||
//2. document.getElementById(a).innerHTML=p_sell;
|
||||
//1. document.form_detail.eval(a).value=p_price;
|
||||
//2. document.getElementById(a).innerHTML=p_price;
|
||||
|
||||
// Compute name of label ctl
|
||||
var a=i+'_label';
|
||||
document.getElementById(a).innerHTML=p_label;
|
||||
document.getElementById(a).style.color='black';
|
||||
// Compute name of sell ctl
|
||||
var a=i+'_sell';
|
||||
var a=i+'_price';
|
||||
// if the object exist
|
||||
var e=document.getElementsByName(a)
|
||||
if ( e.length != 0 ) {
|
||||
SetValue(a,p_sell);
|
||||
SetValue(a,p_price);
|
||||
|
||||
}
|
||||
|
||||
// Compute name of buy ctl
|
||||
var a=i+'_buy';
|
||||
var a=i+'_price';
|
||||
// if the object exist
|
||||
var e=document.getElementsByName(a)
|
||||
if ( e.length != 0 ) {
|
||||
SetValue(a,p_buy);
|
||||
SetValue(a,p_price);
|
||||
}
|
||||
// Compute name of tva_id ctl
|
||||
var a=i+'_tva_id';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue