diff --git a/html/ajax_misc.php b/html/ajax_misc.php index 5fa6fc560..bd9f124e8 100644 --- a/html/ajax_misc.php +++ b/html/ajax_misc.php @@ -257,6 +257,60 @@ if (array_key_exists($op, $path)) { } switch ($op) { + /* + * Get the currency rate + */ + case "CurrencyRate": + $a_answer=array(); + $a_answer['status']="NOK"; + $http=new HttpInput(); + try + { + $code=$http->get("p_code"); + if ( $code==-1) { + $a_answer['content']=1; + }else { + $a_answer['content']=$cn->get_value("select ch_value from v_currency_last_value where currency_id=$1", + [$code]); + } + $a_answer['status']="OK"; + } + catch (Exception $ex) + { + $a_answer['content']=$ex->getMessage(); + } + $jsson=json_encode($a_answer, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_NUMERIC_CHECK); + header('Content-Type: application/json;charset=utf-8'); + echo $jsson; + return; + + + break; + /* + * Get the currency code + */ + case "CurrencyCode": + $a_answer=array(); + $a_answer['status']="NOK"; + $http=new HttpInput(); + try + { + $code=$http->get("p_code"); + $a_answer['content']=$cn->get_value("select cr_code_iso||' ('||cr_name||')' from v_currency_last_value where currency_id=$1", + [$code]); + $a_answer['status']="OK"; + } + catch (Exception $ex) + { + $a_answer['content']=$ex->getMessage(); + } + $jsson=json_encode($a_answer, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_NUMERIC_CHECK); + header('Content-Type: application/json;charset=utf-8'); + echo $jsson; + return; + + + break; case "periode_change": $field=$http->get("field"); $type=$http->get("type"); diff --git a/html/js/acc_currency.js b/html/js/acc_currency.js index 356eef8df..51ff8ecc0 100644 --- a/html/js/acc_currency.js +++ b/html/js/acc_currency.js @@ -53,4 +53,93 @@ function CurrencyRateDelete(p_dossier, p_id) } }); +} +/** + * Update the field p_update with the rate from the currency + * @param DOMID p_code where the cr_code_iso will be selected + * @param DOMID p_update element to update + */ +function CurrencyUpdateValue(p_dossier,p_code,p_update) +{ + new Ajax.Request("ajax_misc.php",{ + method:"get", + asynchronous:false, + parameters:{p_code:$(p_code).value,gDossier:p_dossier,op:'CurrencyRate'}, + onSuccess:function (req) { + var answer=req.responseText.evalJSON(); + if ( answer.status == "OK") { + $(p_update).value=answer.content; + } else { + smoke.alert(answer.content); + } + } + }); +} +/** + * Update the field p_update with the code ISO from the currency + * @param DOMID p_code where the cr_code_iso will be selected + * @param DOMID p_update element to update + */ +function CurrencyUpdateCode(p_dossier,p_code,p_update) +{ + new Ajax.Request("ajax_misc.php",{ + method:"get", + parameters:{p_code:$(p_code).value,gDossier:p_dossier,op:'CurrencyCode'}, + onSuccess:function (req) { + var answer=req.responseText.evalJSON(); + if ( answer.status == "OK") { + $(p_update).innerHTML=answer.content; + } else { + smoke.alert(answer.content); + } + } + }); +} +/** + * Update the field Update with the amount in EUR + * @param DOMID p_rate where the rate is stored + * @param DOMID p_update element to update with the rate + */ +function CurrencyCompute(p_rate,p_update) +{ + var tvac=$('tvac').innerHTML; + + console.log("tvac= "+tvac); + if ( isNaN(tvac)) { + console.log("tva is nan" + tvac); + tvac=1; + } + var rate=$(p_rate).value; + console.log("rate = "+rate); + if ( isNaN(rate)) { + console.log("rate is nan" + rate); + rate=1; + } + var tot=tvac*rate; + tot=Math.round(tot*100)/100; + $(p_update).innerHTML=tot; + +} +/** + * + * @param {type} p_dossier + * @param {type} p_code + * @param {type} p_update + * @param {type} p_rate + * @param {type} p_eur_amount + * @returns {undefined} + */ +function LedgerCurrencyUpdate(p_dossier,p_code,p_update,p_rate,p_eur_amount) +{ + // Hide or show the row of the table with the amount in EUR + if ($(p_code).value != -1) { + $('row_currency').show(); + }else { + $('row_currency').hide(); + } + CurrencyUpdateValue(p_dossier,p_code,p_rate); + CurrencyUpdateCode(p_dossier,p_code,p_update); + // Compute all the fields + compute_all_ledger (); + } \ No newline at end of file diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js index 3bbe15048..52aa5b7a0 100644 --- a/html/js/acc_ledger.js +++ b/html/js/acc_ledger.js @@ -488,6 +488,7 @@ function success_compute_ledger(request, json) g('htva_march' + ctl).value = rhtva; g('tvac_march' + ctl).value = rtvac; g('sum').show(); + CurrencyCompute('p_currency_rate','p_currency_euro'); refresh_ledger(); return; @@ -497,6 +498,7 @@ function success_compute_ledger(request, json) g('sum').show(); + CurrencyCompute('p_currency_rate','p_currency_euro'); if (g('e_march' + ctl + '_tva_amount').value == "" || g('e_march' + ctl + '_tva_amount').value == 0) { g('tva_march' + ctl).value = rtva; @@ -549,7 +551,7 @@ function compute_all_ledger() if (g('tvac')) g('tvac').innerHTML = Math.round(tvac * 100) / 100; - + } function clean_tva(p_ctl) diff --git a/include/class/acc_compute.class.php b/include/class/acc_compute.class.php index a2282a2a9..20c7ee7ca 100644 --- a/include/class/acc_compute.class.php +++ b/include/class/acc_compute.class.php @@ -65,7 +65,10 @@ class Acc_Compute 'amount_nd_rate'=>'amount_nd_rate', 'nd_vat_rate'=>'nd_vat_rate', 'amount_perso'=>'amount_perso', - 'amount_perso_rate'=>'amount_perso_rate' + 'amount_perso_rate'=>'amount_perso_rate', + 'amount_currency'=>'amount_currency', + 'amount_vat_currency'=>'amount_vat_currency', + 'currency_rate'=>'currency_rate' ); private $order; // check that the compute @@ -82,7 +85,19 @@ class Acc_Compute $this->order=0; $this->check=true; } - + + function convert_euro() + { + $local_amount=$this->amount; + $this->amount=bcmul($this->amount,$this->currency_rate); + $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_currency=$local_amount; + } public function get_parameter($p_string) { if ( array_key_exists($p_string,self::$variable) ) @@ -109,12 +124,12 @@ class Acc_Compute { return var_export(self::$variable,true); } - function compute_vat() { if ( $this->check && $this->order != 0 ) throw new Exception ('ORDER NOT RESPECTED'); $this->amount_vat=bcmul($this->amount,$this->amount_vat_rate); $this->amount_vat=round($this->amount_vat,2); + $this->amount_currency=bcmul($this->amount_vat,$this->currency_rate); $this->order=1; } /*!\brief Compute the no deductible part of the amount, it reduce @@ -143,7 +158,7 @@ class Acc_Compute $this->nd_vat=bcdiv($this->nd_vat,100); $this->nd_vat=round($this->nd_vat,2); } - + function compute_ndded_vat() { if ( $this->check && $this->order > 4 ) throw new Exception ('ORDER NOT RESPECTED'); diff --git a/include/class/acc_currency.class.php b/include/class/acc_currency.class.php new file mode 100644 index 000000000..0e99cd958 --- /dev/null +++ b/include/class/acc_currency.class.php @@ -0,0 +1,120 @@ + + +require_once NOALYSS_INCLUDE."/database/v_currency_last_value_sql.class.php"; +/** + * @file + * @brief display currency , convert to euro , and save them if used + */ + +/** + * @class + * @brief display currency , convert to euro , and save them if used + */ +class Acc_Currency +{ + + private $cn; //!< database conx + private $currency; //!< v_currency_last_value_sql + + function __construct(Database $p_cn, $p_id=-1) + { + $this->cn=$p_cn; + $this->currency=new V_Currency_Last_Value_SQL($p_cn, $p_id); + } + + /** + * Retrieve a V_Currency_Last_Value_SQL thanks its iso_code + * @param string $p_iso + */ + function get_by_iso($p_iso) + { + $p_iso=trim(strtoupper($p_iso)); + $id=$this->cn->get_value("select currency_id from v_currency_last_value where cr_code_iso=$1", [$p_iso]); + if ($id!="") + { + $this->currency->setp("currency_id", $id); + $this->currency->load(); + } + } + + /** + * Retrieve a V_Currency_Last_Value_SQL thanks its id + * @param number $p_id + */ + function set_id($p_id) + { + $this->currency->setp("currency_id", $p_id); + $this->currency->load(); + } + /** + * Check if the record is found + * @return boolean + */ + function is_found() { + if ($this->currency->currency_id==-1) + { + return FALSE; + } + return TRUE; + } + /** + * return the rate of the currency + */ + function get_rate() + { + return $this->currency->getp("ch_value"); + + } + /** + * return the iso code of the currency + */ + function get_code() + { + return $this->currency->getp("cr_code_iso"); + + + } + /** + * return the id of the currency + */ + function get_id() + { + return $this->currency->getp("currency_id"); + + } + /** + * Create an object iselect to select the currency, + * @return \ISelect + */ + function select_currency() + { + $select=new ISelect('p_currency_code'); + $a_currency[0]=["value"=>-1,"label"=>"EUR"]; + $a_currency+=$this->cn->make_array("select currency_id,cr_code_iso from v_currency_last_value order by cr_code_iso"); + $select->value=$a_currency; + $select->selected=$this->currency->cr_code_iso; + + return $select; + } + + +} diff --git a/include/class/acc_ledger.class.php b/include/class/acc_ledger.class.php index f6254b13a..939b710a1 100644 --- a/include/class/acc_ledger.class.php +++ b/include/class/acc_ledger.class.php @@ -47,6 +47,8 @@ require_once NOALYSS_INCLUDE.'/class/acc_payment.class.php'; require_once NOALYSS_INCLUDE.'/class/acc_ledger_history.class.php'; //require_once NOALYSS_INCLUDE.'/class/print_ledger.class.php'; require_once NOALYSS_INCLUDE.'/lib/http_input.class.php'; +require_once NOALYSS_INCLUDE.'/class/acc_currency.class.php'; +require_once NOALYSS_INCLUDE.'/database/operation_currency_sql.class.php'; /** \file * @brief Class for jrn, class acc_ledger for manipulating the ledger @@ -2877,6 +2879,22 @@ class Acc_Ledger extends jrn_def_sql return FALSE; } + /** + * Create a select from value for currency and add javascript to update $p_currency_rate and + * $p_eur_amount + * @param string DOMID $p_currency_code + * @param string DOMID $p_currency_rate + * @param string DOMID $p_eur_amount + */ + function CurrencyInput($p_currency_code,$p_currency_rate,$p_eur_amount) + { + $currency = new Acc_Currency($this->db); + $select=$currency->select_currency(); + $select->javascript=sprintf('onchange="LedgerCurrencyUpdate(\'%s\',\'%s\',\'%s\',\'%s\',\'%s\');$(\'update_p_currency_rate\').innerHTML=$(\'p_currency_rate\').value;"', + Dossier::id(),$select->name,$p_currency_code,$p_currency_rate,$p_eur_amount); + return $select; + } + } ?> diff --git a/include/class/acc_ledger_purchase.class.php b/include/class/acc_ledger_purchase.class.php index b40122282..6e53be9c7 100644 --- a/include/class/acc_ledger_purchase.class.php +++ b/include/class/acc_ledger_purchase.class.php @@ -42,6 +42,7 @@ require_once NOALYSS_INCLUDE.'/class/acc_ledger_info.class.php'; require_once NOALYSS_INCLUDE.'/class/acc_ledger_fin.class.php'; require_once NOALYSS_INCLUDE.'/class/stock_goods.class.php'; + /*!\brief Handle the ledger of purchase, * * @@ -486,6 +487,8 @@ class Acc_Ledger_Purchase extends Acc_Ledger [bon_comm] => [other_info] => [record] =>Enregistrement + [p_currency_code]=> id currency + [p_currency_rate]=>rate used ) \endcode *\return string @@ -539,7 +542,11 @@ class Acc_Ledger_Purchase extends Acc_Ledger $tot_tva_nd=0; $tot_tva_ndded=0; $tot_tva_reversed=0; - $tva=array(); + $tva=array(); + + // find the currency from v_currency_last_value + $currency_rate_ref=new Acc_Currency($this->db, $p_currency_code); + /* Save all the items without vat and no deductible vat and expense*/ for ($i=0;$i< $nb_item;$i++) { @@ -568,12 +575,16 @@ class Acc_Ledger_Purchase extends Acc_Ledger $acc_operation->periode=$tperiode; $acc_operation->qcode=""; $amount_4=bcmul(${'e_march'.$i.'_price'},${'e_quant'.$i}); + /* We have to compute all the amount thanks Acc_Compute */ $amount=round($amount_4,2); $acc_amount=new Acc_Compute(); $acc_amount->check=false; $acc_amount->set_parameter('amount',$amount); + // Set the currency rate + $acc_amount->set_parameter("currency_rate", $p_currency_rate); + $acc_amount->convert_euro(); // Compute VAT or take the given one if ( $g_parameter->MY_TVA_USE=='Y') @@ -581,14 +592,18 @@ class Acc_Ledger_Purchase extends Acc_Ledger $acc_amount->set_parameter('amount_vat_rate',$oTva->get_parameter('rate')); if ( strlen(trim(${'e_march'.$i.'_tva_amount'})) ==0 || ${'e_march'.$i.'_tva_amount'} == 0) { + // vat is in euro $acc_amount->compute_vat(); } else { - $acc_amount->amount_vat= ${'e_march'.$i.'_tva_amount'}; + // we convert the vat in euro + $acc_amount->set_parameter("amount_vat", ${'e_march'.$i.'_tva_amount'}); + $acc_amount->convert_euro_vat(); } + // convert amount in eur $tot_tva=bcadd($tot_tva,$acc_amount->amount_vat); } @@ -603,7 +618,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger - $tot_amount=round(bcadd($tot_amount,$amount),2); + $tot_amount=round(bcadd($tot_amount,$acc_amount->amount),2); /* get the account and explode if necessary */ $sposte=$fiche->strAttribut(ATTR_DEF_ACCOUNT); @@ -617,14 +632,21 @@ class Acc_Ledger_Purchase extends Acc_Ledger { $poste_val=$sposte; } - if ( $g_parameter->MY_UPDLAB=='Y') + if ($g_parameter->MY_UPDLAB=='Y') + { $acc_operation->desc=strip_tags(${"e_march".$i."_label"}); + } else + { $acc_operation->desc=null; + } $acc_operation->poste=$poste_val; $acc_operation->amount=$acc_amount->amount; $acc_operation->qcode=${"e_march".$i}; - if( $acc_amount->amount > 0 ) $tot_debit=bcadd($tot_debit,$acc_amount->amount); + if ($acc_amount->amount>0) + { + $tot_debit=bcadd($tot_debit, $acc_amount->amount); + } $j_id=$acc_operation->insert_jrnx(); /* insert ND */ @@ -636,11 +658,12 @@ class Acc_Ledger_Purchase extends Acc_Ledger { $tva_item=$acc_amount->amount_vat; - if (isset($tva[$idx_tva] ) ) - $tva[$idx_tva]=bcadd($tva[$idx_tva],$tva_item); + if (isset($tva[$idx_tva])) + { + $tva[$idx_tva]=bcadd($tva[$idx_tva], $tva_item); + } else $tva[$idx_tva]=$tva_item; - } /* Save the stock */ /* if the quantity is < 0 then the stock increase (return of @@ -660,6 +683,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger { // for each item, insert into operation_analytique */ $op=new Anc_Operation($this->db); + $op->set_currency_rate($p_currency_rate); $op->oa_group=$group; $op->j_id=$j_id; $op->oa_date=$e_date; @@ -669,6 +693,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger } // insert into quant_purchase //----- + $price_euro=bcmul(${'e_march'.$i.'_price'}, $p_currency_rate); if ( $g_parameter->MY_TVA_USE=='Y') { @@ -678,7 +703,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger ,$j_id /* 2 */ ,${"e_march".$i} /* 3 */ ,${"e_quant".$i} /* 4 */ - ,round($amount,2) /* 5 */ + ,round($acc_amount->amount,2) /* 5 */ ,$acc_amount->amount_vat /* 6 */ ,$oTva->get_parameter('id') /* 7 */ ,$acc_amount->amount_nd /* 8 */ @@ -687,20 +712,21 @@ class Acc_Ledger_Purchase extends Acc_Ledger ,$acc_amount->amount_perso /* 11 */ ,$e_client /* 12 */ , $acc_amount->amount_unpaid /*13*/ - ,${'e_march'.$i.'_price'} /* 14 */ + ,$price_euro /* 14 */ )); } else { + $acc_amount->amount_vat=0; $r=$this->db->exec_sql("select insert_quant_purchase ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14)", array( null /*1*/ ,$j_id /* 2 */ ,${"e_march".$i} /* 3 */ ,${"e_quant".$i} /* 4 */ - ,round($amount,2) /* 5 */ + ,round($acc_amount->$amount,2) /* 5 */ ,0 /* 6 */ ,null/* 7 */ ,$acc_amount->amount_nd /* 8 */ @@ -709,10 +735,19 @@ class Acc_Ledger_Purchase extends Acc_Ledger ,$acc_amount->amount_perso /* 11 */ ,$e_client /* 12 */ , $acc_amount->amount_unpaid /*13*/ - ,${'e_march'.$i.'_price'} /* 14 */ + ,$price_euro /* 14 */ )); } - + /* + * Insert also in operation_currency + */ + $operation_currency=new Operation_currency_SQL($this->db); + $operation_currency->oc_amount=$acc_amount->amount_currency; + $operation_currency->oc_vat_amount=$acc_amount->amount_vat_currency; + $operation_currency->oc_price_unit=${'e_march'.$i.'_price'}; + $operation_currency->j_id=$j_id; + $operation_currency->insert(); + } // end loop : save all items /* save total customer */ $cust_amount=round(bcadd($tot_amount,$tot_tva),2); @@ -725,8 +760,10 @@ class Acc_Ledger_Purchase extends Acc_Ledger $acc_operation->type='c'; $acc_operation->periode=$tperiode; $acc_operation->qcode=${"e_client"}; - if ( $cust_amount < 0 ) - $tot_debit=bcadd($tot_debit,abs($cust_amount)); + if ($cust_amount<0) + { + $tot_debit=bcadd($tot_debit, abs($cust_amount)); + } $let_client=$acc_operation->insert_jrnx(); @@ -790,7 +827,13 @@ class Acc_Ledger_Purchase extends Acc_Ledger $acc_operation->periode=$tperiode; $acc_operation->pj=$e_pj; $acc_operation->mt=$mt; - $this->jr_id=$acc_operation->insert_jrn(); + $acc_operation->currency_id=$p_currency_code; + $acc_operation->currency_rate=$p_currency_rate; + $acc_operation->currency_rate_ref=$currency_rate_ref->get_rate(); + + if ( ! $this->jr_id=$acc_operation->insert_jrn() ) { + throw new Exception (_("Erreur de balance")); + } $this->pj=$acc_operation->set_pj(); // Set Internal code @@ -981,6 +1024,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger public function input($p_array=null,$p_readonly=0) { global $g_parameter,$g_user; + $http=new HttpInput(); if ( $p_array != null ) extract($p_array, EXTR_SKIP); $flag_tva=$g_parameter->MY_TVA_USE; @@ -1301,6 +1345,18 @@ class Acc_Ledger_Purchase extends Acc_Ledger } $f_type=_('Fournisseur'); + + // Currency + $currency_select = $this->CurrencyInput("currency_code", "p_currency_rate" , "p_currency_euro"); + $currency_select->selected=$http->request('p_currency_code','string',-1); + + $currency_input=new INum("p_currency_rate"); + $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\');"'; + + + // // Button for template operation // @@ -1341,19 +1397,18 @@ class Acc_Ledger_Purchase extends Acc_Ledger /*!@brief show the summary of the operation and propose to save it *@param array contains normally $_POST. It proposes also to save * the Analytic accountancy - * @param $p_summary true to confirm false, show only the result in RO + * @param $p_summary true to confirm false, show only the result in RO *@return string */ function confirm($p_array,$p_summary=false) { global $g_parameter; - extract ($p_array); + extract ($p_array,EXTR_SKIP); // we don't need to verify if we need only a feedback - if ( ! $p_summary ) - $this->verify($p_array) ; - - $anc=null; + if ( ! $p_summary ){$this->verify($p_array) ;} + + $anc=null; // to show a select list for the analytic // if analytic is op (optionnel) there is a blank line @@ -1583,33 +1638,59 @@ class Acc_Ledger_Purchase extends Acc_Ledger // Add the sum $decalage=($g_parameter->MY_TVA_USE == 'Y')?'
| montant | |
|---|---|
| "._("montant")." | '.$select->input().' | '; + } else + { $result.=''.$select->display().' | '; + } $count++; } $value=new INum(); $value->javascript='onchange="format_number(this);anc_refresh_remain(\''.$this->in_div.$table_id.'\',\''.$p_seq.'\')"'; - $value->name="val[".$p_seq."][]"; + $value->name=($readonly)?"ro"."val[".$p_seq."][]":"val[".$p_seq."][]"; $value->size=6; $value->value=(isset($val[$p_seq][$i]))?$val[$p_seq][$i]:abs($p_amount); $value->value=round($value->value,2); @@ -701,6 +723,8 @@ class Anc_Operation $op->j_id=$p_j_id; $ratio=bcdiv($val[$p_item][$row],${"amount_t".$p_item}); $amount= bcmul($p_nd, $ratio); + // convert to euro + $amount=bcmul($amount,$this->currency_rate); $op->oa_amount=round($amount,2); $op->oa_debit=$this->oa_debit; $op->oa_date=$this->oa_date; @@ -730,7 +754,7 @@ class Anc_Operation } } /*!\brief it called for each item, the data are taken from $p_array - * data and set before in this. + * data and set before in this. Amount will be transformed thanks the $this->currency_rate; * \param $p_item if the item nb for each item (purchase or selling * merchandise) * \param $p_array structure @@ -780,7 +804,8 @@ class Anc_Operation $op->po_id=$hplan[$p_item][$e]; $op->oa_group=$this->oa_group; $op->j_id=$p_j_id; - $op->oa_amount=$val[$p_item][$row]; + // convert oa_amount to EUR + $op->oa_amount=bcmul($val[$p_item][$row],$this->currency_rate); $op->oa_debit=$this->oa_debit; $op->oa_date=$this->oa_date; diff --git a/include/compta_ach.inc.php b/include/compta_ach.inc.php index 889137875..5ad7e6ea2 100644 --- a/include/compta_ach.inc.php +++ b/include/compta_ach.inc.php @@ -120,7 +120,7 @@ if (isset($_POST['view_invoice'])) '; diff --git a/include/compta_ven.inc.php b/include/compta_ven.inc.php index d5109ea7b..756466904 100644 --- a/include/compta_ven.inc.php +++ b/include/compta_ven.inc.php @@ -128,7 +128,7 @@ $p_msg=""; '; diff --git a/include/database/operation_currency_sql.class.php b/include/database/operation_currency_sql.class.php new file mode 100644 index 000000000..f624964f8 --- /dev/null +++ b/include/database/operation_currency_sql.class.php @@ -0,0 +1,67 @@ +table="public.operation_currency"; + $this->primary_key="id"; + /* + * List of columns + */ + $this->name=array( + "id"=>"id" + , "oc_amount"=>"oc_amount" + , "oc_vat_amount"=>"oc_vat_amount" + , "oc_price_unit"=>"oc_price_unit" + , "j_id"=>"j_id" + ); + /* + * Type of columns + */ + $this->type=array( + "id"=>"numeric" + , "oc_amount"=>"numeric" + , "oc_vat_amount"=>"numeric" + , "oc_price_unit"=>"numeric" + , "j_id"=>"numeric" + ); + + + $this->default=array( + "id"=>"auto" + ); + + $this->date_format="DD.MM.YYYY"; + parent::__construct($p_cn, $p_id); + } + +} diff --git a/include/template/form_ledger_detail.php b/include/template/form_ledger_detail.php index a6357d549..6c3543922 100644 --- a/include/template/form_ledger_detail.php +++ b/include/template/form_ledger_detail.php @@ -1,6 +1,7 @@
| + =_("Devise")?> + | ++ =$currency_select->input()?> + =$currency_input->change()?>EUR + | +