Bug : fix problem with reformating number in Sales and Purchase Ledger
This commit is contained in:
parent
0af1b71ee4
commit
4deb13bf00
4 changed files with 21 additions and 15 deletions
|
|
@ -125,14 +125,15 @@ if ( isset($_SESSION['isValid']) && $_SESSION['isValid'] == 1)
|
|||
|
||||
|
||||
$name=$array[0]['vw_name'];
|
||||
$sell=$array[0]['vw_sell'] ;
|
||||
$buy=$array[0]['vw_buy'];
|
||||
$sell=(isNumber($array[0]['vw_sell']) == 1) ? $array[0]['vw_sell'] : 0 ;
|
||||
$buy=(isNumber($array[0]['vw_buy']) == 1) ?$array[0]['vw_buy']:0;
|
||||
|
||||
$tva_id=$array[0]['tva_id'];
|
||||
|
||||
// Check null
|
||||
$name=($name==null)?" ":str_replace('"','',$name);
|
||||
$sell=($sell==null)?" ":str_replace('"','',$sell);
|
||||
$buy=($buy==null)?" ":str_replace('"','',$buy);
|
||||
$sell=($sell==null)?"0":str_replace('"','',$sell);
|
||||
$buy=($buy==null)?"0":str_replace('"','',$buy);
|
||||
$tva_id=($tva_id==null)?" ":str_replace('"','',$tva_id);
|
||||
/* store the answer in an array and transform it later into a JSON object */
|
||||
$tmp=array();
|
||||
|
|
|
|||
|
|
@ -433,12 +433,17 @@ case 'fs':
|
|||
|
||||
/* if it is a ledger of sales we use vw_buy
|
||||
if it is a ledger of purchase we use vw_sell*/
|
||||
if ( $type=="ACH" )
|
||||
|
||||
if ( $type=="ACH" ){
|
||||
$amount=(isNumber($a[$i]['vw_buy']) == 1 )?$a[$i]['vw_buy']:0;
|
||||
$array[$i]['javascript'].=sprintf("set_value('%s','%s');",
|
||||
$price,$a[$i]['vw_buy']);
|
||||
if ( $type=="VEN" )
|
||||
$price,$amount);
|
||||
}
|
||||
if ( $type=="VEN" ){
|
||||
$amount=(isNumber($a[$i]['vw_buy']) == 1 )?$a[$i]['vw_sell']:0;
|
||||
$array[$i]['javascript'].=sprintf("set_value('%s','%s');",
|
||||
$price,$a[$i]['vw_sell']);
|
||||
$price,$amount);
|
||||
}
|
||||
$array[$i]['javascript'].=sprintf("set_value('%s','%s');",
|
||||
$tvaid,$a[$i]['tva_id']);
|
||||
$array[$i]['javascript'].="removeDiv('search_card');";
|
||||
|
|
|
|||
|
|
@ -1265,7 +1265,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
$Price=new INum();
|
||||
$Price->setReadOnly(false);
|
||||
$Price->size=9;
|
||||
$Price->javascript="onBlur='format_number(this,4);clean_tva($i);compute_ledger($i)'";
|
||||
$Price->javascript="onblur=\"format_number(this,4);clean_tva($i);compute_ledger($i)\"";
|
||||
$array[$i]['pu']=$Price->input("e_march".$i."_price",$march_price);
|
||||
if ( $g_parameter->MY_TVA_USE=='Y')
|
||||
{
|
||||
|
|
@ -1273,7 +1273,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
// vat label
|
||||
//--
|
||||
$Tva=new ITva_Popup($this->db);
|
||||
$Tva->js="onblur=\"format_number(this);onChange=clean_tva($i);compute_ledger($i)\"";
|
||||
$Tva->js="onblur=\"format_number(this);clean_tva($i);compute_ledger($i)\"";
|
||||
$Tva->in_table=true;
|
||||
$Tva->set_attribute('compute',$i);
|
||||
$Tva->set_filter("purchase");
|
||||
|
|
@ -1286,7 +1286,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
$Tva_amount=new INum();
|
||||
$Tva_amount->setReadOnly(false);
|
||||
$Tva_amount->size=9;
|
||||
$Tva_amount->javascript="onBlur='format_number(this);compute_ledger($i)'";
|
||||
$Tva_amount->javascript="onblur=\"format_number(this);compute_ledger($i)\"";
|
||||
$array[$i]['amount_tva']=$Tva_amount->input("e_march".$i."_tva_amount",$march_tva_amount);
|
||||
}
|
||||
// quantity
|
||||
|
|
@ -1296,7 +1296,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
$Quantity=new INum();
|
||||
$Quantity->setReadOnly(false);
|
||||
$Quantity->size=9;
|
||||
$Quantity->javascript="onChange=format_number(this);clean_tva($i);compute_ledger($i)";
|
||||
$Quantity->javascript="onchange=\"format_number(this);clean_tva($i);compute_ledger($i)\"";
|
||||
$array[$i]['quantity']=$Quantity->input("e_quant".$i,$quant);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1303,7 +1303,7 @@ EOF;
|
|||
$Price = new INum();
|
||||
$Price->setReadOnly(false);
|
||||
$Price->size = 9;
|
||||
$Price->javascript = "onBlur='format_number(this,4);clean_tva($i);compute_ledger($i)'";
|
||||
$Price->javascript = "onblur=\"format_number(this,4);clean_tva($i);compute_ledger($i)\"";
|
||||
$array[$i]['pu'] = $Price->input("e_march" . $i . "_price", $march_price);
|
||||
$array[$i]['tva'] = '';
|
||||
$array[$i]['amount_tva'] = '';
|
||||
|
|
@ -1324,7 +1324,7 @@ EOF;
|
|||
$wTva_amount = new INum();
|
||||
$wTva_amount->readOnly = false;
|
||||
$wTva_amount->size = 6;
|
||||
$wTva_amount->javascript = "onBlur='format_number(this);compute_ledger($i)'";
|
||||
$wTva_amount->javascript = "onblur='format_number(this);compute_ledger($i)'";
|
||||
$array[$i]['amount_tva'] = $wTva_amount->input("e_march" . $i . "_tva_amount", $march_tva_amount);
|
||||
}
|
||||
// quantity
|
||||
|
|
@ -1334,7 +1334,7 @@ EOF;
|
|||
$Quantity = new INum();
|
||||
$Quantity->setReadOnly(false);
|
||||
$Quantity->size = 8;
|
||||
$Quantity->javascript = "onChange='format_number(this);clean_tva($i);compute_ledger($i)'";
|
||||
$Quantity->javascript = "onchange='format_number(this);clean_tva($i);compute_ledger($i)'";
|
||||
$array[$i]['quantity'] = $Quantity->input("e_quant" . $i, $quant);
|
||||
}// foreach article
|
||||
$f_type = _('Client');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue