Currency : Precision 6
This commit is contained in:
parent
656b1cfb88
commit
cc5c5abd6e
6 changed files with 28 additions and 8 deletions
|
|
@ -89,13 +89,13 @@ class Acc_Compute
|
|||
function convert_euro()
|
||||
{
|
||||
$local_amount=$this->amount;
|
||||
$this->amount=bcmul($this->amount,$this->currency_rate);
|
||||
$this->amount=bcmul($this->amount,$this->currency_rate,6);
|
||||
$this->amount_currency=$local_amount;
|
||||
}
|
||||
function convert_euro_vat()
|
||||
{
|
||||
$local_amount=$this->amount_vat;
|
||||
$this->amount_vat=bcmul($this->amount_vat,$this->currency_rate);
|
||||
$this->amount_vat=bcmul($this->amount_vat,$this->currency_rate,6);
|
||||
$this->amount_vat_currency=$local_amount;
|
||||
}
|
||||
public function get_parameter($p_string)
|
||||
|
|
|
|||
|
|
@ -913,12 +913,12 @@ class Acc_Ledger extends jrn_def_sql
|
|||
$currency_select = $this->CurrencyInput("currency_code", "p_currency_rate" , "p_currency_euro");
|
||||
$currency_select->selected=$http->request('p_currency_code','string',0);
|
||||
|
||||
$currency_input=new INum("p_currency_rate",6);
|
||||
$currency_input=new INum("p_currency_rate");
|
||||
$currency_input->prec=6;
|
||||
$currency_input->id="p_currency_rate";
|
||||
$currency_input->value=$http->request('p_currency_rate','string',1);
|
||||
$currency_input->javascript='onchange="format_number(this,6);CurrencyCompute(\'p_currency_rate\',\'p_currency_euro\');"';
|
||||
$ret.=_("Devise")." ".$currency_select->input();
|
||||
$ret.=$currency_input->change();
|
||||
$ret.=$currency_input->change('CurrencyComputeMisc(\'p_currency_rate\',\'p_currency_euro\');');
|
||||
$currency=new Acc_Currency($this->db,0);
|
||||
$ret.=$currency->get_code();
|
||||
|
||||
|
|
|
|||
|
|
@ -1397,9 +1397,10 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
$currency_select->selected=$http->request('p_currency_code','string',0);
|
||||
|
||||
$currency_input=new INum("p_currency_rate");
|
||||
$currency_input->prec=6;
|
||||
$currency_input->id="p_currency_rate";
|
||||
$currency_input->value=$http->request('p_currency_rate','string',1);
|
||||
$currency_input->javascript='onchange="format_number(this,4);CurrencyCompute(\'p_currency_rate\',\'p_currency_euro\');"';
|
||||
$currency_input->javascript='onchange="format_number(this,6);CurrencyCompute(\'p_currency_rate\',\'p_currency_euro\');"';
|
||||
|
||||
$currency=new Acc_Currency($this->db,0);
|
||||
|
||||
|
|
|
|||
|
|
@ -1490,6 +1490,7 @@ EOF;
|
|||
|
||||
$currency_input=new INum("p_currency_rate");
|
||||
$currency_input->id="p_currency_rate";
|
||||
$currency_input->prec=6;
|
||||
$currency_input->value=$http->request('p_currency_rate','string',1);
|
||||
$currency_input->javascript='onchange="format_number(this,4);CurrencyCompute(\'p_currency_rate\',\'p_currency_euro\');"';
|
||||
|
||||
|
|
|
|||
|
|
@ -893,7 +893,7 @@ function check()
|
|||
$text->size=$min_size;
|
||||
echo $text->input();
|
||||
}
|
||||
elseif ($this->a_type[$key]=="numeric")
|
||||
elseif ($this->a_type[$key]=="numeric") // number 2 decimale
|
||||
{
|
||||
$text=new INum($key);
|
||||
$text->value=$value;
|
||||
|
|
@ -901,6 +901,24 @@ function check()
|
|||
$text->size=$min_size;
|
||||
echo $text->input();
|
||||
}
|
||||
elseif ($this->a_type[$key]=="numeric4") // number 4 decimale
|
||||
{
|
||||
$text=new INum($key);
|
||||
$text->prec=4;
|
||||
$text->value=$value;
|
||||
$min_size=(strlen($value)<10)?10:strlen($value)+1;
|
||||
$text->size=$min_size;
|
||||
echo $text->input();
|
||||
}
|
||||
elseif ($this->a_type[$key]=="numeric6") // number 6 decimale
|
||||
{
|
||||
$text=new INum($key);
|
||||
$text->prec=6;
|
||||
$text->value=$value;
|
||||
$min_size=(strlen($value)<10)?10:strlen($value)+1;
|
||||
$text->size=$min_size;
|
||||
echo $text->input();
|
||||
}
|
||||
elseif ($this->a_type[$key]=="date")
|
||||
{
|
||||
$text=new IDate($key);
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@
|
|||
</td>
|
||||
<td>
|
||||
<?=$currency_select->input()?>
|
||||
<?=$currency_input->change()?>
|
||||
<?=$currency_input->change('CurrencyCompute(\'p_currency_rate\',\'p_currency_euro\');')?>
|
||||
<?=$currency->get_code();?>
|
||||
|
||||
</td>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue